code stringlengths 1 1.49M | file_id stringlengths 42 46 | node_count int64 0 7.38k | total_lines int64 1 20.9k | vector_dim int64 15 15 | vector_labels stringclasses 1
value | nodes stringlengths 2 3.75M | connections stringlengths 2 964k |
|---|---|---|---|---|---|---|---|
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
import oauth2
import smtplib
import base64
class SMTP(smtplib.SMTP):
"""SMTP wrapper for smtplib.SMTP that implements XOAUTH."""
def authenticate(self, url, consumer, token):
if consumer is not None and not isinstance(consumer, oauth2.Consumer):
raise ValueError("Invalid consumer.")
if token is not None and not isinstance(token, oauth2.Token):
raise ValueError("Invalid token.")
self.docmd('AUTH', 'XOAUTH %s' % \
base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))
| ajibawa-2023/Python-Code-Large/train/row_99163 | 10 | 41 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99163:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 23], "level": 0, "parent": null, "vector": [8, 0, 0.2927, 0.561, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nThe MIT License\n\nCopyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:Import_L25_C0", "label": "oauth2 import oauth2", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.6098, 0.0244, 0, 0.66, 0.25, 311, 0, 1, 0, 0, 311, 0, 0], "semantic": {"name": "oauth2", "arg_names": [], "import_names": ["oauth2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:Import_L26_C0", "label": "smtplib import smtplib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.6341, 0.0244, 0, 0.66, 0.5, 389, 0, 1, 0, 0, 389, 0, 0], "semantic": {"name": "smtplib", "arg_names": [], "import_names": ["smtplib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smtplib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:Import_L27_C0", "label": "base64 import base64", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.6585, 0.0244, 0, 0.66, 0.75, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:ClassDef_L30_C0", "label": "SMTP", "type": "class", "loc": [30, 41], "level": 0, "parent": null, "vector": [3, 0, 0.8659, 0.2927, 0, 0.66, 1.0, 709, 0, 1, 0, 0, 243, 0, 7], "semantic": {"name": "SMTP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SMTP(smtplib.SMTP):\n \"\"\"SMTP wrapper for smtplib.SMTP that implements XOAUTH.\"\"\"\n\n def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:Expr_L31_C4", "label": "expression", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99163:ClassDef_L30_C0", "vector": [8, 1, 0.7561, 0.0244, 1, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"SMTP wrapper for smtplib.SMTP that implements XOAUTH.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "label": "authenticate", "type": "function", "loc": [33, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99163:ClassDef_L30_C0", "vector": [2, 1, 0.9024, 0.2195, 1, 0.94, 1.0, 751, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "authenticate", "arg_names": ["self", "url", "consumer", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authenticate(self, url, consumer, token):\n if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")\n\n if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")\n\n self.docmd('AUTH', 'XOAUTH %s' % \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "vector": [4, 2, 0.8415, 0.0488, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if consumer is not None and not isinstance(consumer, oauth2.Consumer):\n raise ValueError(\"Invalid consumer.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:If_L37_C8", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "vector": [4, 2, 0.9146, 0.0488, 2, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token is not None and not isinstance(token, oauth2.Token):\n raise ValueError(\"Invalid token.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99163:Expr_L40_C8", "label": "docmd()", "type": "expression", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "vector": [8, 2, 0.9878, 0.0488, 2, 0.5, 1.0, 540, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "docmd", "arg_names": [], "import_names": [], "rhs_call_name": "docmd", "annotation": ""}, "snippet": " self.docmd('AUTH', 'XOAUTH %s' % \\\n base64.b64encode(oauth2.build_xoauth_string(url, consumer, token)))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99163:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99163:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99163:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99163:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99163:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99163:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99163:Expr_L40_C8"}] |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off of:
* client_id
* user_agent
* scope
The format of the stored data is like so:
{
'file_version': 1,
'data': [
{
'key': {
'clientId': '<client id>',
'userAgent': '<user agent>',
'scope': '<scope>'
},
'credential': {
# JSON serialized Credentials.
}
}
]
}
"""
__author__ = 'jbeda@google.com (Joe Beda)'
import base64
import errno
import logging
import os
import threading
from anyjson import simplejson
from client import Storage as BaseStorage
from client import Credentials
from locked_file import LockedFile
logger = logging.getLogger(__name__)
# A dict from 'filename'->_MultiStore instances
_multistores = {}
_multistores_lock = threading.Lock()
class Error(Exception):
"""Base error for this module."""
pass
class NewerCredentialStoreError(Error):
"""The credential store is a newer version that supported."""
pass
def get_credential_storage(filename, client_id, user_agent, scope,
warn_on_readonly=True):
"""Get a Storage instance for a credential.
Args:
filename: The JSON file storing a set of credentials
client_id: The client_id for the credential
user_agent: The user agent for the credential
scope: string or list of strings, Scope(s) being requested
warn_on_readonly: if True, log a warning if the store is readonly
Returns:
An object derived from client.Storage for getting/setting the
credential.
"""
filename = os.path.realpath(os.path.expanduser(filename))
_multistores_lock.acquire()
try:
multistore = _multistores.setdefault(
filename, _MultiStore(filename, warn_on_readonly))
finally:
_multistores_lock.release()
if type(scope) is list:
scope = ' '.join(scope)
return multistore._get_storage(client_id, user_agent, scope)
class _MultiStore(object):
"""A file backed store for multiple credentials."""
def __init__(self, filename, warn_on_readonly=True):
"""Initialize the class.
This will create the file if necessary.
"""
self._file = LockedFile(filename, 'r+b', 'rb')
self._thread_lock = threading.Lock()
self._read_only = False
self._warn_on_readonly = warn_on_readonly
self._create_file_if_needed()
# Cache of deserialized store. This is only valid after the
# _MultiStore is locked or _refresh_data_cache is called. This is
# of the form of:
#
# (client_id, user_agent, scope) -> OAuth2Credential
#
# If this is None, then the store hasn't been read yet.
self._data = None
class _Storage(BaseStorage):
"""A Storage object that knows how to read/write a single credential."""
def __init__(self, multistore, client_id, user_agent, scope):
self._multistore = multistore
self._client_id = client_id
self._user_agent = user_agent
self._scope = scope
def acquire_lock(self):
"""Acquires any lock necessary to access this Storage.
This lock is not reentrant.
"""
self._multistore._lock()
def release_lock(self):
"""Release the Storage lock.
Trying to release a lock that isn't held will result in a
RuntimeError.
"""
self._multistore._unlock()
def locked_get(self):
"""Retrieve credential.
The Storage lock must be held when this is called.
Returns:
oauth2client.client.Credentials
"""
credential = self._multistore._get_credential(
self._client_id, self._user_agent, self._scope)
if credential:
credential.set_store(self)
return credential
def locked_put(self, credentials):
"""Write a credential.
The Storage lock must be held when this is called.
Args:
credentials: Credentials, the credentials to store.
"""
self._multistore._update_credential(credentials, self._scope)
def locked_delete(self):
"""Delete a credential.
The Storage lock must be held when this is called.
Args:
credentials: Credentials, the credentials to store.
"""
self._multistore._delete_credential(self._client_id, self._user_agent,
self._scope)
def _create_file_if_needed(self):
"""Create an empty file if necessary.
This method will not initialize the file. Instead it implements a
simple version of "touch" to ensure the file has been created.
"""
if not os.path.exists(self._file.filename()):
old_umask = os.umask(0177)
try:
open(self._file.filename(), 'a+b').close()
finally:
os.umask(old_umask)
def _lock(self):
"""Lock the entire multistore."""
self._thread_lock.acquire()
self._file.open_and_lock()
if not self._file.is_locked():
self._read_only = True
if self._warn_on_readonly:
logger.warn('The credentials file (%s) is not writable. Opening in '
'read-only mode. Any refreshed credentials will only be '
'valid for this run.' % self._file.filename())
if os.path.getsize(self._file.filename()) == 0:
logger.debug('Initializing empty multistore file')
# The multistore is empty so write out an empty file.
self._data = {}
self._write()
elif not self._read_only or self._data is None:
# Only refresh the data if we are read/write or we haven't
# cached the data yet. If we are readonly, we assume is isn't
# changing out from under us and that we only have to read it
# once. This prevents us from whacking any new access keys that
# we have cached in memory but were unable to write out.
self._refresh_data_cache()
def _unlock(self):
"""Release the lock on the multistore."""
self._file.unlock_and_close()
self._thread_lock.release()
def _locked_json_read(self):
"""Get the raw content of the multistore file.
The multistore must be locked when this is called.
Returns:
The contents of the multistore decoded as JSON.
"""
assert self._thread_lock.locked()
self._file.file_handle().seek(0)
return simplejson.load(self._file.file_handle())
def _locked_json_write(self, data):
"""Write a JSON serializable data structure to the multistore.
The multistore must be locked when this is called.
Args:
data: The data to be serialized and written.
"""
assert self._thread_lock.locked()
if self._read_only:
return
self._file.file_handle().seek(0)
simplejson.dump(data, self._file.file_handle(), sort_keys=True, indent=2)
self._file.file_handle().truncate()
def _refresh_data_cache(self):
"""Refresh the contents of the multistore.
The multistore must be locked when this is called.
Raises:
NewerCredentialStoreError: Raised when a newer client has written the
store.
"""
self._data = {}
try:
raw_data = self._locked_json_read()
except Exception:
logger.warn('Credential data store could not be loaded. '
'Will ignore and overwrite.')
return
version = 0
try:
version = raw_data['file_version']
except Exception:
logger.warn('Missing version for credential data store. It may be '
'corrupt or an old version. Overwriting.')
if version > 1:
raise NewerCredentialStoreError(
'Credential file has file_version of %d. '
'Only file_version of 1 is supported.' % version)
credentials = []
try:
credentials = raw_data['data']
except (TypeError, KeyError):
pass
for cred_entry in credentials:
try:
(key, credential) = self._decode_credential_from_json(cred_entry)
self._data[key] = credential
except:
# If something goes wrong loading a credential, just ignore it
logger.info('Error decoding credential, skipping', exc_info=True)
def _decode_credential_from_json(self, cred_entry):
"""Load a credential from our JSON serialization.
Args:
cred_entry: A dict entry from the data member of our format
Returns:
(key, cred) where the key is the key tuple and the cred is the
OAuth2Credential object.
"""
raw_key = cred_entry['key']
client_id = raw_key['clientId']
user_agent = raw_key['userAgent']
scope = raw_key['scope']
key = (client_id, user_agent, scope)
credential = None
credential = Credentials.new_from_json(simplejson.dumps(cred_entry['credential']))
return (key, credential)
def _write(self):
"""Write the cached data back out.
The multistore must be locked.
"""
raw_data = {'file_version': 1}
raw_creds = []
raw_data['data'] = raw_creds
for (cred_key, cred) in self._data.items():
raw_key = {
'clientId': cred_key[0],
'userAgent': cred_key[1],
'scope': cred_key[2]
}
raw_cred = simplejson.loads(cred.to_json())
raw_creds.append({'key': raw_key, 'credential': raw_cred})
self._locked_json_write(raw_data)
def _get_credential(self, client_id, user_agent, scope):
"""Get a credential from the multistore.
The multistore must be locked.
Args:
client_id: The client_id for the credential
user_agent: The user agent for the credential
scope: A string for the scope(s) being requested
Returns:
The credential specified or None if not present
"""
key = (client_id, user_agent, scope)
return self._data.get(key, None)
def _update_credential(self, cred, scope):
"""Update a credential and write the multistore.
This must be called when the multistore is locked.
Args:
cred: The OAuth2Credential to update/set
scope: The scope(s) that this credential covers
"""
key = (cred.client_id, cred.user_agent, scope)
self._data[key] = cred
self._write()
def _delete_credential(self, client_id, user_agent, scope):
"""Delete a credential and write the multistore.
This must be called when the multistore is locked.
Args:
client_id: The client_id for the credential
user_agent: The user agent for the credential
scope: The scope(s) that this credential covers
"""
key = (client_id, user_agent, scope)
try:
del self._data[key]
except KeyError:
pass
self._write()
def _get_storage(self, client_id, user_agent, scope):
"""Get a Storage object to get/set a credential.
This Storage is a 'view' into the multistore.
Args:
client_id: The client_id for the credential
user_agent: The user agent for the credential
scope: A string for the scope(s) being requested
Returns:
A Storage object that can be used to get/set this cred
"""
return self._Storage(self, client_id, user_agent, scope)
| ajibawa-2023/Python-Code-Large/train/row_99165 | 155 | 378 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 30], "level": 0, "parent": null, "vector": [8, 0, 0.0437, 0.0741, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Multi-credential file store with lock support.\n\nThis module implements a JSON credential store where multiple\ncredentials can be stored in one file. That file supports locking\nboth in a single process and across processes.\n\nThe credential themselves are keyed off of:\n* client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L32_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.0847, 0.0026, 0, 0.66, 0.0588, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jbeda@google.com (Joe Beda)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Import_L34_C0", "label": "base64 import base64", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0899, 0.0026, 0, 0.66, 0.1176, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Import_L35_C0", "label": "errno import errno", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.0926, 0.0026, 0, 0.66, 0.1765, 546, 0, 1, 0, 0, 546, 0, 0], "semantic": {"name": "errno", "arg_names": [], "import_names": ["errno"], "rhs_call_name": "", "annotation": ""}, "snippet": "import errno"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Import_L36_C0", "label": "logging import logging", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0026, 0, 0.66, 0.2353, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Import_L37_C0", "label": "os import os", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0979, 0.0026, 0, 0.66, 0.2941, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Import_L38_C0", "label": "threading import threading", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1005, 0.0026, 0, 0.66, 0.3529, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ImportFrom_L40_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1058, 0.0026, 0, 0.66, 0.4118, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ImportFrom_L41_C0", "label": "from client import BaseStorage", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1085, 0.0026, 0, 0.66, 0.4706, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ImportFrom_L42_C0", "label": "from client import Credentials", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0026, 0, 0.66, 0.5294, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["Credentials"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ImportFrom_L43_C0", "label": "from locked_file import LockedFile", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1138, 0.0026, 0, 0.66, 0.5882, 176, 0, 1, 0, 0, 176, 0, 0], "semantic": {"name": "locked_file", "arg_names": [], "import_names": ["LockedFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from locked_file import LockedFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L45_C0", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.119, 0.0026, 0, 0.66, 0.6471, 532, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": "logger = logging.getLogger(__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L48_C0", "label": "_multistores =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.127, 0.0026, 0, 0.66, 0.7059, 947, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_multistores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_multistores = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L49_C0", "label": "_multistores_lock = Lock()", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.1296, 0.0026, 0, 0.66, 0.7647, 429, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "_multistores_lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": "_multistores_lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L52_C0", "label": "Error", "type": "class", "loc": [52, 54], "level": 0, "parent": null, "vector": [3, 0, 0.1402, 0.0079, 0, 0.66, 0.8235, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L53_C2", "label": "expression", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L52_C0", "vector": [8, 1, 0.1402, 0.0026, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L57_C0", "label": "NewerCredentialStoreError", "type": "class", "loc": [57, 59], "level": 0, "parent": null, "vector": [3, 0, 0.1534, 0.0079, 0, 0.66, 0.8824, 991, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "NewerCredentialStoreError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NewerCredentialStoreError(Error):\n \"\"\"The credential store is a newer version that supported.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L58_C2", "label": "expression", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L57_C0", "vector": [8, 1, 0.1534, 0.0026, 1, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The credential store is a newer version that supported.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "label": "get_credential_storage", "type": "function", "loc": [62, 86], "level": 0, "parent": null, "vector": [2, 0, 0.1958, 0.0661, 0, 0.66, 0.9412, 534, 0, 5, 1, 0, 0, 0, 9], "semantic": {"name": "get_credential_storage", "arg_names": ["filename", "client_id", "user_agent", "scope", "warn_on_readonly"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_credential_storage(filename, client_id, user_agent, scope,\n warn_on_readonly=True):\n \"\"\"Get a Storage instance for a credential.\n\n Args:\n filename: The JSON file storing a set of credentials\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L64_C2", "label": "expression", "type": "expression", "loc": [64, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "vector": [8, 1, 0.1852, 0.0344, 1, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get a Storage instance for a credential.\n\n Args:\n filename: The JSON file storing a set of credentials\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: string or list of strings, Scope(s) being requested\n warn_on_readonly: if True, log a warning if the store is readonly"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L77_C2", "label": "filename = realpath()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "vector": [14, 1, 0.2037, 0.0026, 1, 0.71, 0.2, 275, 3, 1, 0, 0, 45, 10, 2], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "realpath", "annotation": ""}, "snippet": " filename = os.path.realpath(os.path.expanduser(filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L78_C2", "label": "acquire()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "vector": [8, 1, 0.2063, 0.0026, 1, 0.71, 0.4, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " _multistores_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L79_C2", "label": "try", "type": "try", "loc": [79, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "vector": [7, 1, 0.2143, 0.0132, 1, 0.71, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n multistore = _multistores.setdefault(\n filename, _MultiStore(filename, warn_on_readonly))\n finally:\n _multistores_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L80_C4", "label": "multistore = setdefault()", "type": "assigned_variable", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L79_C2", "vector": [14, 2, 0.213, 0.0053, 2, 0.96, 0.0, 913, 3, 2, 0, 0, 262, 10, 2], "semantic": {"name": "multistore", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " multistore = _multistores.setdefault(\n filename, _MultiStore(filename, warn_on_readonly))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L83_C4", "label": "release()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L79_C2", "vector": [8, 2, 0.2196, 0.0026, 2, 0.96, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " _multistores_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L84_C2", "label": "if", "type": "if", "loc": [84, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "vector": [4, 1, 0.2235, 0.0053, 1, 0.71, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(scope) is list:\n scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L85_C4", "label": "scope = join()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L84_C2", "vector": [14, 2, 0.2249, 0.0026, 2, 0.36, 0.0, 334, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L86_C2", "label": "return", "type": "return", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "vector": [13, 1, 0.2275, 0.0026, 1, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return multistore._get_storage(client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "label": "_MultiStore", "type": "class", "loc": [89, 378], "level": 0, "parent": null, "vector": [3, 0, 0.6177, 0.7672, 0, 0.66, 1.0, 727, 0, 19, 0, 0, 186, 0, 56], "semantic": {"name": "_MultiStore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MultiStore(object):\n \"\"\"A file backed store for multiple credentials.\"\"\"\n\n def __init__(self, filename, warn_on_readonly=True):\n \"\"\"Initialize the class.\n\n This will create the file if necessary.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L90_C2", "label": "expression", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [8, 1, 0.2381, 0.0026, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A file backed store for multiple credentials.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "label": "__init__", "type": "function", "loc": [92, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.2685, 0.0529, 1, 0.27, 0.0714, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "filename", "warn_on_readonly"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, filename, warn_on_readonly=True):\n \"\"\"Initialize the class.\n\n This will create the file if necessary.\n \"\"\"\n self._file = LockedFile(filename, 'r+b', 'rb')\n self._thread_lock = threading.Lock()\n self._read_only = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L93_C4", "label": "expression", "type": "expression", "loc": [93, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [8, 2, 0.25, 0.0106, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Initialize the class.\n\n This will create the file if necessary.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L97_C4", "label": "self._file = LockedFile()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [14, 2, 0.2566, 0.0026, 2, 0.73, 0.1667, 852, 3, 3, 0, 0, 1, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "LockedFile", "annotation": ""}, "snippet": " self._file = LockedFile(filename, 'r+b', 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L98_C4", "label": "self._thread_lock = Lock()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [14, 2, 0.2593, 0.0026, 2, 0.73, 0.3333, 407, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self._thread_lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self._thread_lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L99_C4", "label": "self._read_only =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [14, 2, 0.2619, 0.0026, 2, 0.73, 0.5, 763, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._read_only", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._read_only = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L100_C4", "label": "self._warn_on_readonly =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [14, 2, 0.2646, 0.0026, 2, 0.73, 0.6667, 231, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._warn_on_readonly", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._warn_on_readonly = warn_on_readonly"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L102_C4", "label": "_create_file_if_needed()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [8, 2, 0.2698, 0.0026, 2, 0.73, 0.8333, 654, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_file_if_needed", "arg_names": [], "import_names": [], "rhs_call_name": "_create_file_if_needed", "annotation": ""}, "snippet": " self._create_file_if_needed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L111_C4", "label": "self._data =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "vector": [14, 2, 0.2937, 0.0026, 2, 0.73, 1.0, 753, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "label": "_Storage", "type": "class", "loc": [113, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [3, 1, 0.3743, 0.1534, 1, 0.27, 0.1429, 373, 0, 6, 0, 0, 775, 0, 6], "semantic": {"name": "_Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _Storage(BaseStorage):\n \"\"\"A Storage object that knows how to read/write a single credential.\"\"\"\n\n def __init__(self, multistore, client_id, user_agent, scope):\n self._multistore = multistore\n self._client_id = client_id\n self._user_agent = user_agent\n self._scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L114_C4", "label": "expression", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [8, 2, 0.3016, 0.0026, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A Storage object that knows how to read/write a single credential.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "label": "__init__", "type": "function", "loc": [116, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [2, 2, 0.3122, 0.0132, 2, 0.24, 0.1667, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "multistore", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, multistore, client_id, user_agent, scope):\n self._multistore = multistore\n self._client_id = client_id\n self._user_agent = user_agent\n self._scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L117_C6", "label": "self._multistore =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "vector": [14, 3, 0.3095, 0.0026, 3, 0.64, 0.0, 680, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._multistore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._multistore = multistore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L118_C6", "label": "self._client_id =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "vector": [14, 3, 0.3122, 0.0026, 3, 0.64, 0.3333, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._client_id = client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L119_C6", "label": "self._user_agent =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "vector": [14, 3, 0.3148, 0.0026, 3, 0.64, 0.6667, 996, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L120_C6", "label": "self._scope =", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "vector": [14, 3, 0.3175, 0.0026, 3, 0.64, 1.0, 363, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L122_C4", "label": "acquire_lock", "type": "function", "loc": [122, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [2, 2, 0.3294, 0.0159, 2, 0.24, 0.3333, 5, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def acquire_lock(self):\n \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\"\n self._multistore._lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L123_C6", "label": "expression", "type": "expression", "loc": [123, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L122_C4", "vector": [8, 3, 0.3294, 0.0106, 3, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L127_C6", "label": "_lock()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L122_C4", "vector": [8, 3, 0.336, 0.0026, 3, 0.8, 1.0, 537, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_lock", "arg_names": [], "import_names": [], "rhs_call_name": "_lock", "annotation": ""}, "snippet": " self._multistore._lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L129_C4", "label": "release_lock", "type": "function", "loc": [129, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [2, 2, 0.3492, 0.0185, 2, 0.24, 0.5, 821, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_lock(self):\n \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\"\n self._multistore._unlock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L130_C6", "label": "expression", "type": "expression", "loc": [130, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L129_C4", "vector": [8, 3, 0.3492, 0.0132, 3, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L135_C6", "label": "_unlock()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L129_C4", "vector": [8, 3, 0.3571, 0.0026, 3, 0.42, 1.0, 287, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_unlock", "arg_names": [], "import_names": [], "rhs_call_name": "_unlock", "annotation": ""}, "snippet": " self._multistore._unlock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "label": "locked_get", "type": "function", "loc": [137, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [2, 2, 0.3783, 0.0344, 2, 0.24, 0.6667, 579, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L138_C6", "label": "expression", "type": "expression", "loc": [138, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "vector": [8, 3, 0.373, 0.0185, 3, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L145_C6", "label": "credential = _get_credential()", "type": "assigned_variable", "loc": [145, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "vector": [14, 3, 0.3849, 0.0053, 3, 0.61, 0.3333, 443, 3, 3, 0, 0, 212, 10, 1], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "_get_credential", "annotation": ""}, "snippet": " credential = self._multistore._get_credential(\n self._client_id, self._user_agent, self._scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L147_C6", "label": "if", "type": "if", "loc": [147, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "vector": [4, 3, 0.3902, 0.0053, 3, 0.61, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if credential:\n credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L148_C8", "label": "set_store()", "type": "expression", "loc": [148, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L147_C6", "vector": [8, 4, 0.3915, 0.0026, 4, 0.69, 0.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L149_C6", "label": "return", "type": "return", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "vector": [13, 3, 0.3942, 0.0026, 3, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L151_C4", "label": "locked_put", "type": "function", "loc": [151, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [2, 2, 0.4101, 0.0238, 2, 0.24, 0.8333, 154, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L152_C6", "label": "expression", "type": "expression", "loc": [152, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L151_C4", "vector": [8, 3, 0.4101, 0.0185, 3, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L159_C6", "label": "_update_credential()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L151_C4", "vector": [8, 3, 0.4206, 0.0026, 3, 0.62, 1.0, 641, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_update_credential", "arg_names": [], "import_names": [], "rhs_call_name": "_update_credential", "annotation": ""}, "snippet": " self._multistore._update_credential(credentials, self._scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L161_C4", "label": "locked_delete", "type": "function", "loc": [161, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "vector": [2, 2, 0.4378, 0.0265, 2, 0.24, 1.0, 769, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L162_C6", "label": "expression", "type": "expression", "loc": [162, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L161_C4", "vector": [8, 3, 0.4365, 0.0185, 3, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L169_C6", "label": "_delete_credential()", "type": "expression", "loc": [169, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L161_C4", "vector": [8, 3, 0.4484, 0.0053, 3, 0.03, 1.0, 807, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_delete_credential", "arg_names": [], "import_names": [], "rhs_call_name": "_delete_credential", "annotation": ""}, "snippet": " self._multistore._delete_credential(self._client_id, self._user_agent,\n self._scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L172_C2", "label": "_create_file_if_needed", "type": "function", "loc": [172, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.4683, 0.0291, 1, 0.27, 0.2143, 654, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_create_file_if_needed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_file_if_needed(self):\n \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\"\n if not os.path.exists(self._file.filename()):\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L173_C4", "label": "expression", "type": "expression", "loc": [173, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L172_C2", "vector": [8, 2, 0.463, 0.0132, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L178_C4", "label": "if", "type": "if", "loc": [178, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L172_C2", "vector": [4, 2, 0.4762, 0.0132, 2, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists(self._file.filename()):\n try:\n open(self._file.filename(), 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L179_C6", "label": "try", "type": "try", "loc": [179, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L178_C4", "vector": [7, 3, 0.4775, 0.0106, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n open(self._file.filename(), 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L180_C8", "label": "close()", "type": "expression", "loc": [180, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L179_C6", "vector": [8, 4, 0.4762, 0.0026, 4, 0.97, 0.0, 77, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " open(self._file.filename(), 'a+b').close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L182_C8", "label": "umask()", "type": "expression", "loc": [182, 182], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L179_C6", "vector": [8, 4, 0.4815, 0.0026, 4, 0.97, 1.0, 505, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "umask", "arg_names": [], "import_names": [], "rhs_call_name": "umask", "annotation": ""}, "snippet": " os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "label": "_lock", "type": "function", "loc": [184, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.5146, 0.0582, 1, 0.27, 0.2857, 537, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _lock(self):\n \"\"\"Lock the entire multistore.\"\"\"\n self._thread_lock.acquire()\n self._file.open_and_lock()\n if not self._file.is_locked():\n self._read_only = True\n if self._warn_on_readonly:\n logger.warn('The credentials file (%s) is not writable. Opening in '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L185_C4", "label": "expression", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "vector": [8, 2, 0.4894, 0.0026, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Lock the entire multistore.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L186_C4", "label": "acquire()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "vector": [8, 2, 0.4921, 0.0026, 2, 0.96, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._thread_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L187_C4", "label": "open_and_lock()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "vector": [8, 2, 0.4947, 0.0026, 2, 0.96, 0.5, 67, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "open_and_lock", "arg_names": [], "import_names": [], "rhs_call_name": "open_and_lock", "annotation": ""}, "snippet": " self._file.open_and_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L188_C4", "label": "if", "type": "if", "loc": [188, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "vector": [4, 2, 0.504, 0.0159, 2, 0.96, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._file.is_locked():\n self._read_only = True\n if self._warn_on_readonly:\n logger.warn('The credentials file (%s) is not writable. Opening in '\n 'read-only mode. Any refreshed credentials will only be '\n 'valid for this run.' % self._file.filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L189_C6", "label": "self._read_only =", "type": "assigned_variable", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L188_C4", "vector": [14, 3, 0.5, 0.0026, 3, 0.68, 0.0, 763, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._read_only", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._read_only = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L190_C6", "label": "if", "type": "if", "loc": [190, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L188_C4", "vector": [4, 3, 0.5066, 0.0106, 3, 0.68, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._warn_on_readonly:\n logger.warn('The credentials file (%s) is not writable. Opening in '\n 'read-only mode. Any refreshed credentials will only be '\n 'valid for this run.' % self._file.filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L191_C8", "label": "warn()", "type": "expression", "loc": [191, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L190_C6", "vector": [8, 4, 0.5079, 0.0079, 4, 0.18, 0.0, 960, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logger.warn('The credentials file (%s) is not writable. Opening in '\n 'read-only mode. Any refreshed credentials will only be '\n 'valid for this run.' % self._file.filename())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "label": "if", "type": "if", "loc": [194, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "vector": [4, 2, 0.5278, 0.0317, 2, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.getsize(self._file.filename()) == 0:\n logger.debug('Initializing empty multistore file')\n # The multistore is empty so write out an empty file.\n self._data = {}\n self._write()\n elif not self._read_only or self._data is None:\n # Only refresh the data if we are read/write or we haven't\n # cached the data yet. If we are readonly, we assume is isn't"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L195_C6", "label": "debug()", "type": "expression", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "vector": [8, 3, 0.5159, 0.0026, 3, 0.67, 0.0, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logger.debug('Initializing empty multistore file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L197_C6", "label": "self._data =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "vector": [14, 3, 0.5212, 0.0026, 3, 0.67, 0.3333, 753, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L198_C6", "label": "_write()", "type": "expression", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "vector": [8, 3, 0.5238, 0.0026, 3, 0.67, 0.6667, 961, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L199_C4", "label": "if", "type": "if", "loc": [199, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "vector": [4, 3, 0.5344, 0.0185, 3, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not self._read_only or self._data is None:\n # Only refresh the data if we are read/write or we haven't\n # cached the data yet. If we are readonly, we assume is isn't\n # changing out from under us and that we only have to read it\n # once. This prevents us from whacking any new access keys that\n # we have cached in memory but were unable to write out.\n self._refresh_data_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L205_C6", "label": "_refresh_data_cache()", "type": "expression", "loc": [205, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L199_C4", "vector": [8, 4, 0.5423, 0.0026, 4, 0.41, 0.0, 874, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh_data_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh_data_cache", "annotation": ""}, "snippet": " self._refresh_data_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "label": "_unlock", "type": "function", "loc": [207, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.5516, 0.0106, 1, 0.27, 0.3571, 287, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_unlock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _unlock(self):\n \"\"\"Release the lock on the multistore.\"\"\"\n self._file.unlock_and_close()\n self._thread_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L208_C4", "label": "expression", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "vector": [8, 2, 0.5503, 0.0026, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the lock on the multistore.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L209_C4", "label": "unlock_and_close()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "vector": [8, 2, 0.5529, 0.0026, 2, 0.36, 0.5, 518, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unlock_and_close", "arg_names": [], "import_names": [], "rhs_call_name": "unlock_and_close", "annotation": ""}, "snippet": " self._file.unlock_and_close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L210_C4", "label": "release()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "vector": [8, 2, 0.5556, 0.0026, 2, 0.36, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._thread_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "label": "_locked_json_read", "type": "function", "loc": [212, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.5741, 0.0291, 1, 0.27, 0.4286, 928, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_locked_json_read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _locked_json_read(self):\n \"\"\"Get the raw content of the multistore file.\n\n The multistore must be locked when this is called.\n\n Returns:\n The contents of the multistore decoded as JSON.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L213_C4", "label": "expression", "type": "expression", "loc": [213, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "vector": [8, 2, 0.5714, 0.0185, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get the raw content of the multistore file.\n\n The multistore must be locked when this is called.\n\n Returns:\n The contents of the multistore decoded as JSON.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L221_C4", "label": "seek()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "vector": [8, 2, 0.5847, 0.0026, 2, 0.87, 0.5, 66, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "seek", "arg_names": [], "import_names": [], "rhs_call_name": "seek", "annotation": ""}, "snippet": " self._file.file_handle().seek(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L222_C4", "label": "return", "type": "return", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "vector": [13, 2, 0.5873, 0.0026, 2, 0.87, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.load(self._file.file_handle())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "label": "_locked_json_write", "type": "function", "loc": [224, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.6098, 0.037, 1, 0.27, 0.5, 649, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "_locked_json_write", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _locked_json_write(self, data):\n \"\"\"Write a JSON serializable data structure to the multistore.\n\n The multistore must be locked when this is called.\n\n Args:\n data: The data to be serialized and written.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L225_C4", "label": "expression", "type": "expression", "loc": [225, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "vector": [8, 2, 0.6032, 0.0185, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a JSON serializable data structure to the multistore.\n\n The multistore must be locked when this is called.\n\n Args:\n data: The data to be serialized and written.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L233_C4", "label": "if", "type": "if", "loc": [233, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "vector": [4, 2, 0.6177, 0.0053, 2, 0.88, 0.25, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._read_only:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L234_C6", "label": "return", "type": "return", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L233_C4", "vector": [13, 3, 0.619, 0.0026, 3, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L235_C4", "label": "seek()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "vector": [8, 2, 0.6217, 0.0026, 2, 0.88, 0.5, 66, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "seek", "arg_names": [], "import_names": [], "rhs_call_name": "seek", "annotation": ""}, "snippet": " self._file.file_handle().seek(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L236_C4", "label": "dump()", "type": "expression", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "vector": [8, 2, 0.6243, 0.0026, 2, 0.88, 0.75, 952, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " simplejson.dump(data, self._file.file_handle(), sort_keys=True, indent=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L237_C4", "label": "truncate()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "vector": [8, 2, 0.627, 0.0026, 2, 0.88, 1.0, 39, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "truncate", "arg_names": [], "import_names": [], "rhs_call_name": "truncate", "annotation": ""}, "snippet": " self._file.file_handle().truncate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "label": "_refresh_data_cache", "type": "function", "loc": [239, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.6852, 0.1085, 1, 0.27, 0.5714, 874, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_refresh_data_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _refresh_data_cache(self):\n \"\"\"Refresh the contents of the multistore.\n\n The multistore must be locked when this is called.\n\n Raises:\n NewerCredentialStoreError: Raised when a newer client has written the\n store."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L240_C4", "label": "expression", "type": "expression", "loc": [240, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [8, 2, 0.6442, 0.0212, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Refresh the contents of the multistore.\n\n The multistore must be locked when this is called.\n\n Raises:\n NewerCredentialStoreError: Raised when a newer client has written the\n store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L248_C4", "label": "self._data =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [14, 2, 0.6561, 0.0026, 2, 0.85, 0.125, 753, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "label": "try", "type": "try", "loc": [249, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [7, 2, 0.6653, 0.0159, 2, 0.85, 0.25, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n raw_data = self._locked_json_read()\n except Exception:\n logger.warn('Credential data store could not be loaded. '\n 'Will ignore and overwrite.')\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L250_C6", "label": "raw_data = _locked_json_read()", "type": "assigned_variable", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "vector": [14, 3, 0.6614, 0.0026, 3, 0.51, 0.0, 495, 3, 0, 0, 0, 928, 10, 1], "semantic": {"name": "raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "_locked_json_read", "annotation": ""}, "snippet": " raw_data = self._locked_json_read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L252_C6", "label": "warn()", "type": "expression", "loc": [252, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "vector": [8, 3, 0.668, 0.0053, 3, 0.51, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logger.warn('Credential data store could not be loaded. '\n 'Will ignore and overwrite.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L254_C6", "label": "return", "type": "return", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "vector": [13, 3, 0.672, 0.0026, 3, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L256_C4", "label": "version =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [14, 2, 0.6772, 0.0026, 2, 0.85, 0.375, 623, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L257_C4", "label": "try", "type": "try", "loc": [257, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [7, 2, 0.6852, 0.0132, 2, 0.85, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n version = raw_data['file_version']\n except Exception:\n logger.warn('Missing version for credential data store. It may be '\n 'corrupt or an old version. Overwriting.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L258_C6", "label": "version =", "type": "assigned_variable", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L257_C4", "vector": [14, 3, 0.6825, 0.0026, 3, 0.49, 0.0, 623, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = raw_data['file_version']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L260_C6", "label": "warn()", "type": "expression", "loc": [260, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L257_C4", "vector": [8, 3, 0.6892, 0.0053, 3, 0.49, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logger.warn('Missing version for credential data store. It may be '\n 'corrupt or an old version. Overwriting.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L262_C4", "label": "if", "type": "if", "loc": [262, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [4, 2, 0.6971, 0.0106, 2, 0.85, 0.625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if version > 1:\n raise NewerCredentialStoreError(\n 'Credential file has file_version of %d. '\n 'Only file_version of 1 is supported.' % version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L267_C4", "label": "credentials =", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [14, 2, 0.7063, 0.0026, 2, 0.85, 0.75, 198, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L268_C4", "label": "try", "type": "try", "loc": [268, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [7, 2, 0.713, 0.0106, 2, 0.85, 0.875, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n credentials = raw_data['data']\n except (TypeError, KeyError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L269_C6", "label": "credentials =", "type": "assigned_variable", "loc": [269, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L268_C4", "vector": [14, 3, 0.7116, 0.0026, 3, 0.12, 0.0, 198, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = raw_data['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L273_C4", "label": "for cred_entry", "type": "for", "loc": [273, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "vector": [6, 2, 0.7302, 0.0185, 2, 0.85, 1.0, 31, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cred_entry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cred_entry in credentials:\n try:\n (key, credential) = self._decode_credential_from_json(cred_entry)\n self._data[key] = credential\n except:\n # If something goes wrong loading a credential, just ignore it\n logger.info('Error decoding credential, skipping', exc_info=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "label": "try", "type": "try", "loc": [274, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L273_C4", "vector": [7, 3, 0.7315, 0.0159, 3, 0.77, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n (key, credential) = self._decode_credential_from_json(cred_entry)\n self._data[key] = credential\n except:\n # If something goes wrong loading a credential, just ignore it\n logger.info('Error decoding credential, skipping', exc_info=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L275_C8", "label": "key, credential = _decode_credential_from_json()", "type": "assigned_variable", "loc": [275, 275], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "vector": [14, 4, 0.7275, 0.0026, 4, 0.98, 0.0, 546, 3, 1, 0, 0, 175, 10, 1], "semantic": {"name": "key, credential", "arg_names": [], "import_names": [], "rhs_call_name": "_decode_credential_from_json", "annotation": ""}, "snippet": " (key, credential) = self._decode_credential_from_json(cred_entry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L276_C8", "label": "assign", "type": "assigned_variable", "loc": [276, 276], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "vector": [14, 4, 0.7302, 0.0026, 4, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data[key] = credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L279_C8", "label": "info()", "type": "expression", "loc": [279, 279], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "vector": [8, 4, 0.7381, 0.0026, 4, 0.98, 0.0, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Error decoding credential, skipping', exc_info=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "label": "_decode_credential_from_json", "type": "function", "loc": [281, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.7659, 0.0476, 1, 0.27, 0.6429, 175, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_decode_credential_from_json", "arg_names": ["self", "cred_entry"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _decode_credential_from_json(self, cred_entry):\n \"\"\"Load a credential from our JSON serialization.\n\n Args:\n cred_entry: A dict entry from the data member of our format\n\n Returns:\n (key, cred) where the key is the key tuple and the cred is the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L282_C4", "label": "expression", "type": "expression", "loc": [282, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [8, 2, 0.7566, 0.0238, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Load a credential from our JSON serialization.\n\n Args:\n cred_entry: A dict entry from the data member of our format\n\n Returns:\n (key, cred) where the key is the key tuple and the cred is the\n OAuth2Credential object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L291_C4", "label": "raw_key =", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7698, 0.0026, 2, 0.38, 0.125, 937, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "raw_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_key = cred_entry['key']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L292_C4", "label": "client_id =", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7725, 0.0026, 2, 0.38, 0.25, 542, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_id = raw_key['clientId']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L293_C4", "label": "user_agent =", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7751, 0.0026, 2, 0.38, 0.375, 731, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " user_agent = raw_key['userAgent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L294_C4", "label": "scope =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7778, 0.0026, 2, 0.38, 0.5, 334, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " scope = raw_key['scope']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L295_C4", "label": "key =", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7804, 0.0026, 2, 0.38, 0.625, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L296_C4", "label": "credential =", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7831, 0.0026, 2, 0.38, 0.75, 443, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credential = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L297_C4", "label": "credential = new_from_json()", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [14, 2, 0.7857, 0.0026, 2, 0.38, 0.875, 443, 3, 1, 0, 0, 495, 10, 2], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "new_from_json", "annotation": ""}, "snippet": " credential = Credentials.new_from_json(simplejson.dumps(cred_entry['credential']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L298_C4", "label": "return", "type": "return", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "vector": [13, 2, 0.7884, 0.0026, 2, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (key, credential)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "label": "_write", "type": "function", "loc": [300, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.8148, 0.045, 1, 0.27, 0.7143, 961, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_write", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write(self):\n \"\"\"Write the cached data back out.\n\n The multistore must be locked.\n \"\"\"\n raw_data = {'file_version': 1}\n raw_creds = []\n raw_data['data'] = raw_creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L301_C4", "label": "expression", "type": "expression", "loc": [301, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "vector": [8, 2, 0.8003, 0.0106, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write the cached data back out.\n\n The multistore must be locked.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L305_C4", "label": "raw_data =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "vector": [14, 2, 0.8069, 0.0026, 2, 0.55, 0.2, 495, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "raw_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_data = {'file_version': 1}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L306_C4", "label": "raw_creds =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "vector": [14, 2, 0.8095, 0.0026, 2, 0.55, 0.4, 685, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "raw_creds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_creds = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L307_C4", "label": "assign", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "vector": [14, 2, 0.8122, 0.0026, 2, 0.55, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_data['data'] = raw_creds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "label": "for cred_key, cred", "type": "for", "loc": [308, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "vector": [6, 2, 0.8241, 0.0212, 2, 0.55, 0.8, 465, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "cred_key, cred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (cred_key, cred) in self._data.items():\n raw_key = {\n 'clientId': cred_key[0],\n 'userAgent': cred_key[1],\n 'scope': cred_key[2]\n }\n raw_cred = simplejson.loads(cred.to_json())\n raw_creds.append({'key': raw_key, 'credential': raw_cred})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L309_C6", "label": "raw_key =", "type": "assigned_variable", "loc": [309, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "vector": [14, 3, 0.8228, 0.0132, 3, 0.08, 0.0, 937, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "raw_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " raw_key = {\n 'clientId': cred_key[0],\n 'userAgent': cred_key[1],\n 'scope': cred_key[2]\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L314_C6", "label": "raw_cred = loads()", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "vector": [14, 3, 0.8307, 0.0026, 3, 0.08, 0.5, 149, 3, 1, 0, 0, 88, 10, 2], "semantic": {"name": "raw_cred", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " raw_cred = simplejson.loads(cred.to_json())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L315_C6", "label": "append()", "type": "expression", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "vector": [8, 3, 0.8333, 0.0026, 3, 0.08, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " raw_creds.append({'key': raw_key, 'credential': raw_cred})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L316_C4", "label": "_locked_json_write()", "type": "expression", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "vector": [8, 2, 0.836, 0.0026, 2, 0.55, 1.0, 649, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_locked_json_write", "arg_names": [], "import_names": [], "rhs_call_name": "_locked_json_write", "annotation": ""}, "snippet": " self._locked_json_write(raw_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "label": "_get_credential", "type": "function", "loc": [318, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.8611, 0.0423, 1, 0.27, 0.7857, 212, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_get_credential", "arg_names": ["self", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_credential(self, client_id, user_agent, scope):\n \"\"\"Get a credential from the multistore.\n\n The multistore must be locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L319_C4", "label": "expression", "type": "expression", "loc": [319, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "vector": [8, 2, 0.8585, 0.0317, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get a credential from the multistore.\n\n The multistore must be locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: A string for the scope(s) being requested"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L331_C4", "label": "key =", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "vector": [14, 2, 0.8757, 0.0026, 2, 0.82, 0.5, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L333_C4", "label": "return", "type": "return", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "vector": [13, 2, 0.881, 0.0026, 2, 0.82, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._data.get(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "label": "_update_credential", "type": "function", "loc": [335, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.9008, 0.0317, 1, 0.27, 0.8571, 641, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_update_credential", "arg_names": ["self", "cred", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _update_credential(self, cred, scope):\n \"\"\"Update a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n cred: The OAuth2Credential to update/set\n scope: The scope(s) that this credential covers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L336_C4", "label": "expression", "type": "expression", "loc": [336, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "vector": [8, 2, 0.8981, 0.0212, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Update a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n cred: The OAuth2Credential to update/set\n scope: The scope(s) that this credential covers\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L344_C4", "label": "key =", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "vector": [14, 2, 0.9101, 0.0026, 2, 0.24, 0.3333, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (cred.client_id, cred.user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L345_C4", "label": "assign", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "vector": [14, 2, 0.9127, 0.0026, 2, 0.24, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data[key] = cred"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L346_C4", "label": "_write()", "type": "expression", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "vector": [8, 2, 0.9153, 0.0026, 2, 0.24, 1.0, 961, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "label": "_delete_credential", "type": "function", "loc": [348, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.9405, 0.0423, 1, 0.27, 0.9286, 807, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_delete_credential", "arg_names": ["self", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _delete_credential(self, client_id, user_agent, scope):\n \"\"\"Delete a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L349_C4", "label": "expression", "type": "expression", "loc": [349, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "vector": [8, 2, 0.9339, 0.0238, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete a credential and write the multistore.\n\n This must be called when the multistore is locked.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: The scope(s) that this credential covers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L358_C4", "label": "key =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "vector": [14, 2, 0.9471, 0.0026, 2, 0.79, 0.3333, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (client_id, user_agent, scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L359_C4", "label": "try", "type": "try", "loc": [359, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "vector": [7, 2, 0.9537, 0.0106, 2, 0.79, 0.6667, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n del self._data[key]\n except KeyError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L363_C4", "label": "_write()", "type": "expression", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "vector": [8, 2, 0.9603, 0.0026, 2, 0.79, 1.0, 961, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L365_C2", "label": "_get_storage", "type": "function", "loc": [365, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "vector": [2, 1, 0.9828, 0.037, 1, 0.27, 1.0, 379, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "_get_storage", "arg_names": ["self", "client_id", "user_agent", "scope"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_storage(self, client_id, user_agent, scope):\n \"\"\"Get a Storage object to get/set a credential.\n\n This Storage is a 'view' into the multistore.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L366_C4", "label": "expression", "type": "expression", "loc": [366, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L365_C2", "vector": [8, 2, 0.9828, 0.0317, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get a Storage object to get/set a credential.\n\n This Storage is a 'view' into the multistore.\n\n Args:\n client_id: The client_id for the credential\n user_agent: The user agent for the credential\n scope: A string for the scope(s) being requested"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L378_C4", "label": "return", "type": "return", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L365_C2", "vector": [13, 2, 1.0, 0.0026, 2, 0.2, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._Storage(self, client_id, user_agent, scope)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L84_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L84_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L92_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L117_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L118_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L119_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L120_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L123_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L127_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L130_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L135_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L138_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L145_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L147_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L147_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L149_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L152_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L159_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L113_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L162_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L169_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L172_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L179_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L179_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L179_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L189_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L190_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L190_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L195_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L197_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L198_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L212_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L234_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L250_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L252_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L254_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L258_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L260_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:If_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L269_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L273_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L274_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L281_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L307_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L309_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L314_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:For_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L315_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L300_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L318_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L335_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Assign_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Try_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L348_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L365_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L365_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Expr_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99165:FunctionDef_L365_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99165:Return_L378_C4"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""An OAuth 2.0 client.
Tools for interacting with OAuth 2.0 protected resources.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import base64
import clientsecrets
import copy
import datetime
import httplib2
import logging
import os
import sys
import time
import urllib
import urlparse
from anyjson import simplejson
HAS_OPENSSL = False
try:
from oauth2client.crypt import Signer
from oauth2client.crypt import make_signed_jwt
from oauth2client.crypt import verify_signed_jwt_with_certs
HAS_OPENSSL = True
except ImportError:
pass
try:
from urlparse import parse_qsl
except ImportError:
from cgi import parse_qsl
logger = logging.getLogger(__name__)
# Expiry is stored in RFC3339 UTC format
EXPIRY_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
# Which certs to use to validate id_tokens received.
ID_TOKEN_VERIFICATON_CERTS = 'https://www.googleapis.com/oauth2/v1/certs'
# Constant to use for the out of band OAuth 2.0 flow.
OOB_CALLBACK_URN = 'urn:ietf:wg:oauth:2.0:oob'
class Error(Exception):
"""Base error for this module."""
pass
class FlowExchangeError(Error):
"""Error trying to exchange an authorization grant for an access token."""
pass
class AccessTokenRefreshError(Error):
"""Error trying to refresh an expired access token."""
pass
class UnknownClientSecretsFlowError(Error):
"""The client secrets file called for an unknown type of OAuth 2.0 flow. """
pass
class AccessTokenCredentialsError(Error):
"""Having only the access_token means no refresh is possible."""
pass
class VerifyJwtTokenError(Error):
"""Could on retrieve certificates for validation."""
pass
def _abstract():
raise NotImplementedError('You need to override this function')
class MemoryCache(object):
"""httplib2 Cache implementation which only caches locally."""
def __init__(self):
self.cache = {}
def get(self, key):
return self.cache.get(key)
def set(self, key, value):
self.cache[key] = value
def delete(self, key):
self.cache.pop(key, None)
class Credentials(object):
"""Base class for all Credentials objects.
Subclasses must define an authorize() method that applies the credentials to
an HTTP transport.
Subclasses must also specify a classmethod named 'from_json' that takes a JSON
string as input and returns an instaniated Credentials object.
"""
NON_SERIALIZED_MEMBERS = ['store']
def authorize(self, http):
"""Take an httplib2.Http instance (or equivalent) and
authorizes it for the set of credentials, usually by
replacing http.request() with a method that adds in
the appropriate headers and then delegates to the original
Http.request() method.
"""
_abstract()
def refresh(self, http):
"""Forces a refresh of the access_token.
Args:
http: httplib2.Http, an http object to be used to make the refresh
request.
"""
_abstract()
def apply(self, headers):
"""Add the authorization to the headers.
Args:
headers: dict, the headers to add the Authorization header to.
"""
_abstract()
def _to_json(self, strip):
"""Utility function for creating a JSON representation of an instance of Credentials.
Args:
strip: array, An array of names of members to not include in the JSON.
Returns:
string, a JSON representation of this instance, suitable to pass to
from_json().
"""
t = type(self)
d = copy.copy(self.__dict__)
for member in strip:
if member in d:
del d[member]
if 'token_expiry' in d and isinstance(d['token_expiry'], datetime.datetime):
d['token_expiry'] = d['token_expiry'].strftime(EXPIRY_FORMAT)
# Add in information we will need later to reconsistitue this instance.
d['_class'] = t.__name__
d['_module'] = t.__module__
return simplejson.dumps(d)
def to_json(self):
"""Creating a JSON representation of an instance of Credentials.
Returns:
string, a JSON representation of this instance, suitable to pass to
from_json().
"""
return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)
@classmethod
def new_from_json(cls, s):
"""Utility class method to instantiate a Credentials subclass from a JSON
representation produced by to_json().
Args:
s: string, JSON from to_json().
Returns:
An instance of the subclass of Credentials that was serialized with
to_json().
"""
data = simplejson.loads(s)
# Find and call the right classmethod from_json() to restore the object.
module = data['_module']
try:
m = __import__(module)
except ImportError:
# In case there's an object from the old package structure, update it
module = module.replace('.apiclient', '')
m = __import__(module)
m = __import__(module, fromlist=module.split('.')[:-1])
kls = getattr(m, data['_class'])
from_json = getattr(kls, 'from_json')
return from_json(s)
@classmethod
def from_json(cls, s):
"""Instantiate a Credentials object from a JSON description of it.
The JSON should have been produced by calling .to_json() on the object.
Args:
data: dict, A deserialized JSON object.
Returns:
An instance of a Credentials subclass.
"""
return Credentials()
class Flow(object):
"""Base class for all Flow objects."""
pass
class Storage(object):
"""Base class for all Storage objects.
Store and retrieve a single credential. This class supports locking
such that multiple processes and threads can operate on a single
store.
"""
def acquire_lock(self):
"""Acquires any lock necessary to access this Storage.
This lock is not reentrant.
"""
pass
def release_lock(self):
"""Release the Storage lock.
Trying to release a lock that isn't held will result in a
RuntimeError.
"""
pass
def locked_get(self):
"""Retrieve credential.
The Storage lock must be held when this is called.
Returns:
oauth2client.client.Credentials
"""
_abstract()
def locked_put(self, credentials):
"""Write a credential.
The Storage lock must be held when this is called.
Args:
credentials: Credentials, the credentials to store.
"""
_abstract()
def locked_delete(self):
"""Delete a credential.
The Storage lock must be held when this is called.
"""
_abstract()
def get(self):
"""Retrieve credential.
The Storage lock must *not* be held when this is called.
Returns:
oauth2client.client.Credentials
"""
self.acquire_lock()
try:
return self.locked_get()
finally:
self.release_lock()
def put(self, credentials):
"""Write a credential.
The Storage lock must be held when this is called.
Args:
credentials: Credentials, the credentials to store.
"""
self.acquire_lock()
try:
self.locked_put(credentials)
finally:
self.release_lock()
def delete(self):
"""Delete credential.
Frees any resources associated with storing the credential.
The Storage lock must *not* be held when this is called.
Returns:
None
"""
self.acquire_lock()
try:
return self.locked_delete()
finally:
self.release_lock()
class OAuth2Credentials(Credentials):
"""Credentials object for OAuth 2.0.
Credentials can be applied to an httplib2.Http object using the authorize()
method, which then adds the OAuth 2.0 access token to each request.
OAuth2Credentials objects may be safely pickled and unpickled.
"""
def __init__(self, access_token, client_id, client_secret, refresh_token,
token_expiry, token_uri, user_agent, id_token=None):
"""Create an instance of OAuth2Credentials.
This constructor is not usually called by the user, instead
OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow.
Args:
access_token: string, access token.
client_id: string, client identifier.
client_secret: string, client secret.
refresh_token: string, refresh token.
token_expiry: datetime, when the access_token expires.
token_uri: string, URI of token endpoint.
user_agent: string, The HTTP User-Agent to provide for this application.
id_token: object, The identity of the resource owner.
Notes:
store: callable, A callable that when passed a Credential
will store the credential back to where it came from.
This is needed to store the latest access_token if it
has expired and been refreshed.
"""
self.access_token = access_token
self.client_id = client_id
self.client_secret = client_secret
self.refresh_token = refresh_token
self.store = None
self.token_expiry = token_expiry
self.token_uri = token_uri
self.user_agent = user_agent
self.id_token = id_token
# True if the credentials have been revoked or expired and can't be
# refreshed.
self.invalid = False
def authorize(self, http):
"""Authorize an httplib2.Http instance with these credentials.
The modified http.request method will add authentication headers to each
request and will refresh access_tokens when a 401 is received on a
request. In addition the http.request method has a credentials property,
http.request.credentials, which is the Credentials object that authorized
it.
Args:
http: An instance of httplib2.Http
or something that acts like it.
Returns:
A modified instance of http that was passed in.
Example:
h = httplib2.Http()
h = credentials.authorize(h)
You can't create a new OAuth subclass of httplib2.Authenication
because it never gets passed the absolute URI, which is needed for
signing. So instead we have to overload 'request' with a closure
that adds in the Authorization header and then calls the original
version of 'request()'.
"""
request_orig = http.request
# The closure that will replace 'httplib2.Http.request'.
def new_request(uri, method='GET', body=None, headers=None,
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
connection_type=None):
if not self.access_token:
logger.info('Attempting refresh to obtain initial access_token')
self._refresh(request_orig)
# Modify the request headers to add the appropriate
# Authorization header.
if headers is None:
headers = {}
self.apply(headers)
if self.user_agent is not None:
if 'user-agent' in headers:
headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']
else:
headers['user-agent'] = self.user_agent
resp, content = request_orig(uri, method, body, headers,
redirections, connection_type)
if resp.status == 401:
logger.info('Refreshing due to a 401')
self._refresh(request_orig)
self.apply(headers)
return request_orig(uri, method, body, headers,
redirections, connection_type)
else:
return (resp, content)
# Replace the request method with our own closure.
http.request = new_request
# Set credentials as a property of the request method.
setattr(http.request, 'credentials', self)
return http
def refresh(self, http):
"""Forces a refresh of the access_token.
Args:
http: httplib2.Http, an http object to be used to make the refresh
request.
"""
self._refresh(http.request)
def apply(self, headers):
"""Add the authorization to the headers.
Args:
headers: dict, the headers to add the Authorization header to.
"""
headers['Authorization'] = 'Bearer ' + self.access_token
def to_json(self):
return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)
@classmethod
def from_json(cls, s):
"""Instantiate a Credentials object from a JSON description of it. The JSON
should have been produced by calling .to_json() on the object.
Args:
data: dict, A deserialized JSON object.
Returns:
An instance of a Credentials subclass.
"""
data = simplejson.loads(s)
if 'token_expiry' in data and not isinstance(data['token_expiry'],
datetime.datetime):
try:
data['token_expiry'] = datetime.datetime.strptime(
data['token_expiry'], EXPIRY_FORMAT)
except:
data['token_expiry'] = None
retval = OAuth2Credentials(
data['access_token'],
data['client_id'],
data['client_secret'],
data['refresh_token'],
data['token_expiry'],
data['token_uri'],
data['user_agent'],
data.get('id_token', None))
retval.invalid = data['invalid']
return retval
@property
def access_token_expired(self):
"""True if the credential is expired or invalid.
If the token_expiry isn't set, we assume the token doesn't expire.
"""
if self.invalid:
return True
if not self.token_expiry:
return False
now = datetime.datetime.utcnow()
if now >= self.token_expiry:
logger.info('access_token is expired. Now: %s, token_expiry: %s',
now, self.token_expiry)
return True
return False
def set_store(self, store):
"""Set the Storage for the credential.
Args:
store: Storage, an implementation of Stroage object.
This is needed to store the latest access_token if it
has expired and been refreshed. This implementation uses
locking to check for updates before updating the
access_token.
"""
self.store = store
def _updateFromCredential(self, other):
"""Update this Credential from another instance."""
self.__dict__.update(other.__getstate__())
def __getstate__(self):
"""Trim the state down to something that can be pickled."""
d = copy.copy(self.__dict__)
del d['store']
return d
def __setstate__(self, state):
"""Reconstitute the state of the object from being pickled."""
self.__dict__.update(state)
self.store = None
def _generate_refresh_request_body(self):
"""Generate the body that will be used in the refresh request."""
body = urllib.urlencode({
'grant_type': 'refresh_token',
'client_id': self.client_id,
'client_secret': self.client_secret,
'refresh_token': self.refresh_token,
})
return body
def _generate_refresh_request_headers(self):
"""Generate the headers that will be used in the refresh request."""
headers = {
'content-type': 'application/x-www-form-urlencoded',
}
if self.user_agent is not None:
headers['user-agent'] = self.user_agent
return headers
def _refresh(self, http_request):
"""Refreshes the access_token.
This method first checks by reading the Storage object if available.
If a refresh is still needed, it holds the Storage lock until the
refresh is completed.
Args:
http_request: callable, a callable that matches the method signature of
httplib2.Http.request, used to make the refresh request.
Raises:
AccessTokenRefreshError: When the refresh fails.
"""
if not self.store:
self._do_refresh_request(http_request)
else:
self.store.acquire_lock()
try:
new_cred = self.store.locked_get()
if (new_cred and not new_cred.invalid and
new_cred.access_token != self.access_token):
logger.info('Updated access_token read from Storage')
self._updateFromCredential(new_cred)
else:
self._do_refresh_request(http_request)
finally:
self.store.release_lock()
def _do_refresh_request(self, http_request):
"""Refresh the access_token using the refresh_token.
Args:
http_request: callable, a callable that matches the method signature of
httplib2.Http.request, used to make the refresh request.
Raises:
AccessTokenRefreshError: When the refresh fails.
"""
body = self._generate_refresh_request_body()
headers = self._generate_refresh_request_headers()
logger.info('Refreshing access_token')
resp, content = http_request(
self.token_uri, method='POST', body=body, headers=headers)
if resp.status == 200:
# TODO(jcgregorio) Raise an error if loads fails?
d = simplejson.loads(content)
self.access_token = d['access_token']
self.refresh_token = d.get('refresh_token', self.refresh_token)
if 'expires_in' in d:
self.token_expiry = datetime.timedelta(
seconds=int(d['expires_in'])) + datetime.datetime.utcnow()
else:
self.token_expiry = None
if self.store:
self.store.locked_put(self)
else:
# An {'error':...} response body means the token is expired or revoked,
# so we flag the credentials as such.
logger.info('Failed to retrieve access token: %s' % content)
error_msg = 'Invalid response %s.' % resp['status']
try:
d = simplejson.loads(content)
if 'error' in d:
error_msg = d['error']
self.invalid = True
if self.store:
self.store.locked_put(self)
except:
pass
raise AccessTokenRefreshError(error_msg)
class AccessTokenCredentials(OAuth2Credentials):
"""Credentials object for OAuth 2.0.
Credentials can be applied to an httplib2.Http object using the
authorize() method, which then signs each request from that object
with the OAuth 2.0 access token. This set of credentials is for the
use case where you have acquired an OAuth 2.0 access_token from
another place such as a JavaScript client or another web
application, and wish to use it from Python. Because only the
access_token is present it can not be refreshed and will in time
expire.
AccessTokenCredentials objects may be safely pickled and unpickled.
Usage:
credentials = AccessTokenCredentials('<an access token>',
'my-user-agent/1.0')
http = httplib2.Http()
http = credentials.authorize(http)
Exceptions:
AccessTokenCredentialsExpired: raised when the access_token expires or is
revoked.
"""
def __init__(self, access_token, user_agent):
"""Create an instance of OAuth2Credentials
This is one of the few types if Credentials that you should contrust,
Credentials objects are usually instantiated by a Flow.
Args:
access_token: string, access token.
user_agent: string, The HTTP User-Agent to provide for this application.
Notes:
store: callable, a callable that when passed a Credential
will store the credential back to where it came from.
"""
super(AccessTokenCredentials, self).__init__(
access_token,
None,
None,
None,
None,
None,
user_agent)
@classmethod
def from_json(cls, s):
data = simplejson.loads(s)
retval = AccessTokenCredentials(
data['access_token'],
data['user_agent'])
return retval
def _refresh(self, http_request):
raise AccessTokenCredentialsError(
"The access_token is expired or invalid and can't be refreshed.")
class AssertionCredentials(OAuth2Credentials):
"""Abstract Credentials object used for OAuth 2.0 assertion grants.
This credential does not require a flow to instantiate because it
represents a two legged flow, and therefore has all of the required
information to generate and refresh its own access tokens. It must
be subclassed to generate the appropriate assertion string.
AssertionCredentials objects may be safely pickled and unpickled.
"""
def __init__(self, assertion_type, user_agent,
token_uri='https://accounts.google.com/o/oauth2/token',
**unused_kwargs):
"""Constructor for AssertionFlowCredentials.
Args:
assertion_type: string, assertion type that will be declared to the auth
server
user_agent: string, The HTTP User-Agent to provide for this application.
token_uri: string, URI for token endpoint. For convenience
defaults to Google's endpoints but any OAuth 2.0 provider can be used.
"""
super(AssertionCredentials, self).__init__(
None,
None,
None,
None,
None,
token_uri,
user_agent)
self.assertion_type = assertion_type
def _generate_refresh_request_body(self):
assertion = self._generate_assertion()
body = urllib.urlencode({
'assertion_type': self.assertion_type,
'assertion': assertion,
'grant_type': 'assertion',
})
return body
def _generate_assertion(self):
"""Generate the assertion string that will be used in the access token
request.
"""
_abstract()
if HAS_OPENSSL:
# PyOpenSSL is not a prerequisite for oauth2client, so if it is missing then
# don't create the SignedJwtAssertionCredentials or the verify_id_token()
# method.
class SignedJwtAssertionCredentials(AssertionCredentials):
"""Credentials object used for OAuth 2.0 Signed JWT assertion grants.
This credential does not require a flow to instantiate because it
represents a two legged flow, and therefore has all of the required
information to generate and refresh its own access tokens.
"""
MAX_TOKEN_LIFETIME_SECS = 3600 # 1 hour in seconds
def __init__(self,
service_account_name,
private_key,
scope,
private_key_password='notasecret',
user_agent=None,
token_uri='https://accounts.google.com/o/oauth2/token',
**kwargs):
"""Constructor for SignedJwtAssertionCredentials.
Args:
service_account_name: string, id for account, usually an email address.
private_key: string, private key in P12 format.
scope: string or list of strings, scope(s) of the credentials being
requested.
private_key_password: string, password for private_key.
user_agent: string, HTTP User-Agent to provide for this application.
token_uri: string, URI for token endpoint. For convenience
defaults to Google's endpoints but any OAuth 2.0 provider can be used.
kwargs: kwargs, Additional parameters to add to the JWT token, for
example prn=joe@xample.org."""
super(SignedJwtAssertionCredentials, self).__init__(
'http://oauth.net/grant_type/jwt/1.0/bearer',
user_agent,
token_uri=token_uri,
)
if type(scope) is list:
scope = ' '.join(scope)
self.scope = scope
self.private_key = private_key
self.private_key_password = private_key_password
self.service_account_name = service_account_name
self.kwargs = kwargs
@classmethod
def from_json(cls, s):
data = simplejson.loads(s)
retval = SignedJwtAssertionCredentials(
data['service_account_name'],
data['private_key'],
data['private_key_password'],
data['scope'],
data['user_agent'],
data['token_uri'],
data['kwargs']
)
retval.invalid = data['invalid']
return retval
def _generate_assertion(self):
"""Generate the assertion that will be used in the request."""
now = long(time.time())
payload = {
'aud': self.token_uri,
'scope': self.scope,
'iat': now,
'exp': now + SignedJwtAssertionCredentials.MAX_TOKEN_LIFETIME_SECS,
'iss': self.service_account_name
}
payload.update(self.kwargs)
logger.debug(str(payload))
return make_signed_jwt(
Signer.from_string(self.private_key, self.private_key_password),
payload)
# Only used in verify_id_token(), which is always calling to the same URI
# for the certs.
_cached_http = httplib2.Http(MemoryCache())
def verify_id_token(id_token, audience, http=None,
cert_uri=ID_TOKEN_VERIFICATON_CERTS):
"""Verifies a signed JWT id_token.
Args:
id_token: string, A Signed JWT.
audience: string, The audience 'aud' that the token should be for.
http: httplib2.Http, instance to use to make the HTTP request. Callers
should supply an instance that has caching enabled.
cert_uri: string, URI of the certificates in JSON format to
verify the JWT against.
Returns:
The deserialized JSON in the JWT.
Raises:
oauth2client.crypt.AppIdentityError if the JWT fails to verify.
"""
if http is None:
http = _cached_http
resp, content = http.request(cert_uri)
if resp.status == 200:
certs = simplejson.loads(content)
return verify_signed_jwt_with_certs(id_token, certs, audience)
else:
raise VerifyJwtTokenError('Status code: %d' % resp.status)
def _urlsafe_b64decode(b64string):
# Guard against unicode strings, which base64 can't handle.
b64string = b64string.encode('ascii')
padded = b64string + '=' * (4 - len(b64string) % 4)
return base64.urlsafe_b64decode(padded)
def _extract_id_token(id_token):
"""Extract the JSON payload from a JWT.
Does the extraction w/o checking the signature.
Args:
id_token: string, OAuth 2.0 id_token.
Returns:
object, The deserialized JSON payload.
"""
segments = id_token.split('.')
if (len(segments) != 3):
raise VerifyJwtTokenError(
'Wrong number of segments in token: %s' % id_token)
return simplejson.loads(_urlsafe_b64decode(segments[1]))
def credentials_from_code(client_id, client_secret, scope, code,
redirect_uri = 'postmessage',
http=None, user_agent=None,
token_uri='https://accounts.google.com/o/oauth2/token'):
"""Exchanges an authorization code for an OAuth2Credentials object.
Args:
client_id: string, client identifier.
client_secret: string, client secret.
scope: string or list of strings, scope(s) to request.
code: string, An authroization code, most likely passed down from
the client
redirect_uri: string, this is generally set to 'postmessage' to match the
redirect_uri that the client specified
http: httplib2.Http, optional http instance to use to do the fetch
token_uri: string, URI for token endpoint. For convenience
defaults to Google's endpoints but any OAuth 2.0 provider can be used.
Returns:
An OAuth2Credentials object.
Raises:
FlowExchangeError if the authorization code cannot be exchanged for an
access token
"""
flow = OAuth2WebServerFlow(client_id, client_secret, scope, user_agent,
'https://accounts.google.com/o/oauth2/auth',
token_uri)
# We primarily make this call to set up the redirect_uri in the flow object
uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri)
credentials = flow.step2_exchange(code, http)
return credentials
def credentials_from_clientsecrets_and_code(filename, scope, code,
message = None,
redirect_uri = 'postmessage',
http=None):
"""Returns OAuth2Credentials from a clientsecrets file and an auth code.
Will create the right kind of Flow based on the contents of the clientsecrets
file or will raise InvalidClientSecretsError for unknown types of Flows.
Args:
filename: string, File name of clientsecrets.
scope: string or list of strings, scope(s) to request.
code: string, An authroization code, most likely passed down from
the client
message: string, A friendly string to display to the user if the
clientsecrets file is missing or invalid. If message is provided then
sys.exit will be called in the case of an error. If message in not
provided then clientsecrets.InvalidClientSecretsError will be raised.
redirect_uri: string, this is generally set to 'postmessage' to match the
redirect_uri that the client specified
http: httplib2.Http, optional http instance to use to do the fetch
Returns:
An OAuth2Credentials object.
Raises:
FlowExchangeError if the authorization code cannot be exchanged for an
access token
UnknownClientSecretsFlowError if the file describes an unknown kind of Flow.
clientsecrets.InvalidClientSecretsError if the clientsecrets file is
invalid.
"""
flow = flow_from_clientsecrets(filename, scope, message)
# We primarily make this call to set up the redirect_uri in the flow object
uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri)
credentials = flow.step2_exchange(code, http)
return credentials
class OAuth2WebServerFlow(Flow):
"""Does the Web Server Flow for OAuth 2.0.
OAuth2Credentials objects may be safely pickled and unpickled.
"""
def __init__(self, client_id, client_secret, scope, user_agent=None,
auth_uri='https://accounts.google.com/o/oauth2/auth',
token_uri='https://accounts.google.com/o/oauth2/token',
**kwargs):
"""Constructor for OAuth2WebServerFlow.
Args:
client_id: string, client identifier.
client_secret: string client secret.
scope: string or list of strings, scope(s) of the credentials being
requested.
user_agent: string, HTTP User-Agent to provide for this application.
auth_uri: string, URI for authorization endpoint. For convenience
defaults to Google's endpoints but any OAuth 2.0 provider can be used.
token_uri: string, URI for token endpoint. For convenience
defaults to Google's endpoints but any OAuth 2.0 provider can be used.
**kwargs: dict, The keyword arguments are all optional and required
parameters for the OAuth calls.
"""
self.client_id = client_id
self.client_secret = client_secret
if type(scope) is list:
scope = ' '.join(scope)
self.scope = scope
self.user_agent = user_agent
self.auth_uri = auth_uri
self.token_uri = token_uri
self.params = {
'access_type': 'offline',
}
self.params.update(kwargs)
self.redirect_uri = None
def step1_get_authorize_url(self, redirect_uri=OOB_CALLBACK_URN):
"""Returns a URI to redirect to the provider.
Args:
redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for
a non-web-based application, or a URI that handles the callback from
the authorization server.
If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the
generated verification code to step2_exchange,
otherwise pass in the query parameters received
at the callback uri to step2_exchange.
"""
self.redirect_uri = redirect_uri
query = {
'response_type': 'code',
'client_id': self.client_id,
'redirect_uri': redirect_uri,
'scope': self.scope,
}
query.update(self.params)
parts = list(urlparse.urlparse(self.auth_uri))
query.update(dict(parse_qsl(parts[4]))) # 4 is the index of the query part
parts[4] = urllib.urlencode(query)
return urlparse.urlunparse(parts)
def step2_exchange(self, code, http=None):
"""Exhanges a code for OAuth2Credentials.
Args:
code: string or dict, either the code as a string, or a dictionary
of the query parameters to the redirect_uri, which contains
the code.
http: httplib2.Http, optional http instance to use to do the fetch
Returns:
An OAuth2Credentials object that can be used to authorize requests.
Raises:
FlowExchangeError if a problem occured exchanging the code for a
refresh_token.
"""
if not (isinstance(code, str) or isinstance(code, unicode)):
if 'code' not in code:
if 'error' in code:
error_msg = code['error']
else:
error_msg = 'No code was supplied in the query parameters.'
raise FlowExchangeError(error_msg)
else:
code = code['code']
body = urllib.urlencode({
'grant_type': 'authorization_code',
'client_id': self.client_id,
'client_secret': self.client_secret,
'code': code,
'redirect_uri': self.redirect_uri,
'scope': self.scope,
})
headers = {
'content-type': 'application/x-www-form-urlencoded',
}
if self.user_agent is not None:
headers['user-agent'] = self.user_agent
if http is None:
http = httplib2.Http()
resp, content = http.request(self.token_uri, method='POST', body=body,
headers=headers)
if resp.status == 200:
# TODO(jcgregorio) Raise an error if simplejson.loads fails?
d = simplejson.loads(content)
access_token = d['access_token']
refresh_token = d.get('refresh_token', None)
token_expiry = None
if 'expires_in' in d:
token_expiry = datetime.datetime.utcnow() + datetime.timedelta(
seconds=int(d['expires_in']))
if 'id_token' in d:
d['id_token'] = _extract_id_token(d['id_token'])
logger.info('Successfully retrieved access token: %s' % content)
return OAuth2Credentials(access_token, self.client_id,
self.client_secret, refresh_token, token_expiry,
self.token_uri, self.user_agent,
id_token=d.get('id_token', None))
else:
logger.info('Failed to retrieve access token: %s' % content)
error_msg = 'Invalid response %s.' % resp['status']
try:
d = simplejson.loads(content)
if 'error' in d:
error_msg = d['error']
except:
pass
raise FlowExchangeError(error_msg)
def flow_from_clientsecrets(filename, scope, message=None):
"""Create a Flow from a clientsecrets file.
Will create the right kind of Flow based on the contents of the clientsecrets
file or will raise InvalidClientSecretsError for unknown types of Flows.
Args:
filename: string, File name of client secrets.
scope: string or list of strings, scope(s) to request.
message: string, A friendly string to display to the user if the
clientsecrets file is missing or invalid. If message is provided then
sys.exit will be called in the case of an error. If message in not
provided then clientsecrets.InvalidClientSecretsError will be raised.
Returns:
A Flow object.
Raises:
UnknownClientSecretsFlowError if the file describes an unknown kind of Flow.
clientsecrets.InvalidClientSecretsError if the clientsecrets file is
invalid.
"""
try:
client_type, client_info = clientsecrets.loadfile(filename)
if client_type in [clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED]:
return OAuth2WebServerFlow(
client_info['client_id'],
client_info['client_secret'],
scope,
None, # user_agent
client_info['auth_uri'],
client_info['token_uri'])
except clientsecrets.InvalidClientSecretsError:
if message:
sys.exit(message)
else:
raise
else:
raise UnknownClientSecretsFlowError(
'This OAuth 2.0 flow is unsupported: "%s"' * client_type)
| ajibawa-2023/Python-Code-Large/train/row_99166 | 396 | 1,139 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0145, 0.0035, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"An OAuth 2.0 client.\n\nTools for interacting with OAuth 2.0 protected resources.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0176, 0.0009, 0, 0.66, 0.0244, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L22_C0", "label": "base64 import base64", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0193, 0.0009, 0, 0.66, 0.0488, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L23_C0", "label": "clientsecrets import clientsecrets", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0009, 0, 0.66, 0.0732, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "clientsecrets", "arg_names": [], "import_names": ["clientsecrets"], "rhs_call_name": "", "annotation": ""}, "snippet": "import clientsecrets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L24_C0", "label": "copy import copy", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0211, 0.0009, 0, 0.66, 0.0976, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L25_C0", "label": "datetime import datetime", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0219, 0.0009, 0, 0.66, 0.122, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L26_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0228, 0.0009, 0, 0.66, 0.1463, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L27_C0", "label": "logging import logging", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0237, 0.0009, 0, 0.66, 0.1707, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L28_C0", "label": "os import os", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0246, 0.0009, 0, 0.66, 0.1951, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L29_C0", "label": "sys import sys", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0255, 0.0009, 0, 0.66, 0.2195, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L30_C0", "label": "time import time", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0009, 0, 0.66, 0.2439, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L31_C0", "label": "urllib import urllib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0272, 0.0009, 0, 0.66, 0.2683, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Import_L32_C0", "label": "urlparse import urlparse", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0281, 0.0009, 0, 0.66, 0.2927, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urlparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L34_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0299, 0.0009, 0, 0.66, 0.3171, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L36_C0", "label": "HAS_OPENSSL =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.0316, 0.0009, 0, 0.66, 0.3415, 62, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "HAS_OPENSSL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "HAS_OPENSSL = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "label": "try", "type": "try", "loc": [37, 43], "level": 0, "parent": null, "vector": [7, 0, 0.0351, 0.0061, 0, 0.66, 0.3659, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from oauth2client.crypt import Signer\n from oauth2client.crypt import make_signed_jwt\n from oauth2client.crypt import verify_signed_jwt_with_certs\n HAS_OPENSSL = True\nexcept ImportError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L38_C2", "label": "from oauth2client.crypt import Signer", "type": "import", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "vector": [1, 1, 0.0334, 0.0009, 1, 0.9, 0.0, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "oauth2client.crypt", "arg_names": [], "import_names": ["Signer"], "rhs_call_name": "", "annotation": ""}, "snippet": " from oauth2client.crypt import Signer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L39_C2", "label": "from oauth2client.crypt import make_signed_jwt", "type": "import", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "vector": [1, 1, 0.0342, 0.0009, 1, 0.9, 0.3333, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "oauth2client.crypt", "arg_names": [], "import_names": ["make_signed_jwt"], "rhs_call_name": "", "annotation": ""}, "snippet": " from oauth2client.crypt import make_signed_jwt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L40_C2", "label": "from oauth2client.crypt import verify_signed_jwt_with_certs", "type": "import", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "vector": [1, 1, 0.0351, 0.0009, 1, 0.9, 0.6667, 792, 0, 1, 0, 0, 792, 0, 0], "semantic": {"name": "oauth2client.crypt", "arg_names": [], "import_names": ["verify_signed_jwt_with_certs"], "rhs_call_name": "", "annotation": ""}, "snippet": " from oauth2client.crypt import verify_signed_jwt_with_certs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L41_C2", "label": "HAS_OPENSSL =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "vector": [14, 1, 0.036, 0.0009, 1, 0.9, 1.0, 62, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "HAS_OPENSSL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " HAS_OPENSSL = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L45_C0", "label": "try", "type": "try", "loc": [45, 48], "level": 0, "parent": null, "vector": [7, 0, 0.0408, 0.0035, 0, 0.66, 0.3902, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from urlparse import parse_qsl\nexcept ImportError:\n from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L46_C2", "label": "from urlparse import parse_qsl", "type": "import", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L45_C0", "vector": [1, 1, 0.0404, 0.0009, 1, 0.33, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from urlparse import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L48_C2", "label": "from cgi import parse_qsl", "type": "import", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L45_C0", "vector": [1, 1, 0.0421, 0.0009, 1, 0.33, 0.0, 934, 0, 1, 0, 0, 934, 0, 0], "semantic": {"name": "cgi", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L50_C0", "label": "logger = getLogger()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.0439, 0.0009, 0, 0.66, 0.4146, 532, 3, 1, 0, 0, 71, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "getLogger", "annotation": ""}, "snippet": "logger = logging.getLogger(__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L53_C0", "label": "EXPIRY_FORMAT =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.0465, 0.0009, 0, 0.66, 0.439, 87, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EXPIRY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXPIRY_FORMAT = '%Y-%m-%dT%H:%M:%SZ'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L56_C0", "label": "ID_TOKEN_VERIFICATON_CERTS =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.0492, 0.0009, 0, 0.66, 0.4634, 345, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ID_TOKEN_VERIFICATON_CERTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ID_TOKEN_VERIFICATON_CERTS = 'https://www.googleapis.com/oauth2/v1/certs'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L59_C0", "label": "OOB_CALLBACK_URN =", "type": "assigned_variable", "loc": [59, 59], "level": 0, "parent": null, "vector": [14, 0, 0.0518, 0.0009, 0, 0.66, 0.4878, 667, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OOB_CALLBACK_URN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OOB_CALLBACK_URN = 'urn:ietf:wg:oauth:2.0:oob'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L62_C0", "label": "Error", "type": "class", "loc": [62, 64], "level": 0, "parent": null, "vector": [3, 0, 0.0553, 0.0026, 0, 0.66, 0.5122, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L63_C2", "label": "expression", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L62_C0", "vector": [8, 1, 0.0553, 0.0009, 1, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L67_C0", "label": "FlowExchangeError", "type": "class", "loc": [67, 69], "level": 0, "parent": null, "vector": [3, 0, 0.0597, 0.0026, 0, 0.66, 0.5366, 369, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "FlowExchangeError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowExchangeError(Error):\n \"\"\"Error trying to exchange an authorization grant for an access token.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L68_C2", "label": "expression", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L67_C0", "vector": [8, 1, 0.0597, 0.0009, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error trying to exchange an authorization grant for an access token.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L72_C0", "label": "AccessTokenRefreshError", "type": "class", "loc": [72, 74], "level": 0, "parent": null, "vector": [3, 0, 0.0641, 0.0026, 0, 0.66, 0.561, 773, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "AccessTokenRefreshError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessTokenRefreshError(Error):\n \"\"\"Error trying to refresh an expired access token.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L73_C2", "label": "expression", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L72_C0", "vector": [8, 1, 0.0641, 0.0009, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error trying to refresh an expired access token.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L76_C0", "label": "UnknownClientSecretsFlowError", "type": "class", "loc": [76, 78], "level": 0, "parent": null, "vector": [3, 0, 0.0676, 0.0026, 0, 0.66, 0.5854, 728, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnknownClientSecretsFlowError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnknownClientSecretsFlowError(Error):\n \"\"\"The client secrets file called for an unknown type of OAuth 2.0 flow. \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L77_C2", "label": "expression", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L76_C0", "vector": [8, 1, 0.0676, 0.0009, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The client secrets file called for an unknown type of OAuth 2.0 flow. \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L81_C0", "label": "AccessTokenCredentialsError", "type": "class", "loc": [81, 83], "level": 0, "parent": null, "vector": [3, 0, 0.072, 0.0026, 0, 0.66, 0.6098, 450, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "AccessTokenCredentialsError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessTokenCredentialsError(Error):\n \"\"\"Having only the access_token means no refresh is possible.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L82_C2", "label": "expression", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L81_C0", "vector": [8, 1, 0.072, 0.0009, 1, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Having only the access_token means no refresh is possible.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L86_C0", "label": "VerifyJwtTokenError", "type": "class", "loc": [86, 88], "level": 0, "parent": null, "vector": [3, 0, 0.0764, 0.0026, 0, 0.66, 0.6341, 43, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "VerifyJwtTokenError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VerifyJwtTokenError(Error):\n \"\"\"Could on retrieve certificates for validation.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L87_C2", "label": "expression", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L86_C0", "vector": [8, 1, 0.0764, 0.0009, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Could on retrieve certificates for validation.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L91_C0", "label": "_abstract", "type": "function", "loc": [91, 92], "level": 0, "parent": null, "vector": [2, 0, 0.0803, 0.0018, 0, 0.66, 0.6585, 629, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _abstract():\n raise NotImplementedError('You need to override this function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "label": "MemoryCache", "type": "class", "loc": [95, 108], "level": 0, "parent": null, "vector": [3, 0, 0.0891, 0.0123, 0, 0.66, 0.6829, 322, 0, 4, 0, 0, 186, 0, 2], "semantic": {"name": "MemoryCache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MemoryCache(object):\n \"\"\"httplib2 Cache implementation which only caches locally.\"\"\"\n\n def __init__(self):\n self.cache = {}\n\n def get(self, key):\n return self.cache.get(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L96_C2", "label": "expression", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "vector": [8, 1, 0.0843, 0.0009, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"httplib2 Cache implementation which only caches locally.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L98_C2", "label": "__init__", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "vector": [2, 1, 0.0865, 0.0018, 1, 0.43, 0.25, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L99_C4", "label": "self.cache =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L98_C2", "vector": [14, 2, 0.0869, 0.0009, 2, 0.97, 0.0, 55, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L101_C2", "label": "get", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "vector": [2, 1, 0.0891, 0.0018, 1, 0.43, 0.5, 607, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self, key):\n return self.cache.get(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L102_C4", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L101_C2", "vector": [13, 2, 0.0896, 0.0009, 2, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cache.get(key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L104_C2", "label": "set", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "vector": [2, 1, 0.0917, 0.0018, 1, 0.43, 0.75, 21, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "set", "arg_names": ["self", "key", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set(self, key, value):\n self.cache[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L105_C4", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L104_C2", "vector": [14, 2, 0.0922, 0.0009, 2, 0.86, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cache[key] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L107_C2", "label": "delete", "type": "function", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "vector": [2, 1, 0.0944, 0.0018, 1, 0.43, 1.0, 266, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self, key):\n self.cache.pop(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L108_C4", "label": "pop()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L107_C2", "vector": [8, 2, 0.0948, 0.0009, 2, 0.5, 0.0, 969, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.cache.pop(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "label": "Credentials", "type": "class", "loc": [111, 219], "level": 0, "parent": null, "vector": [3, 0, 0.1449, 0.0957, 0, 0.66, 0.7073, 309, 0, 7, 0, 0, 186, 0, 19], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(object):\n \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method that applies the credentials to\n an HTTP transport.\n\n Subclasses must also specify a classmethod named 'from_json' that takes a JSON\n string as input and returns an instaniated Credentials object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L112_C2", "label": "expression", "type": "expression", "loc": [112, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [8, 1, 0.1014, 0.007, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method that applies the credentials to\n an HTTP transport.\n\n Subclasses must also specify a classmethod named 'from_json' that takes a JSON\n string as input and returns an instaniated Credentials object.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L121_C2", "label": "NON_SERIALIZED_MEMBERS =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [14, 1, 0.1062, 0.0009, 1, 0.92, 0.125, 192, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "NON_SERIALIZED_MEMBERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " NON_SERIALIZED_MEMBERS = ['store']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L123_C2", "label": "authorize", "type": "function", "loc": [123, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.1111, 0.007, 1, 0.92, 0.25, 880, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L124_C4", "label": "expression", "type": "expression", "loc": [124, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L123_C2", "vector": [8, 2, 0.1111, 0.0053, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L130_C4", "label": "_abstract()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L123_C2", "vector": [8, 2, 0.1141, 0.0009, 2, 0.65, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L132_C2", "label": "refresh", "type": "function", "loc": [132, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.119, 0.007, 1, 0.92, 0.375, 804, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "refresh", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def refresh(self, http):\n \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L133_C4", "label": "expression", "type": "expression", "loc": [133, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L132_C2", "vector": [8, 2, 0.119, 0.0053, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L139_C4", "label": "_abstract()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L132_C2", "vector": [8, 2, 0.122, 0.0009, 2, 0.52, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L141_C2", "label": "apply", "type": "function", "loc": [141, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.1264, 0.0061, 1, 0.92, 0.5, 524, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": ["self", "headers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self, headers):\n \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L142_C4", "label": "expression", "type": "expression", "loc": [142, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L141_C2", "vector": [8, 2, 0.1264, 0.0044, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L147_C4", "label": "_abstract()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L141_C2", "vector": [8, 2, 0.1291, 0.0009, 2, 0.53, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "label": "_to_json", "type": "function", "loc": [149, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.1396, 0.0184, 1, 0.92, 0.625, 879, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_to_json", "arg_names": ["self", "strip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_json(self, strip):\n \"\"\"Utility function for creating a JSON representation of an instance of Credentials.\n\n Args:\n strip: array, An array of names of members to not include in the JSON.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [8, 2, 0.1352, 0.0079, 2, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility function for creating a JSON representation of an instance of Credentials.\n\n Args:\n strip: array, An array of names of members to not include in the JSON.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json()."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L159_C4", "label": "t = type()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [14, 2, 0.1396, 0.0009, 2, 0.23, 0.1429, 15, 3, 1, 0, 0, 801, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "type", "annotation": ""}, "snippet": " t = type(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L160_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [14, 2, 0.1405, 0.0009, 2, 0.23, 0.2857, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:For_L161_C4", "label": "for member", "type": "for", "loc": [161, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [6, 2, 0.1422, 0.0026, 2, 0.23, 0.4286, 150, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "member", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for member in strip:\n if member in d:\n del d[member]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L162_C6", "label": "if", "type": "if", "loc": [162, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:For_L161_C4", "vector": [4, 3, 0.1427, 0.0018, 3, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if member in d:\n del d[member]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L164_C4", "label": "if", "type": "if", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [4, 2, 0.1444, 0.0018, 2, 0.23, 0.5714, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'token_expiry' in d and isinstance(d['token_expiry'], datetime.datetime):\n d['token_expiry'] = d['token_expiry'].strftime(EXPIRY_FORMAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L165_C6", "label": " = strftime()", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L164_C4", "vector": [14, 3, 0.1449, 0.0009, 3, 0.99, 0.0, 0, 3, 1, 0, 0, 668, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "strftime", "annotation": ""}, "snippet": " d['token_expiry'] = d['token_expiry'].strftime(EXPIRY_FORMAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L167_C4", "label": "assign", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [14, 2, 0.1466, 0.0009, 2, 0.23, 0.7143, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['_class'] = t.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L168_C4", "label": "assign", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [14, 2, 0.1475, 0.0009, 2, 0.23, 0.8571, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['_module'] = t.__module__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L169_C4", "label": "return", "type": "return", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "vector": [13, 2, 0.1484, 0.0009, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.dumps(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L171_C2", "label": "to_json", "type": "function", "loc": [171, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.1532, 0.007, 1, 0.92, 0.75, 287, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "to_json", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_json(self):\n \"\"\"Creating a JSON representation of an instance of Credentials.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json().\n \"\"\"\n return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L172_C4", "label": "expression", "type": "expression", "loc": [172, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L171_C2", "vector": [8, 2, 0.1532, 0.0053, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Creating a JSON representation of an instance of Credentials.\n\n Returns:\n string, a JSON representation of this instance, suitable to pass to\n from_json().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L178_C4", "label": "return", "type": "return", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L171_C2", "vector": [13, 2, 0.1563, 0.0009, 2, 0.35, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "label": "new_from_json", "type": "function", "loc": [181, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.1694, 0.0219, 1, 0.92, 0.875, 495, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "new_from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_from_json(cls, s):\n \"\"\"Utility class method to instantiate a Credentials subclass from a JSON\n representation produced by to_json().\n\n Args:\n s: string, JSON from to_json().\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L182_C4", "label": "expression", "type": "expression", "loc": [182, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [8, 2, 0.1637, 0.0088, 2, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility class method to instantiate a Credentials subclass from a JSON\n representation produced by to_json().\n\n Args:\n s: string, JSON from to_json().\n\n Returns:\n An instance of the subclass of Credentials that was serialized with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L192_C4", "label": "data = loads()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [14, 2, 0.1686, 0.0009, 2, 0.91, 0.1429, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L194_C4", "label": "module =", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [14, 2, 0.1703, 0.0009, 2, 0.91, 0.2857, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " module = data['_module']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "label": "try", "type": "try", "loc": [195, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [7, 2, 0.1734, 0.0053, 2, 0.91, 0.4286, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n m = __import__(module)\n except ImportError:\n # In case there's an object from the old package structure, update it\n module = module.replace('.apiclient', '')\n m = __import__(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L196_C6", "label": "m = __import__()", "type": "assigned_variable", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "vector": [14, 3, 0.1721, 0.0009, 3, 0.02, 0.0, 711, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " m = __import__(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L199_C6", "label": "module = replace()", "type": "assigned_variable", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "vector": [14, 3, 0.1747, 0.0009, 3, 0.02, 0.0, 98, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "module", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " module = module.replace('.apiclient', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L200_C6", "label": "m = __import__()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "vector": [14, 3, 0.1756, 0.0009, 3, 0.02, 1.0, 711, 3, 1, 0, 0, 744, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " m = __import__(module)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L202_C4", "label": "m = __import__()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [14, 2, 0.1773, 0.0009, 2, 0.91, 0.5714, 711, 3, 2, 0, 0, 744, 10, 2], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "__import__", "annotation": ""}, "snippet": " m = __import__(module, fromlist=module.split('.')[:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L203_C4", "label": "kls = getattr()", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [14, 2, 0.1782, 0.0009, 2, 0.91, 0.7143, 947, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "kls", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " kls = getattr(m, data['_class'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L204_C4", "label": "from_json = getattr()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [14, 2, 0.1791, 0.0009, 2, 0.91, 0.8571, 975, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "from_json", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " from_json = getattr(kls, 'from_json')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L205_C4", "label": "return", "type": "return", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "vector": [13, 2, 0.18, 0.0009, 2, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return from_json(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L208_C2", "label": "from_json", "type": "function", "loc": [208, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "vector": [2, 1, 0.1874, 0.0105, 1, 0.92, 1.0, 975, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n \"\"\"Instantiate a Credentials object from a JSON description of it.\n\n The JSON should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L209_C4", "label": "expression", "type": "expression", "loc": [209, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L208_C2", "vector": [8, 2, 0.1874, 0.0088, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Instantiate a Credentials object from a JSON description of it.\n\n The JSON should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L219_C4", "label": "return", "type": "return", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L208_C2", "vector": [13, 2, 0.1923, 0.0009, 2, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Credentials()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L222_C0", "label": "Flow", "type": "class", "loc": [222, 224], "level": 0, "parent": null, "vector": [3, 0, 0.1958, 0.0026, 0, 0.66, 0.7317, 746, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "Flow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Flow(object):\n \"\"\"Base class for all Flow objects.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L223_C2", "label": "expression", "type": "expression", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L222_C0", "vector": [8, 1, 0.1958, 0.0009, 1, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Flow objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "label": "Storage", "type": "class", "loc": [227, 318], "level": 0, "parent": null, "vector": [3, 0, 0.2392, 0.0808, 0, 0.66, 0.7561, 850, 0, 8, 0, 0, 186, 0, 12], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(object):\n \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential. This class supports locking\n such that multiple processes and threads can operate on a single\n store.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L228_C2", "label": "expression", "type": "expression", "loc": [228, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [8, 1, 0.2024, 0.0053, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential. This class supports locking\n such that multiple processes and threads can operate on a single\n store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L235_C2", "label": "acquire_lock", "type": "function", "loc": [235, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2085, 0.0053, 1, 0.69, 0.125, 5, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "acquire_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def acquire_lock(self):\n \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L236_C4", "label": "expression", "type": "expression", "loc": [236, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L235_C2", "vector": [8, 2, 0.2085, 0.0035, 2, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L242_C2", "label": "release_lock", "type": "function", "loc": [242, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2151, 0.0061, 1, 0.69, 0.25, 821, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "release_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_lock(self):\n \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L243_C4", "label": "expression", "type": "expression", "loc": [243, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L242_C2", "vector": [8, 2, 0.2151, 0.0044, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L250_C2", "label": "locked_get", "type": "function", "loc": [250, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.223, 0.0079, 1, 0.69, 0.375, 579, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L251_C4", "label": "expression", "type": "expression", "loc": [251, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L250_C2", "vector": [8, 2, 0.223, 0.0061, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n The Storage lock must be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L258_C4", "label": "_abstract()", "type": "expression", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L250_C2", "vector": [8, 2, 0.2265, 0.0009, 2, 0.36, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L260_C2", "label": "locked_put", "type": "function", "loc": [260, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2318, 0.0079, 1, 0.69, 0.5, 154, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L261_C4", "label": "expression", "type": "expression", "loc": [261, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L260_C2", "vector": [8, 2, 0.2318, 0.0061, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L268_C4", "label": "_abstract()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L260_C2", "vector": [8, 2, 0.2353, 0.0009, 2, 0.42, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L270_C2", "label": "locked_delete", "type": "function", "loc": [270, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2392, 0.0053, 1, 0.69, 0.625, 769, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L271_C4", "label": "expression", "type": "expression", "loc": [271, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L270_C2", "vector": [8, 2, 0.2392, 0.0035, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete a credential.\n\n The Storage lock must be held when this is called.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L275_C4", "label": "_abstract()", "type": "expression", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L270_C2", "vector": [8, 2, 0.2414, 0.0009, 2, 0.66, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "label": "get", "type": "function", "loc": [277, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2485, 0.0114, 1, 0.69, 0.75, 607, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve credential.\n\n The Storage lock must *not* be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L278_C4", "label": "expression", "type": "expression", "loc": [278, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "vector": [8, 2, 0.2467, 0.0061, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n The Storage lock must *not* be held when this is called.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L285_C4", "label": "acquire_lock()", "type": "expression", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "vector": [8, 2, 0.2502, 0.0009, 2, 0.71, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L286_C4", "label": "try", "type": "try", "loc": [286, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "vector": [7, 2, 0.2524, 0.0035, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.locked_get()\n finally:\n self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L287_C6", "label": "return", "type": "return", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L286_C4", "vector": [13, 3, 0.252, 0.0009, 3, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.locked_get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L289_C6", "label": "release_lock()", "type": "expression", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L286_C4", "vector": [8, 3, 0.2537, 0.0009, 3, 0.7, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "label": "put", "type": "function", "loc": [291, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2608, 0.0114, 1, 0.69, 0.875, 636, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L292_C4", "label": "expression", "type": "expression", "loc": [292, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "vector": [8, 2, 0.259, 0.0061, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n The Storage lock must be held when this is called.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L299_C4", "label": "acquire_lock()", "type": "expression", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "vector": [8, 2, 0.2625, 0.0009, 2, 0.15, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L300_C4", "label": "try", "type": "try", "loc": [300, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "vector": [7, 2, 0.2647, 0.0035, 2, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.locked_put(credentials)\n finally:\n self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L301_C6", "label": "locked_put()", "type": "expression", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L300_C4", "vector": [8, 3, 0.2643, 0.0009, 3, 0.58, 0.0, 154, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": [], "import_names": [], "rhs_call_name": "locked_put", "annotation": ""}, "snippet": " self.locked_put(credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L303_C6", "label": "release_lock()", "type": "expression", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L300_C4", "vector": [8, 3, 0.266, 0.0009, 3, 0.58, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "label": "delete", "type": "function", "loc": [305, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "vector": [2, 1, 0.2735, 0.0123, 1, 0.69, 1.0, 266, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self):\n \"\"\"Delete credential.\n\n Frees any resources associated with storing the credential.\n The Storage lock must *not* be held when this is called.\n\n Returns:\n None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L306_C4", "label": "expression", "type": "expression", "loc": [306, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "vector": [8, 2, 0.2717, 0.007, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete credential.\n\n Frees any resources associated with storing the credential.\n The Storage lock must *not* be held when this is called.\n\n Returns:\n None\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L314_C4", "label": "acquire_lock()", "type": "expression", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "vector": [8, 2, 0.2757, 0.0009, 2, 0.53, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L315_C4", "label": "try", "type": "try", "loc": [315, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "vector": [7, 2, 0.2779, 0.0035, 2, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.locked_delete()\n finally:\n self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L316_C6", "label": "return", "type": "return", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L315_C4", "vector": [13, 3, 0.2774, 0.0009, 3, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.locked_delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L318_C6", "label": "release_lock()", "type": "expression", "loc": [318, 318], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L315_C4", "vector": [8, 3, 0.2792, 0.0009, 3, 0.96, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "label": "OAuth2Credentials", "type": "class", "loc": [321, 625], "level": 0, "parent": null, "vector": [3, 0, 0.4153, 0.2678, 0, 0.66, 0.7805, 494, 0, 16, 0, 0, 309, 0, 44], "semantic": {"name": "OAuth2Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuth2Credentials(Credentials):\n \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the authorize()\n method, which then adds the OAuth 2.0 access token to each request.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L322_C2", "label": "expression", "type": "expression", "loc": [322, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [8, 1, 0.2853, 0.0061, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the authorize()\n method, which then adds the OAuth 2.0 access token to each request.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "label": "__init__", "type": "function", "loc": [330, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.3051, 0.0316, 1, 0.44, 0.0667, 555, 0, 9, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "access_token", "client_id", "client_secret", "refresh_token", "token_expiry", "token_uri", "user_agent", "id_token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, access_token, client_id, client_secret, refresh_token,\n token_expiry, token_uri, user_agent, id_token=None):\n \"\"\"Create an instance of OAuth2Credentials.\n\n This constructor is not usually called by the user, instead\n OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L332_C4", "label": "expression", "type": "expression", "loc": [332, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [8, 2, 0.3003, 0.0184, 2, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an instance of OAuth2Credentials.\n\n This constructor is not usually called by the user, instead\n OAuth2Credentials objects are instantiated by the OAuth2WebServerFlow.\n\n Args:\n access_token: string, access token.\n client_id: string, client identifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L353_C4", "label": "self.access_token =", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3099, 0.0009, 2, 0.74, 0.1, 909, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.access_token = access_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L354_C4", "label": "self.client_id =", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3108, 0.0009, 2, 0.74, 0.2, 144, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_id = client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L355_C4", "label": "self.client_secret =", "type": "assigned_variable", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3117, 0.0009, 2, 0.74, 0.3, 451, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_secret = client_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L356_C4", "label": "self.refresh_token =", "type": "assigned_variable", "loc": [356, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3126, 0.0009, 2, 0.74, 0.4, 920, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.refresh_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.refresh_token = refresh_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L357_C4", "label": "self.store =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3134, 0.0009, 2, 0.74, 0.5, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L358_C4", "label": "self.token_expiry =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3143, 0.0009, 2, 0.74, 0.6, 327, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_expiry = token_expiry"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L359_C4", "label": "self.token_uri =", "type": "assigned_variable", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3152, 0.0009, 2, 0.74, 0.7, 941, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_uri = token_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L360_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3161, 0.0009, 2, 0.74, 0.8, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L361_C4", "label": "self.id_token =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3169, 0.0009, 2, 0.74, 0.9, 326, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.id_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.id_token = id_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L365_C4", "label": "self.invalid =", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "vector": [14, 2, 0.3205, 0.0009, 2, 0.74, 1.0, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.invalid = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "label": "authorize", "type": "function", "loc": [367, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.3516, 0.0597, 1, 0.44, 0.1333, 880, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Authorize an httplib2.Http instance with these credentials.\n\n The modified http.request method will add authentication headers to each\n request and will refresh access_tokens when a 401 is received on a\n request. In addition the http.request method has a credentials property,\n http.request.credentials, which is the Credentials object that authorized\n it."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L368_C4", "label": "expression", "type": "expression", "loc": [368, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "vector": [8, 2, 0.3341, 0.0228, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Authorize an httplib2.Http instance with these credentials.\n\n The modified http.request method will add authentication headers to each\n request and will refresh access_tokens when a 401 is received on a\n request. In addition the http.request method has a credentials property,\n http.request.credentials, which is the Credentials object that authorized\n it.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L394_C4", "label": "request_orig =", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "vector": [14, 2, 0.3459, 0.0009, 2, 0.99, 0.2, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request_orig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request_orig = http.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "label": "new_request", "type": "function", "loc": [397, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "vector": [2, 2, 0.3613, 0.0263, 2, 0.99, 0.4, 23, 0, 6, 1, 0, 0, 0, 8], "semantic": {"name": "new_request", "arg_names": ["uri", "method", "body", "headers", "redirections", "connection_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_request(uri, method='GET', body=None, headers=None,\n redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n connection_type=None):\n if not self.access_token:\n logger.info('Attempting refresh to obtain initial access_token')\n self._refresh(request_orig)\n\n # Modify the request headers to add the appropriate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L400_C6", "label": "if", "type": "if", "loc": [400, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "vector": [4, 3, 0.3521, 0.0026, 3, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.access_token:\n logger.info('Attempting refresh to obtain initial access_token')\n self._refresh(request_orig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L401_C8", "label": "info()", "type": "expression", "loc": [401, 401], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L400_C6", "vector": [8, 4, 0.3521, 0.0009, 4, 0.76, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Attempting refresh to obtain initial access_token')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L402_C8", "label": "_refresh()", "type": "expression", "loc": [402, 402], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L400_C6", "vector": [8, 4, 0.3529, 0.0009, 4, 0.76, 1.0, 770, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh", "annotation": ""}, "snippet": " self._refresh(request_orig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L406_C6", "label": "if", "type": "if", "loc": [406, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "vector": [4, 3, 0.3569, 0.0018, 3, 0.16, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if headers is None:\n headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L407_C8", "label": "headers =", "type": "assigned_variable", "loc": [407, 407], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L406_C6", "vector": [14, 4, 0.3573, 0.0009, 4, 0.2, 0.0, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L408_C6", "label": "apply()", "type": "expression", "loc": [408, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "vector": [8, 3, 0.3582, 0.0009, 3, 0.16, 0.4, 524, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": [], "import_names": [], "rhs_call_name": "apply", "annotation": ""}, "snippet": " self.apply(headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L410_C6", "label": "if", "type": "if", "loc": [410, 414], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "vector": [4, 3, 0.3617, 0.0044, 3, 0.16, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.user_agent is not None:\n if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L411_C8", "label": "if", "type": "if", "loc": [411, 414], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L410_C6", "vector": [4, 4, 0.3622, 0.0035, 4, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L412_C10", "label": "assign", "type": "assigned_variable", "loc": [412, 412], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L411_C8", "vector": [14, 5, 0.3617, 0.0009, 5, 0.57, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L414_C10", "label": "assign", "type": "assigned_variable", "loc": [414, 414], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L411_C8", "vector": [14, 5, 0.3635, 0.0009, 5, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L416_C6", "label": "resp, content = request_orig()", "type": "assigned_variable", "loc": [416, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "vector": [14, 3, 0.3657, 0.0018, 3, 0.16, 0.8, 339, 3, 6, 0, 0, 112, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request_orig", "annotation": ""}, "snippet": " resp, content = request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "label": "if", "type": "if", "loc": [419, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "vector": [4, 3, 0.3709, 0.007, 3, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 401:\n logger.info('Refreshing due to a 401')\n self._refresh(request_orig)\n self.apply(headers)\n return request_orig(uri, method, body, headers,\n redirections, connection_type)\n else:\n return (resp, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L420_C8", "label": "info()", "type": "expression", "loc": [420, 420], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "vector": [8, 4, 0.3687, 0.0009, 4, 0.55, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Refreshing due to a 401')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L421_C8", "label": "_refresh()", "type": "expression", "loc": [421, 421], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "vector": [8, 4, 0.3696, 0.0009, 4, 0.55, 0.25, 770, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh", "annotation": ""}, "snippet": " self._refresh(request_orig)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L422_C8", "label": "apply()", "type": "expression", "loc": [422, 422], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "vector": [8, 4, 0.3705, 0.0009, 4, 0.55, 0.5, 524, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "apply", "arg_names": [], "import_names": [], "rhs_call_name": "apply", "annotation": ""}, "snippet": " self.apply(headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L423_C8", "label": "return", "type": "return", "loc": [423, 424], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "vector": [13, 4, 0.3718, 0.0018, 4, 0.55, 0.75, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L426_C8", "label": "return", "type": "return", "loc": [426, 426], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "vector": [13, 4, 0.374, 0.0009, 4, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (resp, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L429_C4", "label": "http.request =", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "vector": [14, 2, 0.3766, 0.0009, 2, 0.99, 0.6, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.request = new_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L432_C4", "label": "setattr()", "type": "expression", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "vector": [8, 2, 0.3793, 0.0009, 2, 0.99, 0.8, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(http.request, 'credentials', self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L434_C4", "label": "return", "type": "return", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "vector": [13, 2, 0.381, 0.0009, 2, 0.99, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L436_C2", "label": "refresh", "type": "function", "loc": [436, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.3859, 0.007, 1, 0.44, 0.2, 804, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "refresh", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def refresh(self, http):\n \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\"\n self._refresh(http.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L437_C4", "label": "expression", "type": "expression", "loc": [437, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L436_C2", "vector": [8, 2, 0.3859, 0.0053, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Forces a refresh of the access_token.\n\n Args:\n http: httplib2.Http, an http object to be used to make the refresh\n request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L443_C4", "label": "_refresh()", "type": "expression", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L436_C2", "vector": [8, 2, 0.3889, 0.0009, 2, 0.85, 1.0, 770, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": [], "import_names": [], "rhs_call_name": "_refresh", "annotation": ""}, "snippet": " self._refresh(http.request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L445_C2", "label": "apply", "type": "function", "loc": [445, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.3933, 0.0061, 1, 0.44, 0.2667, 524, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "apply", "arg_names": ["self", "headers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def apply(self, headers):\n \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\"\n headers['Authorization'] = 'Bearer ' + self.access_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L446_C4", "label": "expression", "type": "expression", "loc": [446, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L445_C2", "vector": [8, 2, 0.3933, 0.0044, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add the authorization to the headers.\n\n Args:\n headers: dict, the headers to add the Authorization header to.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L451_C4", "label": "assign", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L445_C2", "vector": [14, 2, 0.396, 0.0009, 2, 0.8, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['Authorization'] = 'Bearer ' + self.access_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L453_C2", "label": "to_json", "type": "function", "loc": [453, 454], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.3982, 0.0018, 1, 0.44, 0.3333, 287, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "to_json", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_json(self):\n return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L454_C4", "label": "return", "type": "return", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L453_C2", "vector": [13, 2, 0.3986, 0.0009, 2, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._to_json(Credentials.NON_SERIALIZED_MEMBERS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "label": "from_json", "type": "function", "loc": [457, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4135, 0.0255, 1, 0.44, 0.4, 975, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n \"\"\"Instantiate a Credentials object from a JSON description of it. The JSON\n should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L458_C4", "label": "expression", "type": "expression", "loc": [458, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "vector": [8, 2, 0.4056, 0.0079, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Instantiate a Credentials object from a JSON description of it. The JSON\n should have been produced by calling .to_json() on the object.\n\n Args:\n data: dict, A deserialized JSON object.\n\n Returns:\n An instance of a Credentials subclass."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L467_C4", "label": "data = loads()", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "vector": [14, 2, 0.41, 0.0009, 2, 0.48, 0.2, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L468_C4", "label": "if", "type": "if", "loc": [468, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "vector": [4, 2, 0.4135, 0.0061, 2, 0.48, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'token_expiry' in data and not isinstance(data['token_expiry'],\n datetime.datetime):\n try:\n data['token_expiry'] = datetime.datetime.strptime(\n data['token_expiry'], EXPIRY_FORMAT)\n except:\n data['token_expiry'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L470_C6", "label": "try", "type": "try", "loc": [470, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L468_C4", "vector": [7, 3, 0.4144, 0.0044, 3, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n data['token_expiry'] = datetime.datetime.strptime(\n data['token_expiry'], EXPIRY_FORMAT)\n except:\n data['token_expiry'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L471_C8", "label": " = strptime()", "type": "assigned_variable", "loc": [471, 472], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L470_C6", "vector": [14, 4, 0.414, 0.0018, 4, 0.92, 0.0, 0, 3, 2, 0, 0, 839, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "strptime", "annotation": ""}, "snippet": " data['token_expiry'] = datetime.datetime.strptime(\n data['token_expiry'], EXPIRY_FORMAT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L474_C8", "label": "assign", "type": "assigned_variable", "loc": [474, 474], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L470_C6", "vector": [14, 4, 0.4162, 0.0009, 4, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data['token_expiry'] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L475_C4", "label": "retval = OAuth2Credentials()", "type": "assigned_variable", "loc": [475, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "vector": [14, 2, 0.4205, 0.0079, 2, 0.48, 0.6, 991, 3, 8, 0, 0, 494, 10, 2], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "OAuth2Credentials", "annotation": ""}, "snippet": " retval = OAuth2Credentials(\n data['access_token'],\n data['client_id'],\n data['client_secret'],\n data['refresh_token'],\n data['token_expiry'],\n data['token_uri'],\n data['user_agent'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L484_C4", "label": "retval.invalid =", "type": "assigned_variable", "loc": [484, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "vector": [14, 2, 0.4249, 0.0009, 2, 0.48, 0.8, 900, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.invalid = data['invalid']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L485_C4", "label": "return", "type": "return", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "vector": [13, 2, 0.4258, 0.0009, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "label": "access_token_expired", "type": "function", "loc": [488, 504], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4355, 0.0149, 1, 0.44, 0.4667, 722, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "access_token_expired", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def access_token_expired(self):\n \"\"\"True if the credential is expired or invalid.\n\n If the token_expiry isn't set, we assume the token doesn't expire.\n \"\"\"\n if self.invalid:\n return True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L489_C4", "label": "expression", "type": "expression", "loc": [489, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "vector": [8, 2, 0.4306, 0.0035, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"True if the credential is expired or invalid.\n\n If the token_expiry isn't set, we assume the token doesn't expire.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L493_C4", "label": "if", "type": "if", "loc": [493, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "vector": [4, 2, 0.4333, 0.0018, 2, 0.6, 0.2, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.invalid:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L494_C6", "label": "return", "type": "return", "loc": [494, 494], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L493_C4", "vector": [13, 3, 0.4337, 0.0009, 3, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L496_C4", "label": "if", "type": "if", "loc": [496, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "vector": [4, 2, 0.4359, 0.0018, 2, 0.6, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.token_expiry:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L497_C6", "label": "return", "type": "return", "loc": [497, 497], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L496_C4", "vector": [13, 3, 0.4363, 0.0009, 3, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L499_C4", "label": "now = utcnow()", "type": "assigned_variable", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "vector": [14, 2, 0.4381, 0.0009, 2, 0.6, 0.6, 894, 3, 0, 0, 0, 394, 10, 1], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "utcnow", "annotation": ""}, "snippet": " now = datetime.datetime.utcnow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L500_C4", "label": "if", "type": "if", "loc": [500, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "vector": [4, 2, 0.4403, 0.0035, 2, 0.6, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if now >= self.token_expiry:\n logger.info('access_token is expired. Now: %s, token_expiry: %s',\n now, self.token_expiry)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L501_C6", "label": "info()", "type": "expression", "loc": [501, 502], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L500_C4", "vector": [8, 3, 0.4403, 0.0018, 3, 0.26, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('access_token is expired. Now: %s, token_expiry: %s',\n now, self.token_expiry)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L503_C6", "label": "return", "type": "return", "loc": [503, 503], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L500_C4", "vector": [13, 3, 0.4416, 0.0009, 3, 0.26, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L504_C4", "label": "return", "type": "return", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "vector": [13, 2, 0.4425, 0.0009, 2, 0.6, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L506_C2", "label": "set_store", "type": "function", "loc": [506, 516], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4486, 0.0097, 1, 0.44, 0.5333, 939, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_store", "arg_names": ["self", "store"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_store(self, store):\n \"\"\"Set the Storage for the credential.\n\n Args:\n store: Storage, an implementation of Stroage object.\n This is needed to store the latest access_token if it\n has expired and been refreshed. This implementation uses\n locking to check for updates before updating the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L507_C4", "label": "expression", "type": "expression", "loc": [507, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L506_C2", "vector": [8, 2, 0.4486, 0.0079, 2, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set the Storage for the credential.\n\n Args:\n store: Storage, an implementation of Stroage object.\n This is needed to store the latest access_token if it\n has expired and been refreshed. This implementation uses\n locking to check for updates before updating the\n access_token."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L516_C4", "label": "self.store =", "type": "assigned_variable", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L506_C2", "vector": [14, 2, 0.453, 0.0009, 2, 0.16, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = store"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L518_C2", "label": "_updateFromCredential", "type": "function", "loc": [518, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4557, 0.0026, 1, 0.44, 0.6, 49, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_updateFromCredential", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _updateFromCredential(self, other):\n \"\"\"Update this Credential from another instance.\"\"\"\n self.__dict__.update(other.__getstate__())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L519_C4", "label": "expression", "type": "expression", "loc": [519, 519], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L518_C2", "vector": [8, 2, 0.4557, 0.0009, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Update this Credential from another instance.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L520_C4", "label": "update()", "type": "expression", "loc": [520, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L518_C2", "vector": [8, 2, 0.4565, 0.0009, 2, 0.49, 1.0, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(other.__getstate__())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "label": "__getstate__", "type": "function", "loc": [522, 526], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4601, 0.0044, 1, 0.44, 0.6667, 250, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n \"\"\"Trim the state down to something that can be pickled.\"\"\"\n d = copy.copy(self.__dict__)\n del d['store']\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L523_C4", "label": "expression", "type": "expression", "loc": [523, 523], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "vector": [8, 2, 0.4592, 0.0009, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Trim the state down to something that can be pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L524_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "vector": [14, 2, 0.4601, 0.0009, 2, 0.96, 0.5, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L526_C4", "label": "return", "type": "return", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "vector": [13, 2, 0.4618, 0.0009, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "label": "__setstate__", "type": "function", "loc": [528, 531], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4649, 0.0035, 1, 0.44, 0.7333, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setstate__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, state):\n \"\"\"Reconstitute the state of the object from being pickled.\"\"\"\n self.__dict__.update(state)\n self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L529_C4", "label": "expression", "type": "expression", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "vector": [8, 2, 0.4644, 0.0009, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reconstitute the state of the object from being pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L530_C4", "label": "update()", "type": "expression", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "vector": [8, 2, 0.4653, 0.0009, 2, 0.65, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L531_C4", "label": "self.store =", "type": "assigned_variable", "loc": [531, 531], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "vector": [14, 2, 0.4662, 0.0009, 2, 0.65, 1.0, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "label": "_generate_refresh_request_body", "type": "function", "loc": [533, 541], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4715, 0.0079, 1, 0.44, 0.8, 776, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_generate_refresh_request_body", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_refresh_request_body(self):\n \"\"\"Generate the body that will be used in the refresh request.\"\"\"\n body = urllib.urlencode({\n 'grant_type': 'refresh_token',\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'refresh_token': self.refresh_token,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L534_C4", "label": "expression", "type": "expression", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "vector": [8, 2, 0.4688, 0.0009, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the body that will be used in the refresh request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L535_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [535, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "vector": [14, 2, 0.4719, 0.0053, 2, 0.27, 0.5, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({\n 'grant_type': 'refresh_token',\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'refresh_token': self.refresh_token,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L541_C4", "label": "return", "type": "return", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "vector": [13, 2, 0.475, 0.0009, 2, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "label": "_generate_refresh_request_headers", "type": "function", "loc": [543, 552], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4807, 0.0088, 1, 0.44, 0.8667, 498, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_generate_refresh_request_headers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_refresh_request_headers(self):\n \"\"\"Generate the headers that will be used in the refresh request.\"\"\"\n headers = {\n 'content-type': 'application/x-www-form-urlencoded',\n }\n\n if self.user_agent is not None:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L544_C4", "label": "expression", "type": "expression", "loc": [544, 544], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "vector": [8, 2, 0.4776, 0.0009, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the headers that will be used in the refresh request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L545_C4", "label": "headers =", "type": "assigned_variable", "loc": [545, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "vector": [14, 2, 0.4794, 0.0026, 2, 0.71, 0.3333, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'content-type': 'application/x-www-form-urlencoded',\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L549_C4", "label": "if", "type": "if", "loc": [549, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "vector": [4, 2, 0.4824, 0.0018, 2, 0.71, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.user_agent is not None:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L550_C6", "label": "assign", "type": "assigned_variable", "loc": [550, 550], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L549_C4", "vector": [14, 3, 0.4829, 0.0009, 3, 0.45, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L552_C4", "label": "return", "type": "return", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "vector": [13, 2, 0.4846, 0.0009, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return headers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L554_C2", "label": "_refresh", "type": "function", "loc": [554, 581], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.4982, 0.0246, 1, 0.44, 0.9333, 770, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "_refresh", "arg_names": ["self", "http_request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _refresh(self, http_request):\n \"\"\"Refreshes the access_token.\n\n This method first checks by reading the Storage object if available.\n If a refresh is still needed, it holds the Storage lock until the\n refresh is completed.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L555_C4", "label": "expression", "type": "expression", "loc": [555, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L554_C2", "vector": [8, 2, 0.4925, 0.0114, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Refreshes the access_token.\n\n This method first checks by reading the Storage object if available.\n If a refresh is still needed, it holds the Storage lock until the\n refresh is completed.\n\n Args:\n http_request: callable, a callable that matches the method signature of"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "label": "if", "type": "if", "loc": [568, 581], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L554_C2", "vector": [4, 2, 0.5044, 0.0123, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.store:\n self._do_refresh_request(http_request)\n else:\n self.store.acquire_lock()\n try:\n new_cred = self.store.locked_get()\n if (new_cred and not new_cred.invalid and\n new_cred.access_token != self.access_token):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L569_C6", "label": "_do_refresh_request()", "type": "expression", "loc": [569, 569], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "vector": [8, 3, 0.4996, 0.0009, 3, 0.35, 0.0, 85, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_do_refresh_request", "arg_names": [], "import_names": [], "rhs_call_name": "_do_refresh_request", "annotation": ""}, "snippet": " self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L571_C6", "label": "acquire_lock()", "type": "expression", "loc": [571, 571], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "vector": [8, 3, 0.5013, 0.0009, 3, 0.35, 0.5, 5, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": [], "import_names": [], "rhs_call_name": "acquire_lock", "annotation": ""}, "snippet": " self.store.acquire_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "label": "try", "type": "try", "loc": [572, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "vector": [7, 3, 0.5061, 0.0088, 3, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n new_cred = self.store.locked_get()\n if (new_cred and not new_cred.invalid and\n new_cred.access_token != self.access_token):\n logger.info('Updated access_token read from Storage')\n self._updateFromCredential(new_cred)\n else:\n self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L573_C8", "label": "new_cred = locked_get()", "type": "assigned_variable", "loc": [573, 573], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "vector": [14, 4, 0.5031, 0.0009, 4, 0.22, 0.0, 572, 3, 0, 0, 0, 579, 10, 1], "semantic": {"name": "new_cred", "arg_names": [], "import_names": [], "rhs_call_name": "locked_get", "annotation": ""}, "snippet": " new_cred = self.store.locked_get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "label": "if", "type": "if", "loc": [574, 579], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "vector": [4, 4, 0.5061, 0.0053, 4, 0.22, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (new_cred and not new_cred.invalid and\n new_cred.access_token != self.access_token):\n logger.info('Updated access_token read from Storage')\n self._updateFromCredential(new_cred)\n else:\n self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L576_C10", "label": "info()", "type": "expression", "loc": [576, 576], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "vector": [8, 5, 0.5057, 0.0009, 5, 0.78, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Updated access_token read from Storage')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L577_C10", "label": "_updateFromCredential()", "type": "expression", "loc": [577, 577], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "vector": [8, 5, 0.5066, 0.0009, 5, 0.78, 0.5, 49, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_updateFromCredential", "arg_names": [], "import_names": [], "rhs_call_name": "_updateFromCredential", "annotation": ""}, "snippet": " self._updateFromCredential(new_cred)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L579_C10", "label": "_do_refresh_request()", "type": "expression", "loc": [579, 579], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "vector": [8, 5, 0.5083, 0.0009, 5, 0.78, 1.0, 85, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_do_refresh_request", "arg_names": [], "import_names": [], "rhs_call_name": "_do_refresh_request", "annotation": ""}, "snippet": " self._do_refresh_request(http_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L581_C8", "label": "release_lock()", "type": "expression", "loc": [581, 581], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "vector": [8, 4, 0.5101, 0.0009, 4, 0.22, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": [], "import_names": [], "rhs_call_name": "release_lock", "annotation": ""}, "snippet": " self.store.release_lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "label": "_do_refresh_request", "type": "function", "loc": [583, 625], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "vector": [2, 1, 0.5303, 0.0378, 1, 0.44, 1.0, 85, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "_do_refresh_request", "arg_names": ["self", "http_request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _do_refresh_request(self, http_request):\n \"\"\"Refresh the access_token using the refresh_token.\n\n Args:\n http_request: callable, a callable that matches the method signature of\n httplib2.Http.request, used to make the refresh request.\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L584_C4", "label": "expression", "type": "expression", "loc": [584, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "vector": [8, 2, 0.5162, 0.0079, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Refresh the access_token using the refresh_token.\n\n Args:\n http_request: callable, a callable that matches the method signature of\n httplib2.Http.request, used to make the refresh request.\n\n Raises:\n AccessTokenRefreshError: When the refresh fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L593_C4", "label": "body = _generate_refresh_request_body()", "type": "assigned_variable", "loc": [593, 593], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "vector": [14, 2, 0.5206, 0.0009, 2, 0.25, 0.2, 477, 3, 0, 0, 0, 776, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "_generate_refresh_request_body", "annotation": ""}, "snippet": " body = self._generate_refresh_request_body()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L594_C4", "label": "headers = _generate_refresh_request_headers()", "type": "assigned_variable", "loc": [594, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "vector": [14, 2, 0.5215, 0.0009, 2, 0.25, 0.4, 950, 3, 0, 0, 0, 498, 10, 1], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "_generate_refresh_request_headers", "annotation": ""}, "snippet": " headers = self._generate_refresh_request_headers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L596_C4", "label": "info()", "type": "expression", "loc": [596, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "vector": [8, 2, 0.5233, 0.0009, 2, 0.25, 0.6, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Refreshing access_token')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L597_C4", "label": "resp, content = http_request()", "type": "assigned_variable", "loc": [597, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "vector": [14, 2, 0.5246, 0.0018, 2, 0.25, 0.8, 339, 3, 4, 0, 0, 29, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "http_request", "annotation": ""}, "snippet": " resp, content = http_request(\n self.token_uri, method='POST', body=body, headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "label": "if", "type": "if", "loc": [599, 625], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "vector": [4, 2, 0.5373, 0.0237, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 200:\n # TODO(jcgregorio) Raise an error if loads fails?\n d = simplejson.loads(content)\n self.access_token = d['access_token']\n self.refresh_token = d.get('refresh_token', self.refresh_token)\n if 'expires_in' in d:\n self.token_expiry = datetime.timedelta(\n seconds=int(d['expires_in'])) + datetime.datetime.utcnow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L601_C6", "label": "d = loads()", "type": "assigned_variable", "loc": [601, 601], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [14, 3, 0.5277, 0.0009, 3, 0.11, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L602_C6", "label": "self.access_token =", "type": "assigned_variable", "loc": [602, 602], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [14, 3, 0.5285, 0.0009, 3, 0.11, 0.1429, 909, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.access_token = d['access_token']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L603_C6", "label": "self.refresh_token = get()", "type": "assigned_variable", "loc": [603, 603], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [14, 3, 0.5294, 0.0009, 3, 0.11, 0.2857, 920, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.refresh_token", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.refresh_token = d.get('refresh_token', self.refresh_token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L604_C6", "label": "if", "type": "if", "loc": [604, 608], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [4, 3, 0.532, 0.0044, 3, 0.11, 0.4286, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'expires_in' in d:\n self.token_expiry = datetime.timedelta(\n seconds=int(d['expires_in'])) + datetime.datetime.utcnow()\n else:\n self.token_expiry = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L605_C8", "label": "self.token_expiry =", "type": "assigned_variable", "loc": [605, 606], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L604_C6", "vector": [14, 4, 0.5316, 0.0018, 4, 0.13, 0.0, 327, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "self.token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_expiry = datetime.timedelta(\n seconds=int(d['expires_in'])) + datetime.datetime.utcnow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L608_C8", "label": "self.token_expiry =", "type": "assigned_variable", "loc": [608, 608], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L604_C6", "vector": [14, 4, 0.5338, 0.0009, 4, 0.13, 1.0, 327, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_expiry = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L609_C6", "label": "if", "type": "if", "loc": [609, 610], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [4, 3, 0.5351, 0.0018, 3, 0.11, 0.5714, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.store:\n self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L610_C8", "label": "locked_put()", "type": "expression", "loc": [610, 610], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L609_C6", "vector": [8, 4, 0.5356, 0.0009, 4, 0.76, 0.0, 154, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": [], "import_names": [], "rhs_call_name": "locked_put", "annotation": ""}, "snippet": " self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L614_C6", "label": "info()", "type": "expression", "loc": [614, 614], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [8, 3, 0.5391, 0.0009, 3, 0.11, 0.7143, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Failed to retrieve access token: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L615_C6", "label": "error_msg =", "type": "assigned_variable", "loc": [615, 615], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [14, 3, 0.5399, 0.0009, 3, 0.11, 0.8571, 503, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = 'Invalid response %s.' % resp['status']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L616_C6", "label": "try", "type": "try", "loc": [616, 624], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "vector": [7, 3, 0.5443, 0.0079, 3, 0.11, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n d = simplejson.loads(content)\n if 'error' in d:\n error_msg = d['error']\n self.invalid = True\n if self.store:\n self.store.locked_put(self)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L617_C8", "label": "d = loads()", "type": "assigned_variable", "loc": [617, 617], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L616_C6", "vector": [14, 4, 0.5417, 0.0009, 4, 0.99, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "label": "if", "type": "if", "loc": [618, 622], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L616_C6", "vector": [4, 4, 0.5443, 0.0044, 4, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'error' in d:\n error_msg = d['error']\n self.invalid = True\n if self.store:\n self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L619_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [619, 619], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "vector": [14, 5, 0.5435, 0.0009, 5, 0.5, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = d['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L620_C10", "label": "self.invalid =", "type": "assigned_variable", "loc": [620, 620], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "vector": [14, 5, 0.5443, 0.0009, 5, 0.5, 0.5, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.invalid = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L621_C10", "label": "if", "type": "if", "loc": [621, 622], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "vector": [4, 5, 0.5457, 0.0018, 5, 0.5, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.store:\n self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L622_C12", "label": "locked_put()", "type": "expression", "loc": [622, 622], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L621_C10", "vector": [8, 6, 0.5461, 0.0009, 6, 0.51, 0.0, 154, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_put", "arg_names": [], "import_names": [], "rhs_call_name": "locked_put", "annotation": ""}, "snippet": " self.store.locked_put(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "label": "AccessTokenCredentials", "type": "class", "loc": [628, 687], "level": 0, "parent": null, "vector": [3, 0, 0.5773, 0.0527, 0, 0.66, 0.8049, 260, 0, 3, 0, 0, 494, 0, 5], "semantic": {"name": "AccessTokenCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccessTokenCredentials(OAuth2Credentials):\n \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the\n authorize() method, which then signs each request from that object\n with the OAuth 2.0 access token. This set of credentials is for the\n use case where you have acquired an OAuth 2.0 access_token from\n another place such as a JavaScript client or another web"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L629_C2", "label": "expression", "type": "expression", "loc": [629, 651], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "vector": [8, 1, 0.5619, 0.0202, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object for OAuth 2.0.\n\n Credentials can be applied to an httplib2.Http object using the\n authorize() method, which then signs each request from that object\n with the OAuth 2.0 access token. This set of credentials is for the\n use case where you have acquired an OAuth 2.0 access_token from\n another place such as a JavaScript client or another web\n application, and wish to use it from Python. Because only the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L653_C2", "label": "__init__", "type": "function", "loc": [653, 674], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "vector": [2, 1, 0.5825, 0.0193, 1, 0.89, 0.3333, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "access_token", "user_agent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, access_token, user_agent):\n \"\"\"Create an instance of OAuth2Credentials\n\n This is one of the few types if Credentials that you should contrust,\n Credentials objects are usually instantiated by a Flow.\n\n Args:\n access_token: string, access token."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L654_C4", "label": "expression", "type": "expression", "loc": [654, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L653_C2", "vector": [8, 2, 0.5795, 0.0114, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an instance of OAuth2Credentials\n\n This is one of the few types if Credentials that you should contrust,\n Credentials objects are usually instantiated by a Flow.\n\n Args:\n access_token: string, access token.\n user_agent: string, The HTTP User-Agent to provide for this application."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L667_C4", "label": "__init__()", "type": "expression", "loc": [667, 674], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L653_C2", "vector": [8, 2, 0.5887, 0.007, 2, 0.35, 1.0, 555, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(AccessTokenCredentials, self).__init__(\n access_token,\n None,\n None,\n None,\n None,\n None,\n user_agent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "label": "from_json", "type": "function", "loc": [678, 683], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "vector": [2, 1, 0.5975, 0.0053, 1, 0.89, 0.6667, 975, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n data = simplejson.loads(s)\n retval = AccessTokenCredentials(\n data['access_token'],\n data['user_agent'])\n return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L679_C4", "label": "data = loads()", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "vector": [14, 2, 0.5961, 0.0009, 2, 0.81, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L680_C4", "label": "retval = AccessTokenCredentials()", "type": "assigned_variable", "loc": [680, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "vector": [14, 2, 0.5979, 0.0026, 2, 0.81, 0.5, 991, 3, 2, 0, 0, 260, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "AccessTokenCredentials", "annotation": ""}, "snippet": " retval = AccessTokenCredentials(\n data['access_token'],\n data['user_agent'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L683_C4", "label": "return", "type": "return", "loc": [683, 683], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "vector": [13, 2, 0.5996, 0.0009, 2, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L685_C2", "label": "_refresh", "type": "function", "loc": [685, 687], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "vector": [2, 1, 0.6023, 0.0026, 1, 0.89, 1.0, 770, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_refresh", "arg_names": ["self", "http_request"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _refresh(self, http_request):\n raise AccessTokenCredentialsError(\n \"The access_token is expired or invalid and can't be refreshed.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "label": "AssertionCredentials", "type": "class", "loc": [690, 738], "level": 0, "parent": null, "vector": [3, 0, 0.6269, 0.043, 0, 0.66, 0.8293, 563, 0, 3, 0, 0, 494, 0, 5], "semantic": {"name": "AssertionCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AssertionCredentials(OAuth2Credentials):\n \"\"\"Abstract Credentials object used for OAuth 2.0 assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens. It must\n be subclassed to generate the appropriate assertion string.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L691_C2", "label": "expression", "type": "expression", "loc": [691, 699], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "vector": [8, 1, 0.6102, 0.0079, 1, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Abstract Credentials object used for OAuth 2.0 assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens. It must\n be subclassed to generate the appropriate assertion string.\n\n AssertionCredentials objects may be safely pickled and unpickled."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "label": "__init__", "type": "function", "loc": [701, 721], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "vector": [2, 1, 0.6242, 0.0184, 1, 0.76, 0.3333, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "assertion_type", "user_agent", "token_uri", "unused_kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, assertion_type, user_agent,\n token_uri='https://accounts.google.com/o/oauth2/token',\n **unused_kwargs):\n \"\"\"Constructor for AssertionFlowCredentials.\n\n Args:\n assertion_type: string, assertion type that will be declared to the auth\n server"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L704_C4", "label": "expression", "type": "expression", "loc": [704, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "vector": [8, 2, 0.6216, 0.0079, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for AssertionFlowCredentials.\n\n Args:\n assertion_type: string, assertion type that will be declared to the auth\n server\n user_agent: string, The HTTP User-Agent to provide for this application.\n token_uri: string, URI for token endpoint. For convenience\n defaults to Google's endpoints but any OAuth 2.0 provider can be used."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L713_C4", "label": "__init__()", "type": "expression", "loc": [713, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "vector": [8, 2, 0.6291, 0.007, 2, 0.18, 0.5, 555, 3, 7, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(AssertionCredentials, self).__init__(\n None,\n None,\n None,\n None,\n None,\n token_uri,\n user_agent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L721_C4", "label": "self.assertion_type =", "type": "assigned_variable", "loc": [721, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "vector": [14, 2, 0.633, 0.0009, 2, 0.18, 1.0, 298, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.assertion_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.assertion_type = assertion_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "label": "_generate_refresh_request_body", "type": "function", "loc": [723, 732], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "vector": [2, 1, 0.6387, 0.0088, 1, 0.76, 0.6667, 776, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_generate_refresh_request_body", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_refresh_request_body(self):\n assertion = self._generate_assertion()\n\n body = urllib.urlencode({\n 'assertion_type': self.assertion_type,\n 'assertion': assertion,\n 'grant_type': 'assertion',\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L724_C4", "label": "assertion = _generate_assertion()", "type": "assigned_variable", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "vector": [14, 2, 0.6356, 0.0009, 2, 0.39, 0.0, 238, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "assertion", "arg_names": [], "import_names": [], "rhs_call_name": "_generate_assertion", "annotation": ""}, "snippet": " assertion = self._generate_assertion()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L726_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [726, 730], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "vector": [14, 2, 0.6392, 0.0044, 2, 0.39, 0.5, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({\n 'assertion_type': self.assertion_type,\n 'assertion': assertion,\n 'grant_type': 'assertion',\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L732_C4", "label": "return", "type": "return", "loc": [732, 732], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "vector": [13, 2, 0.6427, 0.0009, 2, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L734_C2", "label": "_generate_assertion", "type": "function", "loc": [734, 738], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "vector": [2, 1, 0.6462, 0.0044, 1, 0.76, 1.0, 768, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_generate_assertion", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_assertion(self):\n \"\"\"Generate the assertion string that will be used in the access token\n request.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L735_C4", "label": "expression", "type": "expression", "loc": [735, 737], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L734_C2", "vector": [8, 2, 0.6462, 0.0026, 2, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the assertion string that will be used in the access token\n request.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L738_C4", "label": "_abstract()", "type": "expression", "loc": [738, 738], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L734_C2", "vector": [8, 2, 0.6479, 0.0009, 2, 0.03, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "label": "if", "type": "if", "loc": [740, 855], "level": 0, "parent": null, "vector": [4, 0, 0.7002, 0.1018, 0, 0.66, 0.8537, 0, 2, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if HAS_OPENSSL:\n # PyOpenSSL is not a prerequisite for oauth2client, so if it is missing then\n # don't create the SignedJwtAssertionCredentials or the verify_id_token()\n # method.\n\n class SignedJwtAssertionCredentials(AssertionCredentials):\n \"\"\"Credentials object used for OAuth 2.0 Signed JWT assertion grants.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "label": "SignedJwtAssertionCredentials", "type": "class", "loc": [745, 822], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "vector": [3, 1, 0.6879, 0.0685, 1, 0.89, 0.0, 41, 0, 3, 0, 0, 563, 0, 13], "semantic": {"name": "SignedJwtAssertionCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class SignedJwtAssertionCredentials(AssertionCredentials):\n \"\"\"Credentials object used for OAuth 2.0 Signed JWT assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L746_C4", "label": "expression", "type": "expression", "loc": [746, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "vector": [8, 2, 0.6572, 0.0053, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object used for OAuth 2.0 Signed JWT assertion grants.\n\n This credential does not require a flow to instantiate because it\n represents a two legged flow, and therefore has all of the required\n information to generate and refresh its own access tokens.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L753_C4", "label": "MAX_TOKEN_LIFETIME_SECS =", "type": "assigned_variable", "loc": [753, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "vector": [14, 2, 0.6611, 0.0009, 2, 0.8, 0.25, 88, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_TOKEN_LIFETIME_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " MAX_TOKEN_LIFETIME_SECS = 3600 # 1 hour in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "label": "__init__", "type": "function", "loc": [755, 790], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "vector": [2, 2, 0.6782, 0.0316, 2, 0.8, 0.5, 555, 0, 8, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "service_account_name", "private_key", "scope", "private_key_password", "user_agent", "token_uri", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self,\n service_account_name,\n private_key,\n scope,\n private_key_password='notasecret',\n user_agent=None,\n token_uri='https://accounts.google.com/o/oauth2/token',\n **kwargs):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L763_C6", "label": "expression", "type": "expression", "loc": [763, 775], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [8, 3, 0.6752, 0.0114, 3, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for SignedJwtAssertionCredentials.\n\n Args:\n service_account_name: string, id for account, usually an email address.\n private_key: string, private key in P12 format.\n scope: string or list of strings, scope(s) of the credentials being\n requested.\n private_key_password: string, password for private_key."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L777_C6", "label": "__init__()", "type": "expression", "loc": [777, 781], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [8, 3, 0.6839, 0.0044, 3, 0.29, 0.1429, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(SignedJwtAssertionCredentials, self).__init__(\n 'http://oauth.net/grant_type/jwt/1.0/bearer',\n user_agent,\n token_uri=token_uri,\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L783_C6", "label": "if", "type": "if", "loc": [783, 784], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [4, 3, 0.6879, 0.0018, 3, 0.29, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(scope) is list:\n scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L784_C8", "label": "scope = join()", "type": "assigned_variable", "loc": [784, 784], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L783_C6", "vector": [14, 4, 0.6883, 0.0009, 4, 0.91, 0.0, 334, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L785_C6", "label": "self.scope =", "type": "assigned_variable", "loc": [785, 785], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [14, 3, 0.6892, 0.0009, 3, 0.29, 0.4286, 550, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L787_C6", "label": "self.private_key =", "type": "assigned_variable", "loc": [787, 787], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [14, 3, 0.691, 0.0009, 3, 0.29, 0.5714, 91, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.private_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.private_key = private_key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L788_C6", "label": "self.private_key_password =", "type": "assigned_variable", "loc": [788, 788], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [14, 3, 0.6918, 0.0009, 3, 0.29, 0.7143, 751, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.private_key_password", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.private_key_password = private_key_password"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L789_C6", "label": "self.service_account_name =", "type": "assigned_variable", "loc": [789, 789], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [14, 3, 0.6927, 0.0009, 3, 0.29, 0.8571, 976, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.service_account_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.service_account_name = service_account_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L790_C6", "label": "self.kwargs =", "type": "assigned_variable", "loc": [790, 790], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "vector": [14, 3, 0.6936, 0.0009, 3, 0.29, 1.0, 790, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.kwargs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kwargs = kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "label": "from_json", "type": "function", "loc": [793, 805], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "vector": [2, 2, 0.7015, 0.0114, 2, 0.8, 0.75, 975, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "from_json", "arg_names": ["cls", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_json(cls, s):\n data = simplejson.loads(s)\n retval = SignedJwtAssertionCredentials(\n data['service_account_name'],\n data['private_key'],\n data['private_key_password'],\n data['scope'],\n data['user_agent'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L794_C6", "label": "data = loads()", "type": "assigned_variable", "loc": [794, 794], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "vector": [14, 3, 0.6971, 0.0009, 3, 0.36, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L795_C6", "label": "retval = SignedJwtAssertionCredentials()", "type": "assigned_variable", "loc": [795, 803], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "vector": [14, 3, 0.7015, 0.0079, 3, 0.36, 0.3333, 991, 3, 7, 0, 0, 41, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "SignedJwtAssertionCredentials", "annotation": ""}, "snippet": " retval = SignedJwtAssertionCredentials(\n data['service_account_name'],\n data['private_key'],\n data['private_key_password'],\n data['scope'],\n data['user_agent'],\n data['token_uri'],\n data['kwargs']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L804_C6", "label": "retval.invalid =", "type": "assigned_variable", "loc": [804, 804], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "vector": [14, 3, 0.7059, 0.0009, 3, 0.36, 0.6667, 900, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval.invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval.invalid = data['invalid']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L805_C6", "label": "return", "type": "return", "loc": [805, 805], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "vector": [13, 3, 0.7068, 0.0009, 3, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "label": "_generate_assertion", "type": "function", "loc": [807, 822], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "vector": [2, 2, 0.7151, 0.014, 2, 0.8, 1.0, 768, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_generate_assertion", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _generate_assertion(self):\n \"\"\"Generate the assertion that will be used in the request.\"\"\"\n now = long(time.time())\n payload = {\n 'aud': self.token_uri,\n 'scope': self.scope,\n 'iat': now,\n 'exp': now + SignedJwtAssertionCredentials.MAX_TOKEN_LIFETIME_SECS,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L808_C6", "label": "expression", "type": "expression", "loc": [808, 808], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "vector": [8, 3, 0.7094, 0.0009, 3, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generate the assertion that will be used in the request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L809_C6", "label": "now = long()", "type": "assigned_variable", "loc": [809, 809], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "vector": [14, 3, 0.7103, 0.0009, 3, 0.69, 0.2, 894, 3, 1, 0, 0, 37, 10, 2], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "long", "annotation": ""}, "snippet": " now = long(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L810_C6", "label": "payload =", "type": "assigned_variable", "loc": [810, 816], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "vector": [14, 3, 0.7138, 0.0061, 3, 0.69, 0.4, 271, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "payload", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " payload = {\n 'aud': self.token_uri,\n 'scope': self.scope,\n 'iat': now,\n 'exp': now + SignedJwtAssertionCredentials.MAX_TOKEN_LIFETIME_SECS,\n 'iss': self.service_account_name\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L817_C6", "label": "update()", "type": "expression", "loc": [817, 817], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "vector": [8, 3, 0.7173, 0.0009, 3, 0.69, 0.6, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " payload.update(self.kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L818_C6", "label": "debug()", "type": "expression", "loc": [818, 818], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "vector": [8, 3, 0.7182, 0.0009, 3, 0.69, 0.8, 924, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logger.debug(str(payload))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L820_C6", "label": "return", "type": "return", "loc": [820, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "vector": [13, 3, 0.7208, 0.0026, 3, 0.69, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return make_signed_jwt(\n Signer.from_string(self.private_key, self.private_key_password),\n payload)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L826_C2", "label": "_cached_http = Http()", "type": "assigned_variable", "loc": [826, 826], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "vector": [14, 1, 0.7252, 0.0009, 1, 0.89, 0.5, 258, 3, 1, 0, 0, 967, 10, 2], "semantic": {"name": "_cached_http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " _cached_http = httplib2.Http(MemoryCache())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "label": "verify_id_token", "type": "function", "loc": [828, 855], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "vector": [2, 1, 0.7388, 0.0246, 1, 0.89, 1.0, 749, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "verify_id_token", "arg_names": ["id_token", "audience", "http", "cert_uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verify_id_token(id_token, audience, http=None,\n cert_uri=ID_TOKEN_VERIFICATON_CERTS):\n \"\"\"Verifies a signed JWT id_token.\n\n Args:\n id_token: string, A Signed JWT.\n audience: string, The audience 'aud' that the token should be for.\n http: httplib2.Http, instance to use to make the HTTP request. Callers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L830_C4", "label": "expression", "type": "expression", "loc": [830, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "vector": [8, 2, 0.7353, 0.014, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies a signed JWT id_token.\n\n Args:\n id_token: string, A Signed JWT.\n audience: string, The audience 'aud' that the token should be for.\n http: httplib2.Http, instance to use to make the HTTP request. Callers\n should supply an instance that has caching enabled.\n cert_uri: string, URI of the certificates in JSON format to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L846_C4", "label": "if", "type": "if", "loc": [846, 847], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "vector": [4, 2, 0.7432, 0.0018, 2, 0.75, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if http is None:\n http = _cached_http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L847_C6", "label": "http =", "type": "assigned_variable", "loc": [847, 847], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L846_C4", "vector": [14, 3, 0.7436, 0.0009, 3, 0.31, 0.0, 415, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http = _cached_http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L849_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [849, 849], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "vector": [14, 2, 0.7454, 0.0009, 2, 0.75, 0.6667, 339, 3, 1, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = http.request(cert_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L851_C4", "label": "if", "type": "if", "loc": [851, 855], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "vector": [4, 2, 0.7489, 0.0044, 2, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 200:\n certs = simplejson.loads(content)\n return verify_signed_jwt_with_certs(id_token, certs, audience)\n else:\n raise VerifyJwtTokenError('Status code: %d' % resp.status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L852_C6", "label": "certs = loads()", "type": "assigned_variable", "loc": [852, 852], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L851_C4", "vector": [14, 3, 0.748, 0.0009, 3, 0.99, 0.0, 10, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "certs", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " certs = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L853_C6", "label": "return", "type": "return", "loc": [853, 853], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L851_C4", "vector": [13, 3, 0.7489, 0.0009, 3, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return verify_signed_jwt_with_certs(id_token, certs, audience)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "label": "_urlsafe_b64decode", "type": "function", "loc": [858, 862], "level": 0, "parent": null, "vector": [2, 0, 0.755, 0.0044, 0, 0.66, 0.878, 388, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_urlsafe_b64decode", "arg_names": ["b64string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _urlsafe_b64decode(b64string):\n # Guard against unicode strings, which base64 can't handle.\n b64string = b64string.encode('ascii')\n padded = b64string + '=' * (4 - len(b64string) % 4)\n return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L860_C2", "label": "b64string = encode()", "type": "assigned_variable", "loc": [860, 860], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "vector": [14, 1, 0.755, 0.0009, 1, 0.25, 0.0, 502, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "b64string", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " b64string = b64string.encode('ascii')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L861_C2", "label": "padded =", "type": "assigned_variable", "loc": [861, 861], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "vector": [14, 1, 0.7559, 0.0009, 1, 0.25, 0.5, 54, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "padded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " padded = b64string + '=' * (4 - len(b64string) % 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L862_C2", "label": "return", "type": "return", "loc": [862, 862], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "vector": [13, 1, 0.7568, 0.0009, 1, 0.25, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "label": "_extract_id_token", "type": "function", "loc": [865, 882], "level": 0, "parent": null, "vector": [2, 0, 0.7669, 0.0158, 0, 0.66, 0.9024, 179, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "_extract_id_token", "arg_names": ["id_token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _extract_id_token(id_token):\n \"\"\"Extract the JSON payload from a JWT.\n\n Does the extraction w/o checking the signature.\n\n Args:\n id_token: string, OAuth 2.0 id_token.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L866_C2", "label": "expression", "type": "expression", "loc": [866, 875], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "vector": [8, 1, 0.7643, 0.0088, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Extract the JSON payload from a JWT.\n\n Does the extraction w/o checking the signature.\n\n Args:\n id_token: string, OAuth 2.0 id_token.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L876_C2", "label": "segments = split()", "type": "assigned_variable", "loc": [876, 876], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "vector": [14, 1, 0.7691, 0.0009, 1, 0.77, 0.3333, 185, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "segments", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " segments = id_token.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L878_C2", "label": "if", "type": "if", "loc": [878, 880], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "vector": [4, 1, 0.7717, 0.0026, 1, 0.77, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(segments) != 3):\n raise VerifyJwtTokenError(\n 'Wrong number of segments in token: %s' % id_token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L882_C2", "label": "return", "type": "return", "loc": [882, 882], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "vector": [13, 1, 0.7744, 0.0009, 1, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.loads(_urlsafe_b64decode(segments[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "label": "credentials_from_code", "type": "function", "loc": [884, 915], "level": 0, "parent": null, "vector": [2, 0, 0.7897, 0.0281, 0, 0.66, 0.9268, 622, 0, 8, 1, 0, 0, 0, 3], "semantic": {"name": "credentials_from_code", "arg_names": ["client_id", "client_secret", "scope", "code", "redirect_uri", "http", "user_agent", "token_uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def credentials_from_code(client_id, client_secret, scope, code,\n redirect_uri = 'postmessage',\n http=None, user_agent=None,\n token_uri='https://accounts.google.com/o/oauth2/token'):\n \"\"\"Exchanges an authorization code for an OAuth2Credentials object.\n\n Args:\n client_id: string, client identifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L888_C2", "label": "expression", "type": "expression", "loc": [888, 907], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "vector": [8, 1, 0.788, 0.0176, 1, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exchanges an authorization code for an OAuth2Credentials object.\n\n Args:\n client_id: string, client identifier.\n client_secret: string, client secret.\n scope: string or list of strings, scope(s) to request.\n code: string, An authroization code, most likely passed down from\n the client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L908_C2", "label": "flow = OAuth2WebServerFlow()", "type": "assigned_variable", "loc": [908, 910], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "vector": [14, 1, 0.7981, 0.0026, 1, 0.07, 0.25, 258, 3, 6, 0, 0, 875, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "OAuth2WebServerFlow", "annotation": ""}, "snippet": " flow = OAuth2WebServerFlow(client_id, client_secret, scope, user_agent,\n 'https://accounts.google.com/o/oauth2/auth',\n token_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L913_C2", "label": "uriThatWeDontReallyUse = step1_get_authorize_url()", "type": "assigned_variable", "loc": [913, 913], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "vector": [14, 1, 0.8016, 0.0009, 1, 0.07, 0.5, 774, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uriThatWeDontReallyUse", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L914_C2", "label": "credentials = step2_exchange()", "type": "assigned_variable", "loc": [914, 914], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "vector": [14, 1, 0.8025, 0.0009, 1, 0.07, 0.75, 198, 3, 2, 0, 0, 471, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " credentials = flow.step2_exchange(code, http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L915_C2", "label": "return", "type": "return", "loc": [915, 915], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "vector": [13, 1, 0.8033, 0.0009, 1, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "label": "credentials_from_clientsecrets_and_code", "type": "function", "loc": [918, 954], "level": 0, "parent": null, "vector": [2, 0, 0.8218, 0.0325, 0, 0.66, 0.9512, 790, 0, 6, 1, 0, 0, 0, 3], "semantic": {"name": "credentials_from_clientsecrets_and_code", "arg_names": ["filename", "scope", "code", "message", "redirect_uri", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def credentials_from_clientsecrets_and_code(filename, scope, code,\n message = None,\n redirect_uri = 'postmessage',\n http=None):\n \"\"\"Returns OAuth2Credentials from a clientsecrets file and an auth code.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L922_C2", "label": "expression", "type": "expression", "loc": [922, 949], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "vector": [8, 1, 0.8213, 0.0246, 1, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns OAuth2Credentials from a clientsecrets file and an auth code.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows.\n\n Args:\n filename: string, File name of clientsecrets.\n scope: string or list of strings, scope(s) to request."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L950_C2", "label": "flow = flow_from_clientsecrets()", "type": "assigned_variable", "loc": [950, 950], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "vector": [14, 1, 0.8341, 0.0009, 1, 0.57, 0.25, 258, 3, 3, 0, 0, 355, 10, 1], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "flow_from_clientsecrets", "annotation": ""}, "snippet": " flow = flow_from_clientsecrets(filename, scope, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L952_C2", "label": "uriThatWeDontReallyUse = step1_get_authorize_url()", "type": "assigned_variable", "loc": [952, 952], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "vector": [14, 1, 0.8358, 0.0009, 1, 0.57, 0.5, 774, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "uriThatWeDontReallyUse", "arg_names": [], "import_names": [], "rhs_call_name": "step1_get_authorize_url", "annotation": ""}, "snippet": " uriThatWeDontReallyUse = flow.step1_get_authorize_url(redirect_uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L953_C2", "label": "credentials = step2_exchange()", "type": "assigned_variable", "loc": [953, 953], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "vector": [14, 1, 0.8367, 0.0009, 1, 0.57, 0.75, 198, 3, 2, 0, 0, 471, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "step2_exchange", "annotation": ""}, "snippet": " credentials = flow.step2_exchange(code, http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L954_C2", "label": "return", "type": "return", "loc": [954, 954], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "vector": [13, 1, 0.8376, 0.0009, 1, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "label": "OAuth2WebServerFlow", "type": "class", "loc": [957, 1098], "level": 0, "parent": null, "vector": [3, 0, 0.9021, 0.1247, 0, 0.66, 0.9756, 875, 0, 3, 0, 0, 746, 0, 29], "semantic": {"name": "OAuth2WebServerFlow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuth2WebServerFlow(Flow):\n \"\"\"Does the Web Server Flow for OAuth 2.0.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\"\n\n def __init__(self, client_id, client_secret, scope, user_agent=None,\n auth_uri='https://accounts.google.com/o/oauth2/auth',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L958_C2", "label": "expression", "type": "expression", "loc": [958, 961], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "vector": [8, 1, 0.8424, 0.0035, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Does the Web Server Flow for OAuth 2.0.\n\n OAuth2Credentials objects may be safely pickled and unpickled.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "label": "__init__", "type": "function", "loc": [963, 994], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "vector": [2, 1, 0.8591, 0.0281, 1, 0.55, 0.3333, 555, 0, 8, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "client_id", "client_secret", "scope", "user_agent", "auth_uri", "token_uri", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, client_id, client_secret, scope, user_agent=None,\n auth_uri='https://accounts.google.com/o/oauth2/auth',\n token_uri='https://accounts.google.com/o/oauth2/token',\n **kwargs):\n \"\"\"Constructor for OAuth2WebServerFlow.\n\n Args:\n client_id: string, client identifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L967_C4", "label": "expression", "type": "expression", "loc": [967, 981], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [8, 2, 0.8551, 0.0132, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for OAuth2WebServerFlow.\n\n Args:\n client_id: string, client identifier.\n client_secret: string client secret.\n scope: string or list of strings, scope(s) of the credentials being\n requested.\n user_agent: string, HTTP User-Agent to provide for this application."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L982_C4", "label": "self.client_id =", "type": "assigned_variable", "loc": [982, 982], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8622, 0.0009, 2, 0.72, 0.1, 144, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_id = client_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L983_C4", "label": "self.client_secret =", "type": "assigned_variable", "loc": [983, 983], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.863, 0.0009, 2, 0.72, 0.2, 451, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.client_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.client_secret = client_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L984_C4", "label": "if", "type": "if", "loc": [984, 985], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [4, 2, 0.8644, 0.0018, 2, 0.72, 0.3, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(scope) is list:\n scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L985_C6", "label": "scope = join()", "type": "assigned_variable", "loc": [985, 985], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L984_C4", "vector": [14, 3, 0.8648, 0.0009, 3, 0.7, 0.0, 334, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "scope", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " scope = ' '.join(scope)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L986_C4", "label": "self.scope =", "type": "assigned_variable", "loc": [986, 986], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8657, 0.0009, 2, 0.72, 0.4, 550, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.scope", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scope = scope"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L987_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [987, 987], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8665, 0.0009, 2, 0.72, 0.5, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L988_C4", "label": "self.auth_uri =", "type": "assigned_variable", "loc": [988, 988], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8674, 0.0009, 2, 0.72, 0.6, 981, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.auth_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.auth_uri = auth_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L989_C4", "label": "self.token_uri =", "type": "assigned_variable", "loc": [989, 989], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8683, 0.0009, 2, 0.72, 0.7, 941, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token_uri = token_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L990_C4", "label": "self.params =", "type": "assigned_variable", "loc": [990, 992], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8701, 0.0026, 2, 0.72, 0.8, 402, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = {\n 'access_type': 'offline',\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L993_C4", "label": "update()", "type": "expression", "loc": [993, 993], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [8, 2, 0.8718, 0.0009, 2, 0.72, 0.9, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.params.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L994_C4", "label": "self.redirect_uri =", "type": "assigned_variable", "loc": [994, 994], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "vector": [14, 2, 0.8727, 0.0009, 2, 0.72, 1.0, 937, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.redirect_uri = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "label": "step1_get_authorize_url", "type": "function", "loc": [996, 1021], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "vector": [2, 1, 0.8854, 0.0228, 1, 0.55, 0.6667, 752, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "step1_get_authorize_url", "arg_names": ["self", "redirect_uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step1_get_authorize_url(self, redirect_uri=OOB_CALLBACK_URN):\n \"\"\"Returns a URI to redirect to the provider.\n\n Args:\n redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for\n a non-web-based application, or a URI that handles the callback from\n the authorization server.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L997_C4", "label": "expression", "type": "expression", "loc": [997, 1008], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [8, 2, 0.8802, 0.0105, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a URI to redirect to the provider.\n\n Args:\n redirect_uri: string, Either the string 'urn:ietf:wg:oauth:2.0:oob' for\n a non-web-based application, or a URI that handles the callback from\n the authorization server.\n\n If redirect_uri is 'urn:ietf:wg:oauth:2.0:oob' then pass in the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1010_C4", "label": "self.redirect_uri =", "type": "assigned_variable", "loc": [1010, 1010], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [14, 2, 0.8867, 0.0009, 2, 0.36, 0.1429, 937, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.redirect_uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.redirect_uri = redirect_uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1011_C4", "label": "query =", "type": "assigned_variable", "loc": [1011, 1016], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [14, 2, 0.8898, 0.0053, 2, 0.36, 0.2857, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {\n 'response_type': 'code',\n 'client_id': self.client_id,\n 'redirect_uri': redirect_uri,\n 'scope': self.scope,\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1017_C4", "label": "update()", "type": "expression", "loc": [1017, 1017], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [8, 2, 0.8929, 0.0009, 2, 0.36, 0.4286, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " query.update(self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1018_C4", "label": "parts = list()", "type": "assigned_variable", "loc": [1018, 1018], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [14, 2, 0.8938, 0.0009, 2, 0.36, 0.5714, 13, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " parts = list(urlparse.urlparse(self.auth_uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1019_C4", "label": "update()", "type": "expression", "loc": [1019, 1019], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [8, 2, 0.8946, 0.0009, 2, 0.36, 0.7143, 637, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " query.update(dict(parse_qsl(parts[4]))) # 4 is the index of the query part"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1020_C4", "label": " = urlencode()", "type": "assigned_variable", "loc": [1020, 1020], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [14, 2, 0.8955, 0.0009, 2, 0.36, 0.8571, 0, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " parts[4] = urllib.urlencode(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L1021_C4", "label": "return", "type": "return", "loc": [1021, 1021], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "vector": [13, 2, 0.8964, 0.0009, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return urlparse.urlunparse(parts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "label": "step2_exchange", "type": "function", "loc": [1023, 1098], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "vector": [2, 1, 0.9311, 0.0667, 1, 0.55, 1.0, 471, 0, 3, 1, 0, 0, 0, 18], "semantic": {"name": "step2_exchange", "arg_names": ["self", "code", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step2_exchange(self, code, http=None):\n \"\"\"Exhanges a code for OAuth2Credentials.\n\n Args:\n code: string or dict, either the code as a string, or a dictionary\n of the query parameters to the redirect_uri, which contains\n the code.\n http: httplib2.Http, optional http instance to use to do the fetch"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1024_C4", "label": "expression", "type": "expression", "loc": [1024, 1038], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [8, 2, 0.9052, 0.0132, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exhanges a code for OAuth2Credentials.\n\n Args:\n code: string or dict, either the code as a string, or a dictionary\n of the query parameters to the redirect_uri, which contains\n the code.\n http: httplib2.Http, optional http instance to use to do the fetch\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1040_C4", "label": "if", "type": "if", "loc": [1040, 1048], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [4, 2, 0.9166, 0.0079, 2, 0.55, 0.1429, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (isinstance(code, str) or isinstance(code, unicode)):\n if 'code' not in code:\n if 'error' in code:\n error_msg = code['error']\n else:\n error_msg = 'No code was supplied in the query parameters.'\n raise FlowExchangeError(error_msg)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1041_C6", "label": "if", "type": "if", "loc": [1041, 1048], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1040_C4", "vector": [4, 3, 0.917, 0.007, 3, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'code' not in code:\n if 'error' in code:\n error_msg = code['error']\n else:\n error_msg = 'No code was supplied in the query parameters.'\n raise FlowExchangeError(error_msg)\n else:\n code = code['code']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1042_C8", "label": "if", "type": "if", "loc": [1042, 1045], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1041_C6", "vector": [4, 4, 0.9162, 0.0035, 4, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'error' in code:\n error_msg = code['error']\n else:\n error_msg = 'No code was supplied in the query parameters.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1043_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [1043, 1043], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1042_C8", "vector": [14, 5, 0.9157, 0.0009, 5, 0.11, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = code['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1045_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [1045, 1045], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1042_C8", "vector": [14, 5, 0.9175, 0.0009, 5, 0.11, 1.0, 503, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = 'No code was supplied in the query parameters.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1048_C8", "label": "code =", "type": "assigned_variable", "loc": [1048, 1048], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1041_C6", "vector": [14, 4, 0.9201, 0.0009, 4, 0.99, 1.0, 44, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " code = code['code']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1050_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [1050, 1057], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [14, 2, 0.9249, 0.007, 2, 0.55, 0.2857, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({\n 'grant_type': 'authorization_code',\n 'client_id': self.client_id,\n 'client_secret': self.client_secret,\n 'code': code,\n 'redirect_uri': self.redirect_uri,\n 'scope': self.scope,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1058_C4", "label": "headers =", "type": "assigned_variable", "loc": [1058, 1060], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [14, 2, 0.9298, 0.0026, 2, 0.55, 0.4286, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'content-type': 'application/x-www-form-urlencoded',\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1062_C4", "label": "if", "type": "if", "loc": [1062, 1063], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [4, 2, 0.9328, 0.0018, 2, 0.55, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.user_agent is not None:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1063_C6", "label": "assign", "type": "assigned_variable", "loc": [1063, 1063], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1062_C4", "vector": [14, 3, 0.9333, 0.0009, 3, 0.02, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1065_C4", "label": "if", "type": "if", "loc": [1065, 1066], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [4, 2, 0.9355, 0.0018, 2, 0.55, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if http is None:\n http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1066_C6", "label": "http = Http()", "type": "assigned_variable", "loc": [1066, 1066], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1065_C4", "vector": [14, 3, 0.9359, 0.0009, 3, 0.55, 0.0, 415, 3, 0, 0, 0, 967, 10, 1], "semantic": {"name": "http", "arg_names": [], "import_names": [], "rhs_call_name": "Http", "annotation": ""}, "snippet": " http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1068_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [1068, 1069], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [14, 2, 0.9381, 0.0018, 2, 0.55, 0.8571, 339, 3, 4, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = http.request(self.token_uri, method='POST', body=body,\n headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "label": "if", "type": "if", "loc": [1070, 1098], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "vector": [4, 2, 0.9517, 0.0255, 2, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 200:\n # TODO(jcgregorio) Raise an error if simplejson.loads fails?\n d = simplejson.loads(content)\n access_token = d['access_token']\n refresh_token = d.get('refresh_token', None)\n token_expiry = None\n if 'expires_in' in d:\n token_expiry = datetime.datetime.utcnow() + datetime.timedelta("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1072_C6", "label": "d = loads()", "type": "assigned_variable", "loc": [1072, 1072], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [14, 3, 0.9412, 0.0009, 3, 0.34, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1073_C6", "label": "access_token =", "type": "assigned_variable", "loc": [1073, 1073], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [14, 3, 0.9421, 0.0009, 3, 0.34, 0.1, 797, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " access_token = d['access_token']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1074_C6", "label": "refresh_token = get()", "type": "assigned_variable", "loc": [1074, 1074], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [14, 3, 0.9429, 0.0009, 3, 0.34, 0.2, 192, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "refresh_token", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " refresh_token = d.get('refresh_token', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1075_C6", "label": "token_expiry =", "type": "assigned_variable", "loc": [1075, 1075], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [14, 3, 0.9438, 0.0009, 3, 0.34, 0.3, 457, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " token_expiry = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1076_C6", "label": "if", "type": "if", "loc": [1076, 1078], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [4, 3, 0.9456, 0.0026, 3, 0.34, 0.4, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'expires_in' in d:\n token_expiry = datetime.datetime.utcnow() + datetime.timedelta(\n seconds=int(d['expires_in']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1077_C8", "label": "token_expiry =", "type": "assigned_variable", "loc": [1077, 1078], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1076_C6", "vector": [14, 4, 0.946, 0.0018, 4, 0.35, 0.0, 457, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "token_expiry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " token_expiry = datetime.datetime.utcnow() + datetime.timedelta(\n seconds=int(d['expires_in']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1080_C6", "label": "if", "type": "if", "loc": [1080, 1081], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [4, 3, 0.9486, 0.0018, 3, 0.34, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'id_token' in d:\n d['id_token'] = _extract_id_token(d['id_token'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1081_C8", "label": " = _extract_id_token()", "type": "assigned_variable", "loc": [1081, 1081], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1080_C6", "vector": [14, 4, 0.9491, 0.0009, 4, 0.32, 0.0, 0, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_extract_id_token", "annotation": ""}, "snippet": " d['id_token'] = _extract_id_token(d['id_token'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1083_C6", "label": "info()", "type": "expression", "loc": [1083, 1083], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [8, 3, 0.9508, 0.0009, 3, 0.34, 0.6, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Successfully retrieved access token: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L1084_C6", "label": "return", "type": "return", "loc": [1084, 1087], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [13, 3, 0.953, 0.0035, 3, 0.34, 0.7, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return OAuth2Credentials(access_token, self.client_id,\n self.client_secret, refresh_token, token_expiry,\n self.token_uri, self.user_agent,\n id_token=d.get('id_token', None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1089_C6", "label": "info()", "type": "expression", "loc": [1089, 1089], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [8, 3, 0.9561, 0.0009, 3, 0.34, 0.8, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logger.info('Failed to retrieve access token: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1090_C6", "label": "error_msg =", "type": "assigned_variable", "loc": [1090, 1090], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [14, 3, 0.957, 0.0009, 3, 0.34, 0.9, 503, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = 'Invalid response %s.' % resp['status']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1091_C6", "label": "try", "type": "try", "loc": [1091, 1096], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "vector": [7, 3, 0.9601, 0.0053, 3, 0.34, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n d = simplejson.loads(content)\n if 'error' in d:\n error_msg = d['error']\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1092_C8", "label": "d = loads()", "type": "assigned_variable", "loc": [1092, 1092], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1091_C6", "vector": [14, 4, 0.9587, 0.0009, 4, 0.33, 0.0, 355, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " d = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1093_C8", "label": "if", "type": "if", "loc": [1093, 1094], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1091_C6", "vector": [4, 4, 0.9601, 0.0018, 4, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'error' in d:\n error_msg = d['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1094_C10", "label": "error_msg =", "type": "assigned_variable", "loc": [1094, 1094], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1093_C8", "vector": [14, 5, 0.9605, 0.0009, 5, 0.25, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = d['error']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1100_C0", "label": "flow_from_clientsecrets", "type": "function", "loc": [1100, 1139], "level": 0, "parent": null, "vector": [2, 0, 0.9829, 0.0351, 0, 0.66, 1.0, 355, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "flow_from_clientsecrets", "arg_names": ["filename", "scope", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def flow_from_clientsecrets(filename, scope, message=None):\n \"\"\"Create a Flow from a clientsecrets file.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows.\n\n Args:\n filename: string, File name of client secrets."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1101_C2", "label": "expression", "type": "expression", "loc": [1101, 1121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1100_C0", "vector": [8, 1, 0.9754, 0.0184, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a Flow from a clientsecrets file.\n\n Will create the right kind of Flow based on the contents of the clientsecrets\n file or will raise InvalidClientSecretsError for unknown types of Flows.\n\n Args:\n filename: string, File name of client secrets.\n scope: string or list of strings, scope(s) to request."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "label": "try", "type": "try", "loc": [1122, 1139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1100_C0", "vector": [7, 1, 0.9925, 0.0158, 1, 0.93, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n client_type, client_info = clientsecrets.loadfile(filename)\n if client_type in [clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED]:\n return OAuth2WebServerFlow(\n client_info['client_id'],\n client_info['client_secret'],\n scope,\n None, # user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1123_C4", "label": "client_type, client_info = loadfile()", "type": "assigned_variable", "loc": [1123, 1123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "vector": [14, 2, 0.986, 0.0009, 2, 0.0, 0.0, 849, 3, 1, 0, 0, 752, 10, 1], "semantic": {"name": "client_type, client_info", "arg_names": [], "import_names": [], "rhs_call_name": "loadfile", "annotation": ""}, "snippet": " client_type, client_info = clientsecrets.loadfile(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1124_C4", "label": "if", "type": "if", "loc": [1124, 1131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "vector": [4, 2, 0.9899, 0.007, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client_type in [clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED]:\n return OAuth2WebServerFlow(\n client_info['client_id'],\n client_info['client_secret'],\n scope,\n None, # user_agent\n client_info['auth_uri'],\n client_info['token_uri'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L1125_C8", "label": "return", "type": "return", "loc": [1125, 1131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1124_C4", "vector": [13, 3, 0.9903, 0.0061, 3, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return OAuth2WebServerFlow(\n client_info['client_id'],\n client_info['client_secret'],\n scope,\n None, # user_agent\n client_info['auth_uri'],\n client_info['token_uri'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1133_C4", "label": "if", "type": "if", "loc": [1133, 1136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "vector": [4, 2, 0.996, 0.0035, 2, 0.0, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message:\n sys.exit(message)\n else:\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1134_C6", "label": "exit()", "type": "expression", "loc": [1134, 1134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1133_C4", "vector": [8, 3, 0.9956, 0.0009, 3, 0.68, 0.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(message)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:ImportFrom_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L104_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L132_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:For_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:For_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L162_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L171_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L171_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L171_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L196_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L199_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L200_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L208_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L208_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L208_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L235_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L235_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L242_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L250_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L260_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L277_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L286_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L287_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L286_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L289_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L291_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L300_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L301_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L300_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L303_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L305_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L315_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L316_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L315_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L318_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L322_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L330_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L400_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L400_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L400_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L406_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L406_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L408_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L410_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L410_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L412_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L414_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L416_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L419_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L436_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L436_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L436_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L445_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L453_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L453_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L468_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L470_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L470_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L470_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L457_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L485_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L489_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L493_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L493_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L494_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L496_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L496_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L497_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L499_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L501_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L503_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L488_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L504_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L506_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L506_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L506_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L516_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L518_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L518_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L519_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L518_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L520_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L523_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L524_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L522_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L526_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L529_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L530_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L528_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L531_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L534_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L535_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L533_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L541_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L545_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L549_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L549_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L550_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L543_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L552_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L554_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L554_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L555_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L554_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L569_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L571_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L568_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L576_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L577_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L574_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L579_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L572_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L584_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L593_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L594_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L596_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L597_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L583_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L601_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L602_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L603_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L604_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L604_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L604_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L609_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L609_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L610_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L614_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L615_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L599_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L616_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L616_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L617_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L616_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L619_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L620_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L621_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L621_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L622_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L629_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L653_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L653_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L654_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L653_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L667_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L679_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L680_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L678_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L683_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L628_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L685_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L691_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L704_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L713_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L701_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L721_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L724_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L726_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L723_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L732_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L690_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L734_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L734_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L735_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L734_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L738_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L746_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L753_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L763_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L777_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L783_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L783_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L784_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L785_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L787_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L788_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L789_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L755_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L790_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L794_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L795_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L804_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L805_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L745_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L808_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L809_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L810_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L817_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L818_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L820_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L826_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L740_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L830_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L846_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L846_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L847_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L849_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L828_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L851_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L851_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L852_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L851_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L853_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L860_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L861_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L858_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L862_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L866_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L876_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L878_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L865_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L882_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L888_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L908_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L913_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L914_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L884_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L915_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L922_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L950_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L952_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L953_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L918_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L954_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L958_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L967_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L982_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L983_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L984_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L984_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L985_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L986_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L987_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L988_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L989_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L990_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L993_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L963_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L994_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L997_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1010_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1011_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1017_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1018_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1019_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1020_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L996_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L1021_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:ClassDef_L957_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1024_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1040_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1040_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1041_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1041_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1042_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1042_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1043_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1042_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1045_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1041_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1048_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1050_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1058_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1062_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1062_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1063_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1065_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1065_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1066_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1068_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1023_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1072_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1073_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1074_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1075_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1076_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1076_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1077_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1080_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1080_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1081_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1083_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L1084_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1089_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1090_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1091_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1091_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1092_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1091_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1093_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1093_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1094_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:FunctionDef_L1100_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Assign_L1123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Return_L1125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:Try_L1122_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99166:If_L1133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99166:Expr_L1134_C6"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for OAuth.
Utilities for making it easier to work with OAuth 2.0
credentials.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import os
import stat
import threading
from anyjson import simplejson
from client import Storage as BaseStorage
from client import Credentials
class Storage(BaseStorage):
"""Store and retrieve a single credential to and from a file."""
def __init__(self, filename):
self._filename = filename
self._lock = threading.Lock()
def acquire_lock(self):
"""Acquires any lock necessary to access this Storage.
This lock is not reentrant."""
self._lock.acquire()
def release_lock(self):
"""Release the Storage lock.
Trying to release a lock that isn't held will result in a
RuntimeError.
"""
self._lock.release()
def locked_get(self):
"""Retrieve Credential from file.
Returns:
oauth2client.client.Credentials
"""
credentials = None
try:
f = open(self._filename, 'rb')
content = f.read()
f.close()
except IOError:
return credentials
try:
credentials = Credentials.new_from_json(content)
credentials.set_store(self)
except ValueError:
pass
return credentials
def _create_file_if_needed(self):
"""Create an empty file if necessary.
This method will not initialize the file. Instead it implements a
simple version of "touch" to ensure the file has been created.
"""
if not os.path.exists(self._filename):
old_umask = os.umask(0177)
try:
open(self._filename, 'a+b').close()
finally:
os.umask(old_umask)
def locked_put(self, credentials):
"""Write Credentials to file.
Args:
credentials: Credentials, the credentials to store.
"""
self._create_file_if_needed()
f = open(self._filename, 'wb')
f.write(credentials.to_json())
f.close()
def locked_delete(self):
"""Delete Credentials file.
Args:
credentials: Credentials, the credentials to store.
"""
os.unlink(self._filename)
| ajibawa-2023/Python-Code-Large/train/row_99167 | 46 | 106 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1604, 0.0472, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 2.0\ncredentials.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1981, 0.0094, 0, 0.66, 0.125, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Import_L23_C0", "label": "os import os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.217, 0.0094, 0, 0.66, 0.25, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Import_L24_C0", "label": "stat import stat", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.2264, 0.0094, 0, 0.66, 0.375, 48, 0, 1, 0, 0, 48, 0, 0], "semantic": {"name": "stat", "arg_names": [], "import_names": ["stat"], "rhs_call_name": "", "annotation": ""}, "snippet": "import stat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Import_L25_C0", "label": "threading import threading", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2358, 0.0094, 0, 0.66, 0.5, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:ImportFrom_L27_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2547, 0.0094, 0, 0.66, 0.625, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:ImportFrom_L28_C0", "label": "from client import BaseStorage", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.2642, 0.0094, 0, 0.66, 0.75, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:ImportFrom_L29_C0", "label": "from client import Credentials", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.2736, 0.0094, 0, 0.66, 0.875, 608, 0, 1, 0, 0, 608, 0, 0], "semantic": {"name": "client", "arg_names": [], "import_names": ["Credentials"], "rhs_call_name": "", "annotation": ""}, "snippet": "from client import Credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "label": "Storage", "type": "class", "loc": [32, 106], "level": 0, "parent": null, "vector": [3, 0, 0.6509, 0.7075, 0, 0.66, 1.0, 850, 0, 7, 0, 0, 775, 0, 18], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(BaseStorage):\n \"\"\"Store and retrieve a single credential to and from a file.\"\"\"\n\n def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()\n\n def acquire_lock(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L33_C2", "label": "expression", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [8, 1, 0.3113, 0.0094, 1, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from a file.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L35_C2", "label": "__init__", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.3396, 0.0283, 1, 0.88, 0.1429, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L36_C4", "label": "self._filename =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L35_C2", "vector": [14, 2, 0.3396, 0.0094, 2, 0.69, 0.0, 146, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._filename = filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L37_C4", "label": "self._lock = Lock()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L35_C2", "vector": [14, 2, 0.3491, 0.0094, 2, 0.69, 1.0, 143, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self._lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L39_C2", "label": "acquire_lock", "type": "function", "loc": [39, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.3868, 0.0472, 1, 0.88, 0.2857, 5, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "acquire_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def acquire_lock(self):\n \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\"\"\"\n self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L39_C2", "vector": [8, 2, 0.3868, 0.0283, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Acquires any lock necessary to access this Storage.\n\n This lock is not reentrant.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L43_C4", "label": "acquire()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L39_C2", "vector": [8, 2, 0.4057, 0.0094, 2, 0.19, 1.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L45_C2", "label": "release_lock", "type": "function", "loc": [45, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.4528, 0.066, 1, 0.88, 0.4286, 821, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "release_lock", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def release_lock(self):\n \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\"\n self._lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L46_C4", "label": "expression", "type": "expression", "loc": [46, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L45_C2", "vector": [8, 2, 0.4528, 0.0472, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Release the Storage lock.\n\n Trying to release a lock that isn't held will result in a\n RuntimeError.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L51_C4", "label": "release()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L45_C2", "vector": [8, 2, 0.4811, 0.0094, 2, 0.29, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "label": "locked_get", "type": "function", "loc": [53, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.5943, 0.1981, 1, 0.88, 0.5714, 579, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve Credential from file.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\"\n credentials = None\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "vector": [8, 2, 0.5283, 0.0472, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from file.\n\n Returns:\n oauth2client.client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L59_C4", "label": "credentials =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "vector": [14, 2, 0.5566, 0.0094, 2, 0.79, 0.25, 198, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "label": "try", "type": "try", "loc": [60, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "vector": [7, 2, 0.5896, 0.0566, 2, 0.79, 0.5, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n f = open(self._filename, 'rb')\n content = f.read()\n f.close()\n except IOError:\n return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L61_C6", "label": "f = open()", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "vector": [14, 3, 0.5755, 0.0094, 3, 0.11, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L62_C6", "label": "content = read()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "vector": [14, 3, 0.5849, 0.0094, 3, 0.11, 0.5, 273, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " content = f.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L63_C6", "label": "close()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "vector": [8, 3, 0.5943, 0.0094, 3, 0.11, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Return_L65_C6", "label": "return", "type": "return", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "vector": [13, 3, 0.6132, 0.0094, 3, 0.11, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L67_C4", "label": "try", "type": "try", "loc": [67, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "vector": [7, 2, 0.6509, 0.0472, 2, 0.79, 0.75, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n credentials = Credentials.new_from_json(content)\n credentials.set_store(self)\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L68_C6", "label": "credentials = new_from_json()", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L67_C4", "vector": [14, 3, 0.6415, 0.0094, 3, 0.11, 0.0, 198, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "new_from_json", "annotation": ""}, "snippet": " credentials = Credentials.new_from_json(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L69_C6", "label": "set_store()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L67_C4", "vector": [8, 3, 0.6509, 0.0094, 3, 0.11, 1.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credentials.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Return_L73_C4", "label": "return", "type": "return", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "vector": [13, 2, 0.6887, 0.0094, 2, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L75_C2", "label": "_create_file_if_needed", "type": "function", "loc": [75, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.7547, 0.1038, 1, 0.88, 0.7143, 654, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_create_file_if_needed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_file_if_needed(self):\n \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\"\n if not os.path.exists(self._filename):\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L76_C4", "label": "expression", "type": "expression", "loc": [76, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L75_C2", "vector": [8, 2, 0.7358, 0.0472, 2, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create an empty file if necessary.\n\n This method will not initialize the file. Instead it implements a\n simple version of \"touch\" to ensure the file has been created.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:If_L81_C4", "label": "if", "type": "if", "loc": [81, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L75_C2", "vector": [4, 2, 0.783, 0.0472, 2, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists(self._filename):\n try:\n open(self._filename, 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L82_C6", "label": "try", "type": "try", "loc": [82, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:If_L81_C4", "vector": [7, 3, 0.7877, 0.0377, 3, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n open(self._filename, 'a+b').close()\n finally:\n os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L83_C8", "label": "close()", "type": "expression", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L82_C6", "vector": [8, 4, 0.783, 0.0094, 4, 0.64, 0.0, 77, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " open(self._filename, 'a+b').close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L85_C8", "label": "umask()", "type": "expression", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L82_C6", "vector": [8, 4, 0.8019, 0.0094, 4, 0.64, 1.0, 505, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "umask", "arg_names": [], "import_names": [], "rhs_call_name": "umask", "annotation": ""}, "snippet": " os.umask(old_umask)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "label": "locked_put", "type": "function", "loc": [87, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.8679, 0.1038, 1, 0.88, 0.8571, 154, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n\n self._create_file_if_needed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L88_C4", "label": "expression", "type": "expression", "loc": [88, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "vector": [8, 2, 0.8491, 0.0472, 2, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L94_C4", "label": "_create_file_if_needed()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "vector": [8, 2, 0.8868, 0.0094, 2, 0.96, 0.25, 654, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_file_if_needed", "arg_names": [], "import_names": [], "rhs_call_name": "_create_file_if_needed", "annotation": ""}, "snippet": " self._create_file_if_needed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L95_C4", "label": "f = open()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "vector": [14, 2, 0.8962, 0.0094, 2, 0.96, 0.5, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L96_C4", "label": "write()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "vector": [8, 2, 0.9057, 0.0094, 2, 0.96, 0.75, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write(credentials.to_json())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L97_C4", "label": "close()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "vector": [8, 2, 0.9151, 0.0094, 2, 0.96, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L99_C2", "label": "locked_delete", "type": "function", "loc": [99, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "vector": [2, 1, 0.967, 0.0755, 1, 0.88, 1.0, 769, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete Credentials file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n\n os.unlink(self._filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L100_C4", "label": "expression", "type": "expression", "loc": [100, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L99_C2", "vector": [8, 2, 0.9623, 0.0472, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete Credentials file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L106_C4", "label": "unlink()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L99_C2", "vector": [8, 2, 1.0, 0.0094, 2, 0.73, 1.0, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unlink", "arg_names": [], "import_names": [], "rhs_call_name": "unlink", "annotation": ""}, "snippet": " os.unlink(self._filename)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L61_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L63_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Return_L65_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L68_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L69_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Return_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L82_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L82_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:Try_L82_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L87_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L99_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99167:FunctionDef_L99_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99167:Expr_L106_C4"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""OAuth 2.0 utilities for Django.
Utilities for using OAuth 2.0 in conjunction with
the Django datastore.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import oauth2client
import base64
import pickle
from django.db import models
from oauth2client.client import Storage as BaseStorage
class CredentialsField(models.Field):
__metaclass__ = models.SubfieldBase
def get_internal_type(self):
return "TextField"
def to_python(self, value):
if value is None:
return None
if isinstance(value, oauth2client.client.Credentials):
return value
return pickle.loads(base64.b64decode(value))
def get_db_prep_value(self, value, connection, prepared=False):
if value is None:
return None
return base64.b64encode(pickle.dumps(value))
class FlowField(models.Field):
__metaclass__ = models.SubfieldBase
def get_internal_type(self):
return "TextField"
def to_python(self, value):
if value is None:
return None
if isinstance(value, oauth2client.client.Flow):
return value
return pickle.loads(base64.b64decode(value))
def get_db_prep_value(self, value, connection, prepared=False):
if value is None:
return None
return base64.b64encode(pickle.dumps(value))
class Storage(BaseStorage):
"""Store and retrieve a single credential to and from
the datastore.
This Storage helper presumes the Credentials
have been stored as a CredenialsField
on a db model class.
"""
def __init__(self, model_class, key_name, key_value, property_name):
"""Constructor for Storage.
Args:
model: db.Model, model class
key_name: string, key name for the entity that has the credentials
key_value: string, key value for the entity that has the credentials
property_name: string, name of the property that is an CredentialsProperty
"""
self.model_class = model_class
self.key_name = key_name
self.key_value = key_value
self.property_name = property_name
def locked_get(self):
"""Retrieve Credential from datastore.
Returns:
oauth2client.Credentials
"""
credential = None
query = {self.key_name: self.key_value}
entities = self.model_class.objects.filter(**query)
if len(entities) > 0:
credential = getattr(entities[0], self.property_name)
if credential and hasattr(credential, 'set_store'):
credential.set_store(self)
return credential
def locked_put(self, credentials):
"""Write a Credentials to the datastore.
Args:
credentials: Credentials, the credentials to store.
"""
args = {self.key_name: self.key_value}
entity = self.model_class(**args)
setattr(entity, self.property_name, credentials)
entity.save()
def locked_delete(self):
"""Delete Credentials from the datastore."""
query = {self.key_name: self.key_value}
entities = self.model_class.objects.filter(**query).delete()
| ajibawa-2023/Python-Code-Large/train/row_99168 | 63 | 124 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1371, 0.0403, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"OAuth 2.0 utilities for Django.\n\nUtilities for using OAuth 2.0 in conjunction with\nthe Django datastore.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1694, 0.0081, 0, 0.66, 0.1111, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Import_L23_C0", "label": "oauth2client import oauth2client", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1855, 0.0081, 0, 0.66, 0.2222, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "oauth2client", "arg_names": [], "import_names": ["oauth2client"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Import_L24_C0", "label": "base64 import base64", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.1935, 0.0081, 0, 0.66, 0.3333, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Import_L25_C0", "label": "pickle import pickle", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2016, 0.0081, 0, 0.66, 0.4444, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:ImportFrom_L27_C0", "label": "from django.db import models", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2177, 0.0081, 0, 0.66, 0.5556, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:ImportFrom_L28_C0", "label": "from oauth2client.client import BaseStorage", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.2258, 0.0081, 0, 0.66, 0.6667, 340, 0, 1, 0, 0, 340, 0, 0], "semantic": {"name": "oauth2client.client", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.client import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "label": "CredentialsField", "type": "class", "loc": [30, 47], "level": 0, "parent": null, "vector": [3, 0, 0.3105, 0.1452, 0, 0.66, 0.7778, 776, 0, 3, 0, 0, 922, 0, 5], "semantic": {"name": "CredentialsField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def get_internal_type(self):\n return \"TextField\"\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L32_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "vector": [14, 1, 0.2581, 0.0081, 1, 0.75, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L34_C2", "label": "get_internal_type", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "vector": [2, 1, 0.2782, 0.0161, 1, 0.75, 0.3333, 291, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_internal_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_internal_type(self):\n return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L34_C2", "vector": [13, 2, 0.2823, 0.0081, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "label": "to_python", "type": "function", "loc": [37, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "vector": [2, 1, 0.3185, 0.0484, 1, 0.75, 0.6667, 800, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, oauth2client.client.Credentials):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L38_C4", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "vector": [4, 2, 0.3105, 0.0161, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L39_C6", "label": "return", "type": "return", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L38_C4", "vector": [13, 3, 0.3145, 0.0081, 3, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L40_C4", "label": "if", "type": "if", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "vector": [4, 2, 0.3266, 0.0161, 2, 0.85, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, oauth2client.client.Credentials):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L41_C6", "label": "return", "type": "return", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L40_C4", "vector": [13, 3, 0.3306, 0.0081, 3, 0.4, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "vector": [13, 2, 0.3387, 0.0081, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L44_C2", "label": "get_db_prep_value", "type": "function", "loc": [44, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "vector": [2, 1, 0.3669, 0.0323, 1, 0.75, 1.0, 728, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value", "connection", "prepared"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value, connection, prepared=False):\n if value is None:\n return None\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L45_C4", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L44_C2", "vector": [4, 2, 0.3669, 0.0161, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L46_C6", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L45_C4", "vector": [13, 3, 0.371, 0.0081, 3, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L47_C4", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L44_C2", "vector": [13, 2, 0.379, 0.0081, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "label": "FlowField", "type": "class", "loc": [50, 67], "level": 0, "parent": null, "vector": [3, 0, 0.4718, 0.1452, 0, 0.66, 0.8889, 843, 0, 3, 0, 0, 922, 0, 5], "semantic": {"name": "FlowField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def get_internal_type(self):\n return \"TextField\"\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L52_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "vector": [14, 1, 0.4194, 0.0081, 1, 0.14, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L54_C2", "label": "get_internal_type", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "vector": [2, 1, 0.4395, 0.0161, 1, 0.14, 0.3333, 291, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_internal_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_internal_type(self):\n return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L54_C2", "vector": [13, 2, 0.4435, 0.0081, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"TextField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "label": "to_python", "type": "function", "loc": [57, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "vector": [2, 1, 0.4798, 0.0484, 1, 0.14, 0.6667, 800, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, oauth2client.client.Flow):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L58_C4", "label": "if", "type": "if", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "vector": [4, 2, 0.4718, 0.0161, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L59_C6", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L58_C4", "vector": [13, 3, 0.4758, 0.0081, 3, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L60_C4", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "vector": [4, 2, 0.4879, 0.0161, 2, 0.81, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, oauth2client.client.Flow):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L61_C6", "label": "return", "type": "return", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L60_C4", "vector": [13, 3, 0.4919, 0.0081, 3, 0.0, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L62_C4", "label": "return", "type": "return", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "vector": [13, 2, 0.5, 0.0081, 2, 0.81, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L64_C2", "label": "get_db_prep_value", "type": "function", "loc": [64, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "vector": [2, 1, 0.5282, 0.0323, 1, 0.14, 1.0, 728, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value", "connection", "prepared"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value, connection, prepared=False):\n if value is None:\n return None\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L65_C4", "label": "if", "type": "if", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L64_C2", "vector": [4, 2, 0.5282, 0.0161, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L66_C6", "label": "return", "type": "return", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L65_C4", "vector": [13, 3, 0.5323, 0.0081, 3, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L67_C4", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L64_C2", "vector": [13, 2, 0.5403, 0.0081, 2, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "label": "Storage", "type": "class", "loc": [70, 124], "level": 0, "parent": null, "vector": [3, 0, 0.7823, 0.4435, 0, 0.66, 1.0, 850, 0, 4, 0, 0, 775, 0, 10], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(BaseStorage):\n \"\"\"Store and retrieve a single credential to and from\n the datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsField\n on a db model class.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L71_C2", "label": "expression", "type": "expression", "loc": [71, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "vector": [8, 1, 0.5968, 0.0565, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from\n the datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsField\n on a db model class.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "label": "__init__", "type": "function", "loc": [79, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "vector": [2, 1, 0.6855, 0.1048, 1, 0.09, 0.25, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "model_class", "key_name", "key_value", "property_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, model_class, key_name, key_value, property_name):\n \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n key_value: string, key value for the entity that has the credentials\n property_name: string, name of the property that is an CredentialsProperty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L80_C4", "label": "expression", "type": "expression", "loc": [80, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "vector": [8, 2, 0.6734, 0.0645, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n key_value: string, key value for the entity that has the credentials\n property_name: string, name of the property that is an CredentialsProperty\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L88_C4", "label": "self.model_class =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "vector": [14, 2, 0.7097, 0.0081, 2, 0.52, 0.25, 687, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_class = model_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L89_C4", "label": "self.key_name =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "vector": [14, 2, 0.7177, 0.0081, 2, 0.52, 0.5, 40, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.key_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.key_name = key_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L90_C4", "label": "self.key_value =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "vector": [14, 2, 0.7258, 0.0081, 2, 0.52, 0.75, 655, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.key_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.key_value = key_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L91_C4", "label": "self.property_name =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "vector": [14, 2, 0.7339, 0.0081, 2, 0.52, 1.0, 742, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.property_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.property_name = property_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "label": "locked_get", "type": "function", "loc": [93, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "vector": [2, 1, 0.8065, 0.121, 1, 0.09, 0.5, 579, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "locked_get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_get(self):\n \"\"\"Retrieve Credential from datastore.\n\n Returns:\n oauth2client.Credentials\n \"\"\"\n credential = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L94_C4", "label": "expression", "type": "expression", "loc": [94, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "vector": [8, 2, 0.7742, 0.0403, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from datastore.\n\n Returns:\n oauth2client.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L99_C4", "label": "credential =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "vector": [14, 2, 0.7984, 0.0081, 2, 0.27, 0.2, 443, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credential = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L101_C4", "label": "query =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "vector": [14, 2, 0.8145, 0.0081, 2, 0.27, 0.4, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {self.key_name: self.key_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L102_C4", "label": "entities = filter()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "vector": [14, 2, 0.8226, 0.0081, 2, 0.27, 0.6, 744, 3, 1, 0, 0, 526, 10, 1], "semantic": {"name": "entities", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": " entities = self.model_class.objects.filter(**query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L103_C4", "label": "if", "type": "if", "loc": [103, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "vector": [4, 2, 0.8427, 0.0323, 2, 0.27, 0.8, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(entities) > 0:\n credential = getattr(entities[0], self.property_name)\n if credential and hasattr(credential, 'set_store'):\n credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L104_C6", "label": "credential = getattr()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L103_C4", "vector": [14, 3, 0.8387, 0.0081, 3, 0.1, 0.0, 443, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " credential = getattr(entities[0], self.property_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L105_C6", "label": "if", "type": "if", "loc": [105, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L103_C4", "vector": [4, 3, 0.8508, 0.0161, 3, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if credential and hasattr(credential, 'set_store'):\n credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L106_C8", "label": "set_store()", "type": "expression", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L105_C6", "vector": [8, 4, 0.8548, 0.0081, 4, 0.85, 0.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credential.set_store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L107_C4", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "vector": [13, 2, 0.8629, 0.0081, 2, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "label": "locked_put", "type": "function", "loc": [109, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "vector": [2, 1, 0.9153, 0.0806, 1, 0.09, 0.75, 154, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "locked_put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_put(self, credentials):\n \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n args = {self.key_name: self.key_value}\n entity = self.model_class(**args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "vector": [8, 2, 0.9032, 0.0403, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L115_C4", "label": "args =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "vector": [14, 2, 0.9274, 0.0081, 2, 0.21, 0.25, 805, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = {self.key_name: self.key_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L116_C4", "label": "entity = model_class()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "vector": [14, 2, 0.9355, 0.0081, 2, 0.21, 0.5, 214, 3, 1, 0, 0, 826, 10, 1], "semantic": {"name": "entity", "arg_names": [], "import_names": [], "rhs_call_name": "model_class", "annotation": ""}, "snippet": " entity = self.model_class(**args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L117_C4", "label": "setattr()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "vector": [8, 2, 0.9435, 0.0081, 2, 0.21, 0.75, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(entity, self.property_name, credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L118_C4", "label": "save()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "vector": [8, 2, 0.9516, 0.0081, 2, 0.21, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " entity.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "label": "locked_delete", "type": "function", "loc": [120, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "vector": [2, 1, 0.9839, 0.0403, 1, 0.09, 1.0, 769, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "locked_delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def locked_delete(self):\n \"\"\"Delete Credentials from the datastore.\"\"\"\n\n query = {self.key_name: self.key_value}\n entities = self.model_class.objects.filter(**query).delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L121_C4", "label": "expression", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "vector": [8, 2, 0.9758, 0.0081, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Delete Credentials from the datastore.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L123_C4", "label": "query =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "vector": [14, 2, 0.9919, 0.0081, 2, 0.21, 0.5, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {self.key_name: self.key_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L124_C4", "label": "entities = delete()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "vector": [14, 2, 1.0, 0.0081, 2, 0.21, 1.0, 744, 3, 0, 0, 0, 266, 10, 2], "semantic": {"name": "entities", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " entities = self.model_class.objects.filter(**query).delete()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L39_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L41_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L46_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L61_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L64_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L64_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L66_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L64_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L105_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:If_L105_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L93_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Return_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99168:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99168:Assign_L124_C4"}] |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import base64
import hashlib
import logging
import time
from OpenSSL import crypto
from anyjson import simplejson
CLOCK_SKEW_SECS = 300 # 5 minutes in seconds
AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds
MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds
class AppIdentityError(Exception):
pass
class Verifier(object):
"""Verifies the signature on a message."""
def __init__(self, pubkey):
"""Constructor.
Args:
pubkey, OpenSSL.crypto.PKey, The public key to verify with.
"""
self._pubkey = pubkey
def verify(self, message, signature):
"""Verifies a message against a signature.
Args:
message: string, The message to verify.
signature: string, The signature on the message.
Returns:
True if message was singed by the private key associated with the public
key that this object was constructed with.
"""
try:
crypto.verify(self._pubkey, signature, message, 'sha256')
return True
except:
return False
@staticmethod
def from_string(key_pem, is_x509_cert):
"""Construct a Verified instance from a string.
Args:
key_pem: string, public key in PEM format.
is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is
expected to be an RSA key in PEM format.
Returns:
Verifier instance.
Raises:
OpenSSL.crypto.Error if the key_pem can't be parsed.
"""
if is_x509_cert:
pubkey = crypto.load_certificate(crypto.FILETYPE_PEM, key_pem)
else:
pubkey = crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem)
return Verifier(pubkey)
class Signer(object):
"""Signs messages with a private key."""
def __init__(self, pkey):
"""Constructor.
Args:
pkey, OpenSSL.crypto.PKey, The private key to sign with.
"""
self._key = pkey
def sign(self, message):
"""Signs a message.
Args:
message: string, Message to be signed.
Returns:
string, The signature of the message for the given key.
"""
return crypto.sign(self._key, message, 'sha256')
@staticmethod
def from_string(key, password='notasecret'):
"""Construct a Signer instance from a string.
Args:
key: string, private key in P12 format.
password: string, password for the private key file.
Returns:
Signer instance.
Raises:
OpenSSL.crypto.Error if the key can't be parsed.
"""
pkey = crypto.load_pkcs12(key, password).get_privatekey()
return Signer(pkey)
def _urlsafe_b64encode(raw_bytes):
return base64.urlsafe_b64encode(raw_bytes).rstrip('=')
def _urlsafe_b64decode(b64string):
# Guard against unicode strings, which base64 can't handle.
b64string = b64string.encode('ascii')
padded = b64string + '=' * (4 - len(b64string) % 4)
return base64.urlsafe_b64decode(padded)
def _json_encode(data):
return simplejson.dumps(data, separators = (',', ':'))
def make_signed_jwt(signer, payload):
"""Make a signed JWT.
See http://self-issued.info/docs/draft-jones-json-web-token.html.
Args:
signer: crypt.Signer, Cryptographic signer.
payload: dict, Dictionary of data to convert to JSON and then sign.
Returns:
string, The JWT for the payload.
"""
header = {'typ': 'JWT', 'alg': 'RS256'}
segments = [
_urlsafe_b64encode(_json_encode(header)),
_urlsafe_b64encode(_json_encode(payload)),
]
signing_input = '.'.join(segments)
signature = signer.sign(signing_input)
segments.append(_urlsafe_b64encode(signature))
logging.debug(str(segments))
return '.'.join(segments)
def verify_signed_jwt_with_certs(jwt, certs, audience):
"""Verify a JWT against public certs.
See http://self-issued.info/docs/draft-jones-json-web-token.html.
Args:
jwt: string, A JWT.
certs: dict, Dictionary where values of public keys in PEM format.
audience: string, The audience, 'aud', that this JWT should contain. If
None then the JWT's 'aud' parameter is not verified.
Returns:
dict, The deserialized JSON payload in the JWT.
Raises:
AppIdentityError if any checks are failed.
"""
segments = jwt.split('.')
if (len(segments) != 3):
raise AppIdentityError(
'Wrong number of segments in token: %s' % jwt)
signed = '%s.%s' % (segments[0], segments[1])
signature = _urlsafe_b64decode(segments[2])
# Parse token.
json_body = _urlsafe_b64decode(segments[1])
try:
parsed = simplejson.loads(json_body)
except:
raise AppIdentityError('Can\'t parse token: %s' % json_body)
# Check signature.
verified = False
for (keyname, pem) in certs.items():
verifier = Verifier.from_string(pem, True)
if (verifier.verify(signed, signature)):
verified = True
break
if not verified:
raise AppIdentityError('Invalid token signature: %s' % jwt)
# Check creation timestamp.
iat = parsed.get('iat')
if iat is None:
raise AppIdentityError('No iat field in token: %s' % json_body)
earliest = iat - CLOCK_SKEW_SECS
# Check expiration timestamp.
now = long(time.time())
exp = parsed.get('exp')
if exp is None:
raise AppIdentityError('No exp field in token: %s' % json_body)
if exp >= now + MAX_TOKEN_LIFETIME_SECS:
raise AppIdentityError(
'exp field too far in future: %s' % json_body)
latest = exp + CLOCK_SKEW_SECS
if now < earliest:
raise AppIdentityError('Token used too early, %d < %d: %s' %
(now, earliest, json_body))
if now > latest:
raise AppIdentityError('Token used too late, %d > %d: %s' %
(now, latest, json_body))
# Check audience.
if audience is not None:
aud = parsed.get('aud')
if aud is None:
raise AppIdentityError('No aud field in token: %s' % json_body)
if aud != audience:
raise AppIdentityError('Wrong recipient, %s != %s: %s' %
(aud, audience, json_body))
return parsed
| ajibawa-2023/Python-Code-Large/train/row_99170 | 86 | 244 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Import_L18_C0", "label": "base64 import base64", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0738, 0.0041, 0, 0.66, 0.0, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Import_L19_C0", "label": "hashlib import hashlib", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0779, 0.0041, 0, 0.66, 0.0625, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "hashlib", "arg_names": [], "import_names": ["hashlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hashlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Import_L20_C0", "label": "logging import logging", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0041, 0, 0.66, 0.125, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Import_L21_C0", "label": "time import time", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0861, 0.0041, 0, 0.66, 0.1875, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:ImportFrom_L23_C0", "label": "from OpenSSL import crypto", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0041, 0, 0.66, 0.25, 830, 0, 1, 0, 0, 830, 0, 0], "semantic": {"name": "OpenSSL", "arg_names": [], "import_names": ["crypto"], "rhs_call_name": "", "annotation": ""}, "snippet": "from OpenSSL import crypto"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:ImportFrom_L24_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0041, 0, 0.66, 0.3125, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L27_C0", "label": "CLOCK_SKEW_SECS =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.1107, 0.0041, 0, 0.66, 0.375, 647, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "CLOCK_SKEW_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLOCK_SKEW_SECS = 300 # 5 minutes in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L28_C0", "label": "AUTH_TOKEN_LIFETIME_SECS =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1148, 0.0041, 0, 0.66, 0.4375, 840, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "AUTH_TOKEN_LIFETIME_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "AUTH_TOKEN_LIFETIME_SECS = 300 # 5 minutes in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L29_C0", "label": "MAX_TOKEN_LIFETIME_SECS =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.1189, 0.0041, 0, 0.66, 0.5, 88, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_TOKEN_LIFETIME_SECS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MAX_TOKEN_LIFETIME_SECS = 86400 # 1 day in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L32_C0", "label": "AppIdentityError", "type": "class", "loc": [32, 33], "level": 0, "parent": null, "vector": [3, 0, 0.1332, 0.0082, 0, 0.66, 0.5625, 458, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "AppIdentityError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AppIdentityError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "label": "Verifier", "type": "class", "loc": [36, 83], "level": 0, "parent": null, "vector": [3, 0, 0.2439, 0.1967, 0, 0.66, 0.625, 73, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "Verifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Verifier(object):\n \"\"\"Verifies the signature on a message.\"\"\"\n\n def __init__(self, pubkey):\n \"\"\"Constructor.\n\n Args:\n pubkey, OpenSSL.crypto.PKey, The public key to verify with."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L37_C2", "label": "expression", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "vector": [8, 1, 0.1516, 0.0041, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies the signature on a message.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L39_C2", "label": "__init__", "type": "function", "loc": [39, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "vector": [2, 1, 0.1721, 0.0287, 1, 0.53, 0.3333, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "pubkey"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pubkey):\n \"\"\"Constructor.\n\n Args:\n pubkey, OpenSSL.crypto.PKey, The public key to verify with.\n \"\"\"\n self._pubkey = pubkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L39_C2", "vector": [8, 2, 0.1721, 0.0205, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n pubkey, OpenSSL.crypto.PKey, The public key to verify with.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L45_C4", "label": "self._pubkey =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L39_C2", "vector": [14, 2, 0.1844, 0.0041, 2, 0.2, 1.0, 849, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._pubkey", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._pubkey = pubkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L47_C2", "label": "verify", "type": "function", "loc": [47, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "vector": [2, 1, 0.2234, 0.0656, 1, 0.53, 0.6667, 422, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "verify", "arg_names": ["self", "message", "signature"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verify(self, message, signature):\n \"\"\"Verifies a message against a signature.\n\n Args:\n message: string, The message to verify.\n signature: string, The signature on the message.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L48_C4", "label": "expression", "type": "expression", "loc": [48, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L47_C2", "vector": [8, 2, 0.2152, 0.041, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verifies a message against a signature.\n\n Args:\n message: string, The message to verify.\n signature: string, The signature on the message.\n\n Returns:\n True if message was singed by the private key associated with the public"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "label": "try", "type": "try", "loc": [58, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L47_C2", "vector": [7, 2, 0.2459, 0.0205, 2, 0.15, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n crypto.verify(self._pubkey, signature, message, 'sha256')\n return True\n except:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L59_C6", "label": "verify()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "vector": [8, 3, 0.2418, 0.0041, 3, 0.28, 0.0, 422, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "verify", "arg_names": [], "import_names": [], "rhs_call_name": "verify", "annotation": ""}, "snippet": " crypto.verify(self._pubkey, signature, message, 'sha256')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L60_C6", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "vector": [13, 3, 0.2459, 0.0041, 3, 0.28, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L62_C6", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "vector": [13, 3, 0.2541, 0.0041, 3, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "label": "from_string", "type": "function", "loc": [65, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "vector": [2, 1, 0.3033, 0.0779, 1, 0.53, 1.0, 423, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "from_string", "arg_names": ["key_pem", "is_x509_cert"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_string(key_pem, is_x509_cert):\n \"\"\"Construct a Verified instance from a string.\n\n Args:\n key_pem: string, public key in PEM format.\n is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is\n expected to be an RSA key in PEM format.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L66_C4", "label": "expression", "type": "expression", "loc": [66, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "vector": [8, 2, 0.2951, 0.0533, 2, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Construct a Verified instance from a string.\n\n Args:\n key_pem: string, public key in PEM format.\n is_x509_cert: bool, True if key_pem is an X509 cert, otherwise it is\n expected to be an RSA key in PEM format.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L79_C4", "label": "if", "type": "if", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "vector": [4, 2, 0.3299, 0.0164, 2, 0.08, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_x509_cert:\n pubkey = crypto.load_certificate(crypto.FILETYPE_PEM, key_pem)\n else:\n pubkey = crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L80_C6", "label": "pubkey = load_certificate()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L79_C4", "vector": [14, 3, 0.3279, 0.0041, 3, 0.58, 0.0, 800, 3, 2, 0, 0, 645, 10, 1], "semantic": {"name": "pubkey", "arg_names": [], "import_names": [], "rhs_call_name": "load_certificate", "annotation": ""}, "snippet": " pubkey = crypto.load_certificate(crypto.FILETYPE_PEM, key_pem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L82_C6", "label": "pubkey = load_privatekey()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L79_C4", "vector": [14, 3, 0.3361, 0.0041, 3, 0.58, 1.0, 800, 3, 2, 0, 0, 341, 10, 1], "semantic": {"name": "pubkey", "arg_names": [], "import_names": [], "rhs_call_name": "load_privatekey", "annotation": ""}, "snippet": " pubkey = crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "vector": [13, 2, 0.3402, 0.0041, 2, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Verifier(pubkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "label": "Signer", "type": "class", "loc": [86, 123], "level": 0, "parent": null, "vector": [3, 0, 0.4283, 0.1557, 0, 0.66, 0.6875, 637, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "Signer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Signer(object):\n \"\"\"Signs messages with a private key.\"\"\"\n\n def __init__(self, pkey):\n \"\"\"Constructor.\n\n Args:\n pkey, OpenSSL.crypto.PKey, The private key to sign with."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L87_C2", "label": "expression", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "vector": [8, 1, 0.3566, 0.0041, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signs messages with a private key.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L89_C2", "label": "__init__", "type": "function", "loc": [89, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "vector": [2, 1, 0.377, 0.0287, 1, 0.67, 0.3333, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "pkey"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pkey):\n \"\"\"Constructor.\n\n Args:\n pkey, OpenSSL.crypto.PKey, The private key to sign with.\n \"\"\"\n self._key = pkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L90_C4", "label": "expression", "type": "expression", "loc": [90, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L89_C2", "vector": [8, 2, 0.377, 0.0205, 2, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n pkey, OpenSSL.crypto.PKey, The private key to sign with.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L95_C4", "label": "self._key =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L89_C2", "vector": [14, 2, 0.3893, 0.0041, 2, 0.71, 1.0, 449, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._key = pkey"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L97_C2", "label": "sign", "type": "function", "loc": [97, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "vector": [2, 1, 0.416, 0.041, 1, 0.67, 0.6667, 448, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "sign", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sign(self, message):\n \"\"\"Signs a message.\n\n Args:\n message: string, Message to be signed.\n\n Returns:\n string, The signature of the message for the given key."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L98_C4", "label": "expression", "type": "expression", "loc": [98, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L97_C2", "vector": [8, 2, 0.416, 0.0328, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signs a message.\n\n Args:\n message: string, Message to be signed.\n\n Returns:\n string, The signature of the message for the given key.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L97_C2", "vector": [13, 2, 0.4344, 0.0041, 2, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return crypto.sign(self._key, message, 'sha256')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "label": "from_string", "type": "function", "loc": [109, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "vector": [2, 1, 0.4754, 0.0615, 1, 0.67, 1.0, 423, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "from_string", "arg_names": ["key", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def from_string(key, password='notasecret'):\n \"\"\"Construct a Signer instance from a string.\n\n Args:\n key: string, private key in P12 format.\n password: string, password for the private key file.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "vector": [8, 2, 0.4734, 0.0492, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Construct a Signer instance from a string.\n\n Args:\n key: string, private key in P12 format.\n password: string, password for the private key file.\n\n Returns:\n Signer instance."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L122_C4", "label": "pkey = get_privatekey()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "vector": [14, 2, 0.5, 0.0041, 2, 0.36, 0.5, 788, 3, 0, 0, 0, 40, 10, 2], "semantic": {"name": "pkey", "arg_names": [], "import_names": [], "rhs_call_name": "get_privatekey", "annotation": ""}, "snippet": " pkey = crypto.load_pkcs12(key, password).get_privatekey()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L123_C4", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "vector": [13, 2, 0.5041, 0.0041, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Signer(pkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L126_C0", "label": "_urlsafe_b64encode", "type": "function", "loc": [126, 127], "level": 0, "parent": null, "vector": [2, 0, 0.5184, 0.0082, 0, 0.66, 0.75, 44, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_urlsafe_b64encode", "arg_names": ["raw_bytes"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _urlsafe_b64encode(raw_bytes):\n return base64.urlsafe_b64encode(raw_bytes).rstrip('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L127_C2", "label": "return", "type": "return", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L126_C0", "vector": [13, 1, 0.5205, 0.0041, 1, 0.58, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.urlsafe_b64encode(raw_bytes).rstrip('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "label": "_urlsafe_b64decode", "type": "function", "loc": [130, 134], "level": 0, "parent": null, "vector": [2, 0, 0.541, 0.0205, 0, 0.66, 0.8125, 388, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_urlsafe_b64decode", "arg_names": ["b64string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _urlsafe_b64decode(b64string):\n # Guard against unicode strings, which base64 can't handle.\n b64string = b64string.encode('ascii')\n padded = b64string + '=' * (4 - len(b64string) % 4)\n return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L132_C2", "label": "b64string = encode()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "vector": [14, 1, 0.541, 0.0041, 1, 0.89, 0.0, 502, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "b64string", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " b64string = b64string.encode('ascii')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L133_C2", "label": "padded =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "vector": [14, 1, 0.5451, 0.0041, 1, 0.89, 0.5, 54, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "padded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " padded = b64string + '=' * (4 - len(b64string) % 4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L134_C2", "label": "return", "type": "return", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "vector": [13, 1, 0.5492, 0.0041, 1, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.urlsafe_b64decode(padded)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L137_C0", "label": "_json_encode", "type": "function", "loc": [137, 138], "level": 0, "parent": null, "vector": [2, 0, 0.5635, 0.0082, 0, 0.66, 0.875, 738, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_json_encode", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _json_encode(data):\n return simplejson.dumps(data, separators = (',', ':'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L138_C2", "label": "return", "type": "return", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L137_C0", "vector": [13, 1, 0.5656, 0.0041, 1, 0.79, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.dumps(data, separators = (',', ':'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "label": "make_signed_jwt", "type": "function", "loc": [141, 166], "level": 0, "parent": null, "vector": [2, 0, 0.6291, 0.1066, 0, 0.66, 0.9375, 470, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "make_signed_jwt", "arg_names": ["signer", "payload"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_signed_jwt(signer, payload):\n \"\"\"Make a signed JWT.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n signer: crypt.Signer, Cryptographic signer.\n payload: dict, Dictionary of data to convert to JSON and then sign."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L142_C2", "label": "expression", "type": "expression", "loc": [142, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [8, 1, 0.6025, 0.0451, 1, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Make a signed JWT.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n signer: crypt.Signer, Cryptographic signer.\n payload: dict, Dictionary of data to convert to JSON and then sign.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L153_C2", "label": "header =", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [14, 1, 0.627, 0.0041, 1, 0.32, 0.1429, 481, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " header = {'typ': 'JWT', 'alg': 'RS256'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L155_C2", "label": "segments =", "type": "assigned_variable", "loc": [155, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [14, 1, 0.6414, 0.0164, 1, 0.32, 0.2857, 185, 0, 0, 0, 0, 0, 5, 4], "semantic": {"name": "segments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " segments = [\n _urlsafe_b64encode(_json_encode(header)),\n _urlsafe_b64encode(_json_encode(payload)),\n ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L159_C2", "label": "signing_input = join()", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [14, 1, 0.6516, 0.0041, 1, 0.32, 0.4286, 727, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "signing_input", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " signing_input = '.'.join(segments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L161_C2", "label": "signature = sign()", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [14, 1, 0.6598, 0.0041, 1, 0.32, 0.5714, 932, 3, 1, 0, 0, 448, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "sign", "annotation": ""}, "snippet": " signature = signer.sign(signing_input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L162_C2", "label": "append()", "type": "expression", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [8, 1, 0.6639, 0.0041, 1, 0.32, 0.7143, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " segments.append(_urlsafe_b64encode(signature))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L164_C2", "label": "debug()", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [8, 1, 0.6721, 0.0041, 1, 0.32, 0.8571, 924, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logging.debug(str(segments))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L166_C2", "label": "return", "type": "return", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "vector": [13, 1, 0.6803, 0.0041, 1, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '.'.join(segments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "label": "verify_signed_jwt_with_certs", "type": "function", "loc": [169, 244], "level": 0, "parent": null, "vector": [2, 0, 0.8463, 0.3115, 0, 0.66, 1.0, 604, 0, 3, 1, 0, 0, 0, 23], "semantic": {"name": "verify_signed_jwt_with_certs", "arg_names": ["jwt", "certs", "audience"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def verify_signed_jwt_with_certs(jwt, certs, audience):\n \"\"\"Verify a JWT against public certs.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n jwt: string, A JWT.\n certs: dict, Dictionary where values of public keys in PEM format."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L170_C2", "label": "expression", "type": "expression", "loc": [170, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [8, 1, 0.7275, 0.0656, 1, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verify a JWT against public certs.\n\n See http://self-issued.info/docs/draft-jones-json-web-token.html.\n\n Args:\n jwt: string, A JWT.\n certs: dict, Dictionary where values of public keys in PEM format.\n audience: string, The audience, 'aud', that this JWT should contain. If"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L186_C2", "label": "segments = split()", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.7623, 0.0041, 1, 0.7, 0.0476, 185, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "segments", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " segments = jwt.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L188_C2", "label": "if", "type": "if", "loc": [188, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.7746, 0.0123, 1, 0.7, 0.0952, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(segments) != 3):\n raise AppIdentityError(\n 'Wrong number of segments in token: %s' % jwt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L191_C2", "label": "signed =", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.7828, 0.0041, 1, 0.7, 0.1429, 756, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "signed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signed = '%s.%s' % (segments[0], segments[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L193_C2", "label": "signature = _urlsafe_b64decode()", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.791, 0.0041, 1, 0.7, 0.1905, 932, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "_urlsafe_b64decode", "annotation": ""}, "snippet": " signature = _urlsafe_b64decode(segments[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L196_C2", "label": "json_body = _urlsafe_b64decode()", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.8033, 0.0041, 1, 0.7, 0.2381, 958, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "json_body", "arg_names": [], "import_names": [], "rhs_call_name": "_urlsafe_b64decode", "annotation": ""}, "snippet": " json_body = _urlsafe_b64decode(segments[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L197_C2", "label": "try", "type": "try", "loc": [197, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [7, 1, 0.8135, 0.0164, 1, 0.7, 0.2857, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n parsed = simplejson.loads(json_body)\n except:\n raise AppIdentityError('Can\\'t parse token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L198_C4", "label": "parsed = loads()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L197_C2", "vector": [14, 2, 0.8115, 0.0041, 2, 0.23, 0.0, 313, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "parsed", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " parsed = simplejson.loads(json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L203_C2", "label": "verified =", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.832, 0.0041, 1, 0.7, 0.3333, 809, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "verified", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " verified = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:For_L204_C2", "label": "for keyname, pem", "type": "for", "loc": [204, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [6, 1, 0.8443, 0.0205, 1, 0.7, 0.381, 704, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "keyname, pem", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (keyname, pem) in certs.items():\n verifier = Verifier.from_string(pem, True)\n if (verifier.verify(signed, signature)):\n verified = True\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L205_C4", "label": "verifier = from_string()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:For_L204_C2", "vector": [14, 2, 0.8402, 0.0041, 2, 0.11, 0.0, 629, 3, 2, 0, 0, 423, 10, 1], "semantic": {"name": "verifier", "arg_names": [], "import_names": [], "rhs_call_name": "from_string", "annotation": ""}, "snippet": " verifier = Verifier.from_string(pem, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L206_C4", "label": "if", "type": "if", "loc": [206, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:For_L204_C2", "vector": [4, 2, 0.8484, 0.0123, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (verifier.verify(signed, signature)):\n verified = True\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L207_C6", "label": "verified =", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L206_C4", "vector": [14, 3, 0.8484, 0.0041, 3, 0.74, 0.0, 809, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "verified", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " verified = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L209_C2", "label": "if", "type": "if", "loc": [209, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.8586, 0.0082, 1, 0.7, 0.4286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not verified:\n raise AppIdentityError('Invalid token signature: %s' % jwt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L213_C2", "label": "iat = get()", "type": "assigned_variable", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.873, 0.0041, 1, 0.7, 0.4762, 710, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "iat", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " iat = parsed.get('iat')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L214_C2", "label": "if", "type": "if", "loc": [214, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.8791, 0.0082, 1, 0.7, 0.5238, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if iat is None:\n raise AppIdentityError('No iat field in token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L216_C2", "label": "earliest =", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.8852, 0.0041, 1, 0.7, 0.5714, 110, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "earliest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " earliest = iat - CLOCK_SKEW_SECS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L219_C2", "label": "now = long()", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.8975, 0.0041, 1, 0.7, 0.619, 894, 3, 1, 0, 0, 37, 10, 2], "semantic": {"name": "now", "arg_names": [], "import_names": [], "rhs_call_name": "long", "annotation": ""}, "snippet": " now = long(time.time())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L220_C2", "label": "exp = get()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.9016, 0.0041, 1, 0.7, 0.6667, 971, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "exp", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " exp = parsed.get('exp')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L221_C2", "label": "if", "type": "if", "loc": [221, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.9078, 0.0082, 1, 0.7, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exp is None:\n raise AppIdentityError('No exp field in token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L223_C2", "label": "if", "type": "if", "loc": [223, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.918, 0.0123, 1, 0.7, 0.7619, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exp >= now + MAX_TOKEN_LIFETIME_SECS:\n raise AppIdentityError(\n 'exp field too far in future: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L226_C2", "label": "latest =", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [14, 1, 0.9262, 0.0041, 1, 0.7, 0.8095, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "latest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " latest = exp + CLOCK_SKEW_SECS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L228_C2", "label": "if", "type": "if", "loc": [228, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.9385, 0.0123, 1, 0.7, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if now < earliest:\n raise AppIdentityError('Token used too early, %d < %d: %s' %\n (now, earliest, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L231_C2", "label": "if", "type": "if", "loc": [231, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.9508, 0.0123, 1, 0.7, 0.9048, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if now > latest:\n raise AppIdentityError('Token used too late, %d > %d: %s' %\n (now, latest, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "label": "if", "type": "if", "loc": [236, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [4, 1, 0.9795, 0.0287, 1, 0.7, 0.9524, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if audience is not None:\n aud = parsed.get('aud')\n if aud is None:\n raise AppIdentityError('No aud field in token: %s' % json_body)\n if aud != audience:\n raise AppIdentityError('Wrong recipient, %s != %s: %s' %\n (aud, audience, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L237_C4", "label": "aud = get()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "vector": [14, 2, 0.9713, 0.0041, 2, 0.08, 0.0, 490, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "aud", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " aud = parsed.get('aud')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L238_C4", "label": "if", "type": "if", "loc": [238, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "vector": [4, 2, 0.9775, 0.0082, 2, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if aud is None:\n raise AppIdentityError('No aud field in token: %s' % json_body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L240_C4", "label": "if", "type": "if", "loc": [240, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "vector": [4, 2, 0.9877, 0.0123, 2, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if aud != audience:\n raise AppIdentityError('Wrong recipient, %s != %s: %s' %\n (aud, audience, json_body))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L244_C2", "label": "return", "type": "return", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "vector": [13, 1, 1.0, 0.0041, 1, 0.7, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parsed"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L60_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L80_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L82_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L132_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L138_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L155_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L159_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L161_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Expr_L170_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L188_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L191_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L193_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L196_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L197_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:Try_L197_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L203_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:For_L204_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:For_L204_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:For_L204_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L207_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L209_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L216_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L219_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L231_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Assign_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L236_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:If_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99170:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99170:Return_L244_C2"}] |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for reading OAuth 2.0 client secret files.
A client_secrets.json file contains all the information needed to interact with
an OAuth 2.0 protected service.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
from anyjson import simplejson
# Properties that make a client_secrets.json file valid.
TYPE_WEB = 'web'
TYPE_INSTALLED = 'installed'
VALID_CLIENT = {
TYPE_WEB: {
'required': [
'client_id',
'client_secret',
'redirect_uris',
'auth_uri',
'token_uri'],
'string': [
'client_id',
'client_secret'
]
},
TYPE_INSTALLED: {
'required': [
'client_id',
'client_secret',
'redirect_uris',
'auth_uri',
'token_uri'],
'string': [
'client_id',
'client_secret'
]
}
}
class Error(Exception):
"""Base error for this module."""
pass
class InvalidClientSecretsError(Error):
"""Format of ClientSecrets file is invalid."""
pass
def _validate_clientsecrets(obj):
if obj is None or len(obj) != 1:
raise InvalidClientSecretsError('Invalid file format.')
client_type = obj.keys()[0]
if client_type not in VALID_CLIENT.keys():
raise InvalidClientSecretsError('Unknown client type: %s.' % client_type)
client_info = obj[client_type]
for prop_name in VALID_CLIENT[client_type]['required']:
if prop_name not in client_info:
raise InvalidClientSecretsError(
'Missing property "%s" in a client type of "%s".' % (prop_name,
client_type))
for prop_name in VALID_CLIENT[client_type]['string']:
if client_info[prop_name].startswith('[['):
raise InvalidClientSecretsError(
'Property "%s" is not configured.' % prop_name)
return client_type, client_info
def load(fp):
obj = simplejson.load(fp)
return _validate_clientsecrets(obj)
def loads(s):
obj = simplejson.loads(s)
return _validate_clientsecrets(obj)
def loadfile(filename):
try:
fp = file(filename, 'r')
try:
obj = simplejson.load(fp)
finally:
fp.close()
except IOError:
raise InvalidClientSecretsError('File not found: "%s"' % filename)
return _validate_clientsecrets(obj)
| ajibawa-2023/Python-Code-Large/train/row_99171 | 33 | 105 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1619, 0.0476, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for reading OAuth 2.0 client secret files.\n\nA client_secrets.json file contains all the information needed to interact with\nan OAuth 2.0 protected service.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0095, 0, 0.66, 0.0909, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:ImportFrom_L24_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.2286, 0.0095, 0, 0.66, 0.1818, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L27_C0", "label": "TYPE_WEB =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.2571, 0.0095, 0, 0.66, 0.2727, 350, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TYPE_WEB", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TYPE_WEB = 'web'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L28_C0", "label": "TYPE_INSTALLED =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2667, 0.0095, 0, 0.66, 0.3636, 412, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TYPE_INSTALLED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TYPE_INSTALLED = 'installed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L30_C0", "label": "VALID_CLIENT =", "type": "assigned_variable", "loc": [30, 55], "level": 0, "parent": null, "vector": [14, 0, 0.4048, 0.2476, 0, 0.66, 0.4545, 361, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "VALID_CLIENT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VALID_CLIENT = {\n TYPE_WEB: {\n 'required': [\n 'client_id',\n 'client_secret',\n 'redirect_uris',\n 'auth_uri',\n 'token_uri'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:ClassDef_L57_C0", "label": "Error", "type": "class", "loc": [57, 59], "level": 0, "parent": null, "vector": [3, 0, 0.5524, 0.0286, 0, 0.66, 0.5455, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L58_C2", "label": "expression", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:ClassDef_L57_C0", "vector": [8, 1, 0.5524, 0.0095, 1, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:ClassDef_L62_C0", "label": "InvalidClientSecretsError", "type": "class", "loc": [62, 64], "level": 0, "parent": null, "vector": [3, 0, 0.6, 0.0286, 0, 0.66, 0.6364, 481, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "InvalidClientSecretsError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidClientSecretsError(Error):\n \"\"\"Format of ClientSecrets file is invalid.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L63_C2", "label": "expression", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:ClassDef_L62_C0", "vector": [8, 1, 0.6, 0.0095, 1, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Format of ClientSecrets file is invalid.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "label": "_validate_clientsecrets", "type": "function", "loc": [67, 83], "level": 0, "parent": null, "vector": [2, 0, 0.7143, 0.1619, 0, 0.66, 0.7273, 852, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "_validate_clientsecrets", "arg_names": ["obj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _validate_clientsecrets(obj):\n if obj is None or len(obj) != 1:\n raise InvalidClientSecretsError('Invalid file format.')\n client_type = obj.keys()[0]\n if client_type not in VALID_CLIENT.keys():\n raise InvalidClientSecretsError('Unknown client type: %s.' % client_type)\n client_info = obj[client_type]\n for prop_name in VALID_CLIENT[client_type]['required']:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L68_C2", "label": "if", "type": "if", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [4, 1, 0.6524, 0.019, 1, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj is None or len(obj) != 1:\n raise InvalidClientSecretsError('Invalid file format.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L70_C2", "label": "client_type =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [14, 1, 0.6667, 0.0095, 1, 0.77, 0.1667, 130, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "client_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_type = obj.keys()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L71_C2", "label": "if", "type": "if", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [4, 1, 0.681, 0.019, 1, 0.77, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client_type not in VALID_CLIENT.keys():\n raise InvalidClientSecretsError('Unknown client type: %s.' % client_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L73_C2", "label": "client_info =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [14, 1, 0.6952, 0.0095, 1, 0.77, 0.5, 923, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "client_info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " client_info = obj[client_type]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L74_C2", "label": "for prop_name", "type": "for", "loc": [74, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [6, 1, 0.7238, 0.0476, 1, 0.77, 0.6667, 117, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "prop_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for prop_name in VALID_CLIENT[client_type]['required']:\n if prop_name not in client_info:\n raise InvalidClientSecretsError(\n 'Missing property \"%s\" in a client type of \"%s\".' % (prop_name,\n client_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L75_C4", "label": "if", "type": "if", "loc": [75, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L74_C2", "vector": [4, 2, 0.7286, 0.0381, 2, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prop_name not in client_info:\n raise InvalidClientSecretsError(\n 'Missing property \"%s\" in a client type of \"%s\".' % (prop_name,\n client_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L79_C2", "label": "for prop_name", "type": "for", "loc": [79, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [6, 1, 0.7667, 0.0381, 1, 0.77, 0.8333, 117, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "prop_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for prop_name in VALID_CLIENT[client_type]['string']:\n if client_info[prop_name].startswith('[['):\n raise InvalidClientSecretsError(\n 'Property \"%s\" is not configured.' % prop_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L80_C4", "label": "if", "type": "if", "loc": [80, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L79_C2", "vector": [4, 2, 0.7714, 0.0286, 2, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if client_info[prop_name].startswith('[['):\n raise InvalidClientSecretsError(\n 'Property \"%s\" is not configured.' % prop_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L83_C2", "label": "return", "type": "return", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "vector": [13, 1, 0.7905, 0.0095, 1, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return client_type, client_info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L86_C0", "label": "load", "type": "function", "loc": [86, 88], "level": 0, "parent": null, "vector": [2, 0, 0.8286, 0.0286, 0, 0.66, 0.8182, 37, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "load", "arg_names": ["fp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load(fp):\n obj = simplejson.load(fp)\n return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L87_C2", "label": "obj = load()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L86_C0", "vector": [14, 1, 0.8286, 0.0095, 1, 0.58, 0.0, 505, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " obj = simplejson.load(fp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L88_C2", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L86_C0", "vector": [13, 1, 0.8381, 0.0095, 1, 0.58, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L91_C0", "label": "loads", "type": "function", "loc": [91, 93], "level": 0, "parent": null, "vector": [2, 0, 0.8762, 0.0286, 0, 0.66, 0.9091, 88, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "loads", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def loads(s):\n obj = simplejson.loads(s)\n return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L92_C2", "label": "obj = loads()", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L91_C0", "vector": [14, 1, 0.8762, 0.0095, 1, 0.18, 0.0, 505, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " obj = simplejson.loads(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L93_C2", "label": "return", "type": "return", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L91_C0", "vector": [13, 1, 0.8857, 0.0095, 1, 0.18, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_clientsecrets(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L96_C0", "label": "loadfile", "type": "function", "loc": [96, 105], "level": 0, "parent": null, "vector": [2, 0, 0.9571, 0.0952, 0, 0.66, 1.0, 752, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "loadfile", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def loadfile(filename):\n try:\n fp = file(filename, 'r')\n try:\n obj = simplejson.load(fp)\n finally:\n fp.close()\n except IOError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L97_C2", "label": "try", "type": "try", "loc": [97, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L96_C0", "vector": [7, 1, 0.9571, 0.0762, 1, 0.57, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n fp = file(filename, 'r')\n try:\n obj = simplejson.load(fp)\n finally:\n fp.close()\n except IOError:\n raise InvalidClientSecretsError('File not found: \"%s\"' % filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L98_C4", "label": "fp = file()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L97_C2", "vector": [14, 2, 0.9333, 0.0095, 2, 0.06, 0.0, 392, 3, 2, 0, 0, 107, 10, 1], "semantic": {"name": "fp", "arg_names": [], "import_names": [], "rhs_call_name": "file", "annotation": ""}, "snippet": " fp = file(filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L99_C4", "label": "try", "type": "try", "loc": [99, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L97_C2", "vector": [7, 2, 0.9571, 0.0381, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n obj = simplejson.load(fp)\n finally:\n fp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L100_C6", "label": "obj = load()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L99_C4", "vector": [14, 3, 0.9524, 0.0095, 3, 0.02, 0.0, 505, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " obj = simplejson.load(fp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L102_C6", "label": "close()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L99_C4", "vector": [8, 3, 0.9714, 0.0095, 3, 0.02, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " fp.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L105_C2", "label": "return", "type": "return", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L96_C0", "vector": [13, 1, 1.0, 0.0095, 1, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _validate_clientsecrets(obj)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99171:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L74_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:For_L79_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Assign_L100_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:Try_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Expr_L102_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99171:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99171:Return_L105_C2"}] |
__version__ = "1.0c2"
| ajibawa-2023/Python-Code-Large/train/row_99173 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99173:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"1.0c2\""}] | [] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utility module to import a JSON module
Hides all the messy details of exactly where
we get a simplejson module from.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
try: # pragma: no cover
# Should work for Python2.6 and higher.
import json as simplejson
except ImportError: # pragma: no cover
try:
import simplejson
except ImportError:
# Try to import from django, should work on App Engine
from django.utils import simplejson
| ajibawa-2023/Python-Code-Large/train/row_99174 | 7 | 32 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99174:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.5312, 0.1562, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99174:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6562, 0.0312, 0, 0.66, 0.5, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L24_C0", "label": "try", "type": "try", "loc": [24, 32], "level": 0, "parent": null, "vector": [7, 0, 0.875, 0.2812, 0, 0.66, 1.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try: # pragma: no cover\n # Should work for Python2.6 and higher.\n import json as simplejson\nexcept ImportError: # pragma: no cover\n try:\n import simplejson\n except ImportError:\n # Try to import from django, should work on App Engine"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99174:Import_L26_C2", "label": "json import simplejson", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L24_C0", "vector": [1, 1, 0.8125, 0.0312, 1, 0.9, 0.0, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import json as simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L28_C2", "label": "try", "type": "try", "loc": [28, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L24_C0", "vector": [7, 1, 0.9375, 0.1562, 1, 0.9, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n import simplejson\n except ImportError:\n # Try to import from django, should work on App Engine\n from django.utils import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99174:Import_L29_C4", "label": "simplejson import simplejson", "type": "import", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L28_C2", "vector": [1, 2, 0.9062, 0.0312, 2, 0.6, 0.0, 386, 0, 1, 0, 0, 386, 0, 0], "semantic": {"name": "simplejson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99174:ImportFrom_L32_C4", "label": "from django.utils import simplejson", "type": "import", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L28_C2", "vector": [1, 2, 1.0, 0.0312, 2, 0.6, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils import simplejson"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99174:Import_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99174:Import_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99174:Try_L28_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99174:ImportFrom_L32_C4"}] |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licence, Version 2.0
# (http://www.apache.org/licenses/LICENSE-2.0.html).
#
# Example:
# from vendor.prayls.lilcookies import LilCookies
# cookieutil = LilCookies(self, application_settings['cookie_secret'])
# cookieutil.set_secure_cookie(name = 'mykey', value = 'myvalue', expires_days= 365*100)
# cookieutil.get_secure_cookie(name = 'mykey')
class LilCookies:
@staticmethod
def _utf8(s):
if isinstance(s, unicode):
return s.encode("utf-8")
assert isinstance(s, str)
return s
@staticmethod
def _time_independent_equals(a, b):
if len(a) != len(b):
return False
result = 0
for x, y in zip(a, b):
result |= ord(x) ^ ord(y)
return result == 0
@staticmethod
def _signature_from_secret(cookie_secret, *parts):
""" Takes a secret salt value to create a signature for values in the `parts` param."""
hash = hmac.new(cookie_secret, digestmod=hashlib.sha1)
for part in parts: hash.update(part)
return hash.hexdigest()
@staticmethod
def _signed_cookie_value(cookie_secret, name, value):
""" Returns a signed value for use in a cookie.
This is helpful to have in its own method if you need to re-use this function for other needs. """
timestamp = str(int(time.time()))
value = base64.b64encode(value)
signature = LilCookies._signature_from_secret(cookie_secret, name, value, timestamp)
return "|".join([value, timestamp, signature])
@staticmethod
def _verified_cookie_value(cookie_secret, name, signed_value):
"""Returns the un-encrypted value given the signed value if it validates, or None."""
value = signed_value
if not value: return None
parts = value.split("|")
if len(parts) != 3: return None
signature = LilCookies._signature_from_secret(cookie_secret, name, parts[0], parts[1])
if not LilCookies._time_independent_equals(parts[2], signature):
logging.warning("Invalid cookie signature %r", value)
return None
timestamp = int(parts[1])
if timestamp < time.time() - 31 * 86400:
logging.warning("Expired cookie %r", value)
return None
try:
return base64.b64decode(parts[0])
except:
return None
def __init__(self, handler, cookie_secret):
"""You must specify the cookie_secret to use any of the secure methods.
It should be a long, random sequence of bytes to be used as the HMAC
secret for the signature.
"""
if len(cookie_secret) < 45:
raise ValueError("LilCookies cookie_secret should at least be 45 characters long, but got `%s`" % cookie_secret)
self.handler = handler
self.request = handler.request
self.response = handler.response
self.cookie_secret = cookie_secret
def cookies(self):
"""A dictionary of Cookie.Morsel objects."""
if not hasattr(self, "_cookies"):
self._cookies = Cookie.BaseCookie()
if "Cookie" in self.request.headers:
try:
self._cookies.load(self.request.headers["Cookie"])
except:
self.clear_all_cookies()
return self._cookies
def get_cookie(self, name, default=None):
"""Gets the value of the cookie with the given name, else default."""
if name in self.cookies():
return self._cookies[name].value
return default
def set_cookie(self, name, value, domain=None, expires=None, path="/",
expires_days=None, **kwargs):
"""Sets the given cookie name/value with the given options.
Additional keyword arguments are set on the Cookie.Morsel
directly.
See http://docs.python.org/library/cookie.html#morsel-objects
for available attributes.
"""
name = LilCookies._utf8(name)
value = LilCookies._utf8(value)
if re.search(r"[\x00-\x20]", name + value):
# Don't let us accidentally inject bad stuff
raise ValueError("Invalid cookie %r: %r" % (name, value))
if not hasattr(self, "_new_cookies"):
self._new_cookies = []
new_cookie = Cookie.BaseCookie()
self._new_cookies.append(new_cookie)
new_cookie[name] = value
if domain:
new_cookie[name]["domain"] = domain
if expires_days is not None and not expires:
expires = datetime.datetime.utcnow() + datetime.timedelta(days=expires_days)
if expires:
timestamp = calendar.timegm(expires.utctimetuple())
new_cookie[name]["expires"] = email.utils.formatdate(
timestamp, localtime=False, usegmt=True)
if path:
new_cookie[name]["path"] = path
for k, v in kwargs.iteritems():
new_cookie[name][k] = v
# The 2 lines below were not in Tornado. Instead, they output all their cookies to the headers at once before a response flush.
for vals in new_cookie.values():
self.response.headers._headers.append(('Set-Cookie', vals.OutputString(None)))
def clear_cookie(self, name, path="/", domain=None):
"""Deletes the cookie with the given name."""
expires = datetime.datetime.utcnow() - datetime.timedelta(days=365)
self.set_cookie(name, value="", path=path, expires=expires,
domain=domain)
def clear_all_cookies(self):
"""Deletes all the cookies the user sent with this request."""
for name in self.cookies().iterkeys():
self.clear_cookie(name)
def set_secure_cookie(self, name, value, expires_days=30, **kwargs):
"""Signs and timestamps a cookie so it cannot be forged.
To read a cookie set with this method, use get_secure_cookie().
"""
value = LilCookies._signed_cookie_value(self.cookie_secret, name, value)
self.set_cookie(name, value, expires_days=expires_days, **kwargs)
def get_secure_cookie(self, name, value=None):
"""Returns the given signed cookie if it validates, or None."""
if value is None: value = self.get_cookie(name)
return LilCookies._verified_cookie_value(self.cookie_secret, name, value)
def _cookie_signature(self, *parts):
return LilCookies._signature_from_secret(self.cookie_secret)
| ajibawa-2023/Python-Code-Large/train/row_99175 | 115 | 168 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L1_C0", "label": "Cookie import Cookie", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.006, 0, 0.66, 0.0, 32, 0, 1, 0, 0, 32, 0, 0], "semantic": {"name": "Cookie", "arg_names": [], "import_names": ["Cookie"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Cookie"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L2_C0", "label": "datetime import datetime", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0119, 0.006, 0, 0.66, 0.1, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L3_C0", "label": "time import time", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0179, 0.006, 0, 0.66, 0.2, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L4_C0", "label": "email.utils import email.utils", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.006, 0, 0.66, 0.3, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "email.utils", "arg_names": [], "import_names": ["email.utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import email.utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L5_C0", "label": "calendar import calendar", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0298, 0.006, 0, 0.66, 0.4, 917, 0, 1, 0, 0, 917, 0, 0], "semantic": {"name": "calendar", "arg_names": [], "import_names": ["calendar"], "rhs_call_name": "", "annotation": ""}, "snippet": "import calendar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L6_C0", "label": "base64 import base64", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.006, 0, 0.66, 0.5, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L7_C0", "label": "hashlib import hashlib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.006, 0, 0.66, 0.6, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "hashlib", "arg_names": [], "import_names": ["hashlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hashlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L8_C0", "label": "hmac import hmac", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.006, 0, 0.66, 0.7, 993, 0, 1, 0, 0, 993, 0, 0], "semantic": {"name": "hmac", "arg_names": [], "import_names": ["hmac"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hmac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L9_C0", "label": "re import re", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0536, 0.006, 0, 0.66, 0.8, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Import_L10_C0", "label": "logging import logging", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.006, 0, 0.66, 0.9, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "label": "LilCookies", "type": "class", "loc": [23, 168], "level": 0, "parent": null, "vector": [3, 0, 0.5685, 0.869, 0, 0.66, 1.0, 220, 0, 14, 0, 0, 0, 0, 60], "semantic": {"name": "LilCookies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LilCookies:\n\n @staticmethod\n def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n assert isinstance(s, str)\n return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L26_C2", "label": "_utf8", "type": "function", "loc": [26, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.1667, 0.0298, 1, 0.29, 0.0, 587, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_utf8", "arg_names": ["s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _utf8(s):\n if isinstance(s, unicode):\n return s.encode(\"utf-8\")\n assert isinstance(s, str)\n return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L27_C4", "label": "if", "type": "if", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L26_C2", "vector": [4, 2, 0.1637, 0.0119, 2, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(s, unicode):\n return s.encode(\"utf-8\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L28_C6", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L27_C4", "vector": [13, 3, 0.1667, 0.006, 3, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s.encode(\"utf-8\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L30_C4", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L26_C2", "vector": [13, 2, 0.1786, 0.006, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "label": "_time_independent_equals", "type": "function", "loc": [33, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.2143, 0.0417, 1, 0.29, 0.0769, 816, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_time_independent_equals", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _time_independent_equals(a, b):\n if len(a) != len(b):\n return False\n result = 0\n for x, y in zip(a, b):\n result |= ord(x) ^ ord(y)\n return result == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L34_C4", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "vector": [4, 2, 0.2054, 0.0119, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(a) != len(b):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L35_C6", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L34_C4", "vector": [13, 3, 0.2083, 0.006, 3, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L36_C4", "label": "result =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "vector": [14, 2, 0.2143, 0.006, 2, 0.5, 0.3333, 51, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L37_C4", "label": "for x, y", "type": "for", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "vector": [6, 2, 0.2232, 0.0119, 2, 0.5, 0.6667, 855, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x, y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x, y in zip(a, b):\n result |= ord(x) ^ ord(y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "vector": [13, 2, 0.2321, 0.006, 2, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "label": "_signature_from_secret", "type": "function", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.2619, 0.0298, 1, 0.29, 0.1538, 916, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_signature_from_secret", "arg_names": ["cookie_secret", "parts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _signature_from_secret(cookie_secret, *parts):\n \"\"\" Takes a secret salt value to create a signature for values in the `parts` param.\"\"\"\n hash = hmac.new(cookie_secret, digestmod=hashlib.sha1)\n for part in parts: hash.update(part)\n return hash.hexdigest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "vector": [8, 2, 0.256, 0.006, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Takes a secret salt value to create a signature for values in the `parts` param.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L44_C4", "label": "hash = new()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "vector": [14, 2, 0.2619, 0.006, 2, 0.84, 0.3333, 58, 3, 2, 0, 0, 145, 10, 1], "semantic": {"name": "hash", "arg_names": [], "import_names": [], "rhs_call_name": "new", "annotation": ""}, "snippet": " hash = hmac.new(cookie_secret, digestmod=hashlib.sha1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L45_C4", "label": "for part", "type": "for", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "vector": [6, 2, 0.2679, 0.006, 2, 0.84, 0.6667, 374, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "part", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for part in parts: hash.update(part)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L45_C23", "label": "update()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L45_C4", "vector": [8, 3, 0.2679, 0.006, 3, 0.42, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " for part in parts: hash.update(part)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L46_C4", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "vector": [13, 2, 0.2738, 0.006, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hash.hexdigest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "label": "_signed_cookie_value", "type": "function", "loc": [49, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.3125, 0.0476, 1, 0.29, 0.2308, 862, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_signed_cookie_value", "arg_names": ["cookie_secret", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _signed_cookie_value(cookie_secret, name, value):\n \"\"\" Returns a signed value for use in a cookie.\n\n This is helpful to have in its own method if you need to re-use this function for other needs. \"\"\"\n timestamp = str(int(time.time()))\n value = base64.b64encode(value)\n signature = LilCookies._signature_from_secret(cookie_secret, name, value, timestamp)\n return \"|\".join([value, timestamp, signature])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L50_C4", "label": "expression", "type": "expression", "loc": [50, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "vector": [8, 2, 0.3036, 0.0179, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Returns a signed value for use in a cookie.\n\n This is helpful to have in its own method if you need to re-use this function for other needs. \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L53_C4", "label": "timestamp = str()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "vector": [14, 2, 0.3155, 0.006, 2, 0.66, 0.25, 834, 3, 1, 0, 0, 52, 10, 3], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " timestamp = str(int(time.time()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L54_C4", "label": "value = b64encode()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "vector": [14, 2, 0.3214, 0.006, 2, 0.66, 0.5, 441, 3, 1, 0, 0, 11, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "b64encode", "annotation": ""}, "snippet": " value = base64.b64encode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L55_C4", "label": "signature = _signature_from_secret()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "vector": [14, 2, 0.3274, 0.006, 2, 0.66, 0.75, 932, 3, 4, 0, 0, 916, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "_signature_from_secret", "annotation": ""}, "snippet": " signature = LilCookies._signature_from_secret(cookie_secret, name, value, timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "vector": [13, 2, 0.3333, 0.006, 2, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"|\".join([value, timestamp, signature])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "label": "_verified_cookie_value", "type": "function", "loc": [59, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.4018, 0.1071, 1, 0.29, 0.3077, 276, 0, 3, 1, 0, 0, 0, 9], "semantic": {"name": "_verified_cookie_value", "arg_names": ["cookie_secret", "name", "signed_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _verified_cookie_value(cookie_secret, name, signed_value):\n \"\"\"Returns the un-encrypted value given the signed value if it validates, or None.\"\"\"\n value = signed_value\n if not value: return None\n parts = value.split(\"|\")\n if len(parts) != 3: return None\n signature = LilCookies._signature_from_secret(cookie_secret, name, parts[0], parts[1])\n if not LilCookies._time_independent_equals(parts[2], signature):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L60_C4", "label": "expression", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [8, 2, 0.3571, 0.006, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the un-encrypted value given the signed value if it validates, or None.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L61_C4", "label": "value =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [14, 2, 0.3631, 0.006, 2, 0.87, 0.1111, 441, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = signed_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L62_C4", "label": "if", "type": "if", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [4, 2, 0.369, 0.006, 2, 0.87, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L62_C18", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L62_C4", "vector": [13, 3, 0.369, 0.006, 3, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L63_C4", "label": "parts = split()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [14, 2, 0.375, 0.006, 2, 0.87, 0.3333, 13, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = value.split(\"|\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L64_C4", "label": "if", "type": "if", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [4, 2, 0.381, 0.006, 2, 0.87, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(parts) != 3: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L64_C24", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L64_C4", "vector": [13, 3, 0.381, 0.006, 3, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(parts) != 3: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L65_C4", "label": "signature = _signature_from_secret()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [14, 2, 0.3869, 0.006, 2, 0.87, 0.5556, 932, 3, 4, 0, 0, 916, 10, 1], "semantic": {"name": "signature", "arg_names": [], "import_names": [], "rhs_call_name": "_signature_from_secret", "annotation": ""}, "snippet": " signature = LilCookies._signature_from_secret(cookie_secret, name, parts[0], parts[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L66_C4", "label": "if", "type": "if", "loc": [66, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [4, 2, 0.3988, 0.0179, 2, 0.87, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not LilCookies._time_independent_equals(parts[2], signature):\n logging.warning(\"Invalid cookie signature %r\", value)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L67_C6", "label": "warning()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L66_C4", "vector": [8, 3, 0.3988, 0.006, 3, 0.88, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": " logging.warning(\"Invalid cookie signature %r\", value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L68_C6", "label": "return", "type": "return", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L66_C4", "vector": [13, 3, 0.4048, 0.006, 3, 0.88, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L69_C4", "label": "timestamp = int()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [14, 2, 0.4107, 0.006, 2, 0.87, 0.7778, 834, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " timestamp = int(parts[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L70_C4", "label": "if", "type": "if", "loc": [70, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [4, 2, 0.4226, 0.0179, 2, 0.87, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestamp < time.time() - 31 * 86400:\n logging.warning(\"Expired cookie %r\", value)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L71_C6", "label": "warning()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L70_C4", "vector": [8, 3, 0.4226, 0.006, 3, 0.65, 0.0, 320, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warning", "arg_names": [], "import_names": [], "rhs_call_name": "warning", "annotation": ""}, "snippet": " logging.warning(\"Expired cookie %r\", value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L72_C6", "label": "return", "type": "return", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L70_C4", "vector": [13, 3, 0.4286, 0.006, 3, 0.65, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L73_C4", "label": "try", "type": "try", "loc": [73, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "vector": [7, 2, 0.4435, 0.0238, 2, 0.87, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return base64.b64decode(parts[0])\n except:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L74_C6", "label": "return", "type": "return", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L73_C4", "vector": [13, 3, 0.4405, 0.006, 3, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64decode(parts[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L76_C6", "label": "return", "type": "return", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L73_C4", "vector": [13, 3, 0.4524, 0.006, 3, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "label": "__init__", "type": "function", "loc": [78, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.494, 0.0655, 1, 0.29, 0.3846, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "handler", "cookie_secret"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, handler, cookie_secret):\n \"\"\"You must specify the cookie_secret to use any of the secure methods.\n It should be a long, random sequence of bytes to be used as the HMAC\n secret for the signature.\n \"\"\"\n if len(cookie_secret) < 45:\n raise ValueError(\"LilCookies cookie_secret should at least be 45 characters long, but got `%s`\" % cookie_secret)\n self.handler = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "vector": [8, 2, 0.4792, 0.0238, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"You must specify the cookie_secret to use any of the secure methods.\n It should be a long, random sequence of bytes to be used as the HMAC\n secret for the signature.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L83_C4", "label": "if", "type": "if", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "vector": [4, 2, 0.497, 0.0119, 2, 0.56, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(cookie_secret) < 45:\n raise ValueError(\"LilCookies cookie_secret should at least be 45 characters long, but got `%s`\" % cookie_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L85_C4", "label": "self.handler =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "vector": [14, 2, 0.506, 0.006, 2, 0.56, 0.4, 668, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.handler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.handler = handler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L86_C4", "label": "self.request =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "vector": [14, 2, 0.5119, 0.006, 2, 0.56, 0.6, 952, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.request = handler.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L87_C4", "label": "self.response =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "vector": [14, 2, 0.5179, 0.006, 2, 0.56, 0.8, 498, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.response = handler.response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L88_C4", "label": "self.cookie_secret =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "vector": [14, 2, 0.5238, 0.006, 2, 0.56, 1.0, 852, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cookie_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cookie_secret = cookie_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "label": "cookies", "type": "function", "loc": [90, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.5625, 0.0595, 1, 0.29, 0.4615, 711, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "cookies", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cookies(self):\n \"\"\"A dictionary of Cookie.Morsel objects.\"\"\"\n if not hasattr(self, \"_cookies\"):\n self._cookies = Cookie.BaseCookie()\n if \"Cookie\" in self.request.headers:\n try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L91_C4", "label": "expression", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "vector": [8, 2, 0.5417, 0.006, 2, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A dictionary of Cookie.Morsel objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L92_C4", "label": "if", "type": "if", "loc": [92, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "vector": [4, 2, 0.5655, 0.0417, 2, 0.58, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, \"_cookies\"):\n self._cookies = Cookie.BaseCookie()\n if \"Cookie\" in self.request.headers:\n try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:\n self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L93_C6", "label": "self._cookies = BaseCookie()", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L92_C4", "vector": [14, 3, 0.5536, 0.006, 3, 0.33, 0.0, 598, 3, 0, 0, 0, 884, 10, 1], "semantic": {"name": "self._cookies", "arg_names": [], "import_names": [], "rhs_call_name": "BaseCookie", "annotation": ""}, "snippet": " self._cookies = Cookie.BaseCookie()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L94_C6", "label": "if", "type": "if", "loc": [94, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L92_C4", "vector": [4, 3, 0.5714, 0.0298, 3, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"Cookie\" in self.request.headers:\n try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:\n self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L95_C8", "label": "try", "type": "try", "loc": [95, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L94_C6", "vector": [7, 4, 0.5744, 0.0238, 4, 0.34, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._cookies.load(self.request.headers[\"Cookie\"])\n except:\n self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L96_C10", "label": "load()", "type": "expression", "loc": [96, 96], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L95_C8", "vector": [8, 5, 0.5714, 0.006, 5, 0.63, 0.0, 37, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " self._cookies.load(self.request.headers[\"Cookie\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L98_C10", "label": "clear_all_cookies()", "type": "expression", "loc": [98, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L95_C8", "vector": [8, 5, 0.5833, 0.006, 5, 0.63, 0.0, 342, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_all_cookies", "arg_names": [], "import_names": [], "rhs_call_name": "clear_all_cookies", "annotation": ""}, "snippet": " self.clear_all_cookies()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L99_C4", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "vector": [13, 2, 0.5893, 0.006, 2, 0.58, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._cookies"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "label": "get_cookie", "type": "function", "loc": [101, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.6131, 0.0298, 1, 0.29, 0.5385, 678, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_cookie", "arg_names": ["self", "name", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cookie(self, name, default=None):\n \"\"\"Gets the value of the cookie with the given name, else default.\"\"\"\n if name in self.cookies():\n return self._cookies[name].value\n return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L102_C4", "label": "expression", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "vector": [8, 2, 0.6071, 0.006, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Gets the value of the cookie with the given name, else default.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L103_C4", "label": "if", "type": "if", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "vector": [4, 2, 0.6161, 0.0119, 2, 0.27, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in self.cookies():\n return self._cookies[name].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L104_C6", "label": "return", "type": "return", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L103_C4", "vector": [13, 3, 0.619, 0.006, 3, 0.81, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._cookies[name].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L105_C4", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "vector": [13, 2, 0.625, 0.006, 2, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "label": "set_cookie", "type": "function", "loc": [107, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.7381, 0.2083, 1, 0.29, 0.6154, 146, 0, 8, 0, 0, 0, 0, 16], "semantic": {"name": "set_cookie", "arg_names": ["self", "name", "value", "domain", "expires", "path", "expires_days", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cookie(self, name, value, domain=None, expires=None, path=\"/\",\n expires_days=None, **kwargs):\n \"\"\"Sets the given cookie name/value with the given options.\n\n Additional keyword arguments are set on the Cookie.Morsel\n directly.\n See http://docs.python.org/library/cookie.html#morsel-objects\n for available attributes."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L109_C4", "label": "expression", "type": "expression", "loc": [109, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [8, 2, 0.6667, 0.0417, 2, 0.73, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets the given cookie name/value with the given options.\n\n Additional keyword arguments are set on the Cookie.Morsel\n directly.\n See http://docs.python.org/library/cookie.html#morsel-objects\n for available attributes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L116_C4", "label": "name = _utf8()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [14, 2, 0.6905, 0.006, 2, 0.73, 0.0769, 57, 3, 1, 0, 0, 587, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "_utf8", "annotation": ""}, "snippet": " name = LilCookies._utf8(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L117_C4", "label": "value = _utf8()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [14, 2, 0.6964, 0.006, 2, 0.73, 0.1538, 441, 3, 1, 0, 0, 587, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_utf8", "annotation": ""}, "snippet": " value = LilCookies._utf8(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L118_C4", "label": "if", "type": "if", "loc": [118, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [4, 2, 0.7083, 0.0179, 2, 0.73, 0.2308, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.search(r\"[\\x00-\\x20]\", name + value):\n # Don't let us accidentally inject bad stuff\n raise ValueError(\"Invalid cookie %r: %r\" % (name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L121_C4", "label": "if", "type": "if", "loc": [121, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [4, 2, 0.7232, 0.0119, 2, 0.73, 0.3077, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, \"_new_cookies\"):\n self._new_cookies = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L122_C6", "label": "self._new_cookies =", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L121_C4", "vector": [14, 3, 0.7262, 0.006, 3, 0.09, 0.0, 20, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._new_cookies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._new_cookies = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L123_C4", "label": "new_cookie = BaseCookie()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [14, 2, 0.7321, 0.006, 2, 0.73, 0.3846, 512, 3, 0, 0, 0, 884, 10, 1], "semantic": {"name": "new_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "BaseCookie", "annotation": ""}, "snippet": " new_cookie = Cookie.BaseCookie()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L124_C4", "label": "append()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [8, 2, 0.7381, 0.006, 2, 0.73, 0.4615, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._new_cookies.append(new_cookie)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L125_C4", "label": "assign", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [14, 2, 0.744, 0.006, 2, 0.73, 0.5385, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L126_C4", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [4, 2, 0.753, 0.0119, 2, 0.73, 0.6154, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if domain:\n new_cookie[name][\"domain\"] = domain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L127_C6", "label": "assign", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L126_C4", "vector": [14, 3, 0.756, 0.006, 3, 0.24, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name][\"domain\"] = domain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L128_C4", "label": "if", "type": "if", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [4, 2, 0.7649, 0.0119, 2, 0.73, 0.6923, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expires_days is not None and not expires:\n expires = datetime.datetime.utcnow() + datetime.timedelta(days=expires_days)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L129_C6", "label": "expires =", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L128_C4", "vector": [14, 3, 0.7679, 0.006, 3, 0.19, 0.0, 741, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "expires", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expires = datetime.datetime.utcnow() + datetime.timedelta(days=expires_days)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L130_C4", "label": "if", "type": "if", "loc": [130, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [4, 2, 0.7827, 0.0238, 2, 0.73, 0.7692, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expires:\n timestamp = calendar.timegm(expires.utctimetuple())\n new_cookie[name][\"expires\"] = email.utils.formatdate(\n timestamp, localtime=False, usegmt=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L131_C6", "label": "timestamp = timegm()", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L130_C4", "vector": [14, 3, 0.7798, 0.006, 3, 0.33, 0.0, 834, 3, 1, 0, 0, 109, 10, 2], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "timegm", "annotation": ""}, "snippet": " timestamp = calendar.timegm(expires.utctimetuple())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L132_C6", "label": " = formatdate()", "type": "assigned_variable", "loc": [132, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L130_C4", "vector": [14, 3, 0.7887, 0.0119, 3, 0.33, 1.0, 0, 3, 3, 0, 0, 722, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "formatdate", "annotation": ""}, "snippet": " new_cookie[name][\"expires\"] = email.utils.formatdate(\n timestamp, localtime=False, usegmt=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L134_C4", "label": "if", "type": "if", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [4, 2, 0.8006, 0.0119, 2, 0.73, 0.8462, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path:\n new_cookie[name][\"path\"] = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L135_C6", "label": "assign", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L134_C4", "vector": [14, 3, 0.8036, 0.006, 3, 0.72, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name][\"path\"] = path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L136_C4", "label": "for k, v", "type": "for", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [6, 2, 0.8125, 0.0119, 2, 0.73, 0.9231, 867, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k, v in kwargs.iteritems():\n new_cookie[name][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L137_C6", "label": "assign", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L136_C4", "vector": [14, 3, 0.8155, 0.006, 3, 0.59, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cookie[name][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L140_C4", "label": "for vals", "type": "for", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "vector": [6, 2, 0.8363, 0.0119, 2, 0.73, 1.0, 17, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "vals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for vals in new_cookie.values():\n self.response.headers._headers.append(('Set-Cookie', vals.OutputString(None)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L141_C6", "label": "append()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L140_C4", "vector": [8, 3, 0.8393, 0.006, 3, 0.79, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.response.headers._headers.append(('Set-Cookie', vals.OutputString(None)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "label": "clear_cookie", "type": "function", "loc": [143, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.8631, 0.0298, 1, 0.29, 0.6923, 145, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "clear_cookie", "arg_names": ["self", "name", "path", "domain"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_cookie(self, name, path=\"/\", domain=None):\n \"\"\"Deletes the cookie with the given name.\"\"\"\n expires = datetime.datetime.utcnow() - datetime.timedelta(days=365)\n self.set_cookie(name, value=\"\", path=path, expires=expires,\n domain=domain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L144_C4", "label": "expression", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "vector": [8, 2, 0.8571, 0.006, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Deletes the cookie with the given name.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L145_C4", "label": "expires =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "vector": [14, 2, 0.8631, 0.006, 2, 0.47, 0.5, 741, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "expires", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expires = datetime.datetime.utcnow() - datetime.timedelta(days=365)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L146_C4", "label": "set_cookie()", "type": "expression", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "vector": [8, 2, 0.872, 0.0119, 2, 0.47, 1.0, 146, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "set_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_cookie", "annotation": ""}, "snippet": " self.set_cookie(name, value=\"\", path=path, expires=expires,\n domain=domain)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L149_C2", "label": "clear_all_cookies", "type": "function", "loc": [149, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.8958, 0.0238, 1, 0.29, 0.7692, 342, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "clear_all_cookies", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_all_cookies(self):\n \"\"\"Deletes all the cookies the user sent with this request.\"\"\"\n for name in self.cookies().iterkeys():\n self.clear_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L149_C2", "vector": [8, 2, 0.8929, 0.006, 2, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Deletes all the cookies the user sent with this request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L151_C4", "label": "for name", "type": "for", "loc": [151, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L149_C2", "vector": [6, 2, 0.9018, 0.0119, 2, 0.1, 1.0, 57, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self.cookies().iterkeys():\n self.clear_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L152_C6", "label": "clear_cookie()", "type": "expression", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L151_C4", "vector": [8, 3, 0.9048, 0.006, 3, 0.88, 0.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clear_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "clear_cookie", "annotation": ""}, "snippet": " self.clear_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "label": "set_secure_cookie", "type": "function", "loc": [154, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.9345, 0.0417, 1, 0.29, 0.8462, 330, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "set_secure_cookie", "arg_names": ["self", "name", "value", "expires_days", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_secure_cookie(self, name, value, expires_days=30, **kwargs):\n \"\"\"Signs and timestamps a cookie so it cannot be forged.\n\n To read a cookie set with this method, use get_secure_cookie().\n \"\"\"\n value = LilCookies._signed_cookie_value(self.cookie_secret, name, value)\n self.set_cookie(name, value, expires_days=expires_days, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L155_C4", "label": "expression", "type": "expression", "loc": [155, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "vector": [8, 2, 0.9315, 0.0238, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signs and timestamps a cookie so it cannot be forged.\n\n To read a cookie set with this method, use get_secure_cookie().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L159_C4", "label": "value = _signed_cookie_value()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "vector": [14, 2, 0.9464, 0.006, 2, 0.38, 0.5, 441, 3, 3, 0, 0, 862, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_signed_cookie_value", "annotation": ""}, "snippet": " value = LilCookies._signed_cookie_value(self.cookie_secret, name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L160_C4", "label": "set_cookie()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "vector": [8, 2, 0.9524, 0.006, 2, 0.38, 1.0, 146, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_cookie", "arg_names": [], "import_names": [], "rhs_call_name": "set_cookie", "annotation": ""}, "snippet": " self.set_cookie(name, value, expires_days=expires_days, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "label": "get_secure_cookie", "type": "function", "loc": [162, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.9732, 0.0238, 1, 0.29, 0.9231, 71, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_secure_cookie", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_secure_cookie(self, name, value=None):\n \"\"\"Returns the given signed cookie if it validates, or None.\"\"\"\n if value is None: value = self.get_cookie(name)\n return LilCookies._verified_cookie_value(self.cookie_secret, name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L163_C4", "label": "expression", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "vector": [8, 2, 0.9702, 0.006, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the given signed cookie if it validates, or None.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L164_C4", "label": "if", "type": "if", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "vector": [4, 2, 0.9762, 0.006, 2, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = self.get_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L164_C22", "label": "value = get_cookie()", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L164_C4", "vector": [14, 3, 0.9762, 0.006, 3, 0.32, 0.0, 441, 3, 1, 0, 0, 678, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get_cookie", "annotation": ""}, "snippet": " if value is None: value = self.get_cookie(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L165_C4", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "vector": [13, 2, 0.9821, 0.006, 2, 0.94, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return LilCookies._verified_cookie_value(self.cookie_secret, name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L167_C2", "label": "_cookie_signature", "type": "function", "loc": [167, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "vector": [2, 1, 0.997, 0.0119, 1, 0.29, 1.0, 847, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_cookie_signature", "arg_names": ["self", "parts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _cookie_signature(self, *parts):\n return LilCookies._signature_from_secret(self.cookie_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L168_C4", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L167_C2", "vector": [13, 2, 1.0, 0.006, 2, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return LilCookies._signature_from_secret(self.cookie_secret)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L28_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L35_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L45_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L49_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L62_C18"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L64_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L67_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L68_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L71_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L72_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L74_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L76_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L93_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L94_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L94_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L96_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:Try_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L98_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L90_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L122_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L127_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L129_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L131_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L132_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L135_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L141_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L143_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L149_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L149_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:For_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L152_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Assign_L164_C22"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L167_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99175:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99175:Return_L168_C4"}] |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
Contents:
- parse_mime_type(): Parses a mime-type into its component parts.
- parse_media_range(): Media-ranges are mime-types with wild-cards and a 'q'
quality parameter.
- quality(): Determines the quality ('q') of a mime-type when
compared against a list of media-ranges.
- quality_parsed(): Just like quality() except the second parameter must be
pre-parsed.
- best_match(): Choose the mime-type with the highest quality ('q')
from a list of candidates.
"""
__version__ = '0.1.3'
__author__ = 'Joe Gregorio'
__email__ = 'joe@bitworking.org'
__license__ = 'MIT License'
__credits__ = ''
def parse_mime_type(mime_type):
"""Parses a mime-type into its component parts.
Carves up a mime-type and returns a tuple of the (type, subtype, params)
where 'params' is a dictionary of all the parameters for the media range.
For example, the media range 'application/xhtml;q=0.5' would get parsed
into:
('application', 'xhtml', {'q', '0.5'})
"""
parts = mime_type.split(';')
params = dict([tuple([s.strip() for s in param.split('=', 1)])\
for param in parts[1:]
])
full_type = parts[0].strip()
# Java URLConnection class sends an Accept header that includes a
# single '*'. Turn it into a legal wildcard.
if full_type == '*':
full_type = '*/*'
(type, subtype) = full_type.split('/')
return (type.strip(), subtype.strip(), params)
def parse_media_range(range):
"""Parse a media-range into its component parts.
Carves up a media range and returns a tuple of the (type, subtype,
params) where 'params' is a dictionary of all the parameters for the media
range. For example, the media range 'application/*;q=0.5' would get parsed
into:
('application', '*', {'q', '0.5'})
In addition this function also guarantees that there is a value for 'q'
in the params dictionary, filling it in with a proper default if
necessary.
"""
(type, subtype, params) = parse_mime_type(range)
if not params.has_key('q') or not params['q'] or \
not float(params['q']) or float(params['q']) > 1\
or float(params['q']) < 0:
params['q'] = '1'
return (type, subtype, params)
def fitness_and_quality_parsed(mime_type, parsed_ranges):
"""Find the best match for a mime-type amongst parsed media-ranges.
Find the best match for a given mime-type against a list of media_ranges
that have already been parsed by parse_media_range(). Returns a tuple of
the fitness value and the value of the 'q' quality parameter of the best
match, or (-1, 0) if no match was found. Just as for quality_parsed(),
'parsed_ranges' must be a list of parsed media ranges.
"""
best_fitness = -1
best_fit_q = 0
(target_type, target_subtype, target_params) =\
parse_media_range(mime_type)
for (type, subtype, params) in parsed_ranges:
type_match = (type == target_type or\
type == '*' or\
target_type == '*')
subtype_match = (subtype == target_subtype or\
subtype == '*' or\
target_subtype == '*')
if type_match and subtype_match:
param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \
target_params.iteritems() if key != 'q' and \
params.has_key(key) and value == params[key]], 0)
fitness = (type == target_type) and 100 or 0
fitness += (subtype == target_subtype) and 10 or 0
fitness += param_matches
if fitness > best_fitness:
best_fitness = fitness
best_fit_q = params['q']
return best_fitness, float(best_fit_q)
def quality_parsed(mime_type, parsed_ranges):
"""Find the best match for a mime-type amongst parsed media-ranges.
Find the best match for a given mime-type against a list of media_ranges
that have already been parsed by parse_media_range(). Returns the 'q'
quality parameter of the best match, 0 if no match was found. This function
bahaves the same as quality() except that 'parsed_ranges' must be a list of
parsed media ranges.
"""
return fitness_and_quality_parsed(mime_type, parsed_ranges)[1]
def quality(mime_type, ranges):
"""Return the quality ('q') of a mime-type against a list of media-ranges.
Returns the quality 'q' of a mime-type when compared against the
media-ranges in ranges. For example:
>>> quality('text/html','text/*;q=0.3, text/html;q=0.7,
text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')
0.7
"""
parsed_ranges = [parse_media_range(r) for r in ranges.split(',')]
return quality_parsed(mime_type, parsed_ranges)
def best_match(supported, header):
"""Return mime-type with the highest quality ('q') from list of candidates.
Takes a list of supported mime-types and finds the best match for all the
media-ranges listed in header. The value of header must be a string that
conforms to the format of the HTTP Accept: header. The value of 'supported'
is a list of mime-types. The list of supported mime-types should be sorted
in order of increasing desirability, in case of a situation where there is
a tie.
>>> best_match(['application/xbel+xml', 'text/xml'],
'text/*;q=0.5,*/*; q=0.1')
'text/xml'
"""
split_header = _filter_blank(header.split(','))
parsed_header = [parse_media_range(r) for r in split_header]
weighted_matches = []
pos = 0
for mime_type in supported:
weighted_matches.append((fitness_and_quality_parsed(mime_type,
parsed_header), pos, mime_type))
pos += 1
weighted_matches.sort()
return weighted_matches[-1][0][1] and weighted_matches[-1][2] or ''
def _filter_blank(i):
for s in i:
if s.strip():
yield s
| ajibawa-2023/Python-Code-Large/train/row_99176 | 57 | 172 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L5_C0", "label": "expression", "type": "expression", "loc": [5, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0814, 0.1105, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"MIME-Type Parser\n\nThis module provides basic functions for handling mime-types. It can handle\nmatching mime-types against a list of media-ranges. See section 14.1 of the\nHTTP specification [RFC 2616] for a complete explanation.\n\n http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L25_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.1453, 0.0058, 0, 0.66, 0.0833, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = '0.1.3'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L26_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.1512, 0.0058, 0, 0.66, 0.1667, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'Joe Gregorio'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L27_C0", "label": "__email__ =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.157, 0.0058, 0, 0.66, 0.25, 424, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__email__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__email__ = 'joe@bitworking.org'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L28_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1628, 0.0058, 0, 0.66, 0.3333, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = 'MIT License'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L29_C0", "label": "__credits__ =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.1686, 0.0058, 0, 0.66, 0.4167, 451, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__credits__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__credits__ = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "label": "parse_mime_type", "type": "function", "loc": [32, 53], "level": 0, "parent": null, "vector": [2, 0, 0.2471, 0.1279, 0, 0.66, 0.5, 191, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "parse_mime_type", "arg_names": ["mime_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_mime_type(mime_type):\n \"\"\"Parses a mime-type into its component parts.\n\n Carves up a mime-type and returns a tuple of the (type, subtype, params)\n where 'params' is a dictionary of all the parameters for the media range.\n For example, the media range 'application/xhtml;q=0.5' would get parsed\n into:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L33_C4", "label": "expression", "type": "expression", "loc": [33, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [8, 1, 0.2151, 0.0523, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parses a mime-type into its component parts.\n\n Carves up a mime-type and returns a tuple of the (type, subtype, params)\n where 'params' is a dictionary of all the parameters for the media range.\n For example, the media range 'application/xhtml;q=0.5' would get parsed\n into:\n\n ('application', 'xhtml', {'q', '0.5'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L42_C4", "label": "parts = split()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [14, 1, 0.2442, 0.0058, 1, 0.24, 0.1667, 13, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = mime_type.split(';')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L43_C4", "label": "params = dict()", "type": "assigned_variable", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [14, 1, 0.2558, 0.0174, 1, 0.24, 0.3333, 206, 3, 1, 0, 0, 827, 10, 4], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " params = dict([tuple([s.strip() for s in param.split('=', 1)])\\\n for param in parts[1:]\n ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L46_C4", "label": "full_type = strip()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [14, 1, 0.2674, 0.0058, 1, 0.24, 0.5, 972, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "full_type", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " full_type = parts[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [4, 1, 0.2878, 0.0116, 1, 0.24, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if full_type == '*':\n full_type = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L50_C8", "label": "full_type =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L49_C4", "vector": [14, 2, 0.2907, 0.0058, 2, 0.49, 0.0, 972, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "full_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " full_type = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L51_C4", "label": "type, subtype = split()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [14, 1, 0.2965, 0.0058, 1, 0.24, 0.8333, 140, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "type, subtype", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " (type, subtype) = full_type.split('/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "vector": [13, 1, 0.3081, 0.0058, 1, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (type.strip(), subtype.strip(), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "label": "parse_media_range", "type": "function", "loc": [56, 76], "level": 0, "parent": null, "vector": [2, 0, 0.3837, 0.1221, 0, 0.66, 0.5833, 68, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "parse_media_range", "arg_names": ["range"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_media_range(range):\n \"\"\"Parse a media-range into its component parts.\n\n Carves up a media range and returns a tuple of the (type, subtype,\n params) where 'params' is a dictionary of all the parameters for the media\n range. For example, the media range 'application/*;q=0.5' would get parsed\n into:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L57_C4", "label": "expression", "type": "expression", "loc": [57, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "vector": [8, 1, 0.3663, 0.0756, 1, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse a media-range into its component parts.\n\n Carves up a media range and returns a tuple of the (type, subtype,\n params) where 'params' is a dictionary of all the parameters for the media\n range. For example, the media range 'application/*;q=0.5' would get parsed\n into:\n\n ('application', '*', {'q', '0.5'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L70_C4", "label": "type, subtype, params = parse_mime_type()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "vector": [14, 1, 0.407, 0.0058, 1, 0.86, 0.3333, 104, 3, 1, 0, 0, 191, 10, 1], "semantic": {"name": "type, subtype, params", "arg_names": [], "import_names": [], "rhs_call_name": "parse_mime_type", "annotation": ""}, "snippet": " (type, subtype, params) = parse_mime_type(range)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L71_C4", "label": "if", "type": "if", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "vector": [4, 1, 0.4215, 0.0233, 1, 0.86, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not params.has_key('q') or not params['q'] or \\\n not float(params['q']) or float(params['q']) > 1\\\n or float(params['q']) < 0:\n params['q'] = '1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L74_C8", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L71_C4", "vector": [14, 2, 0.4302, 0.0058, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params['q'] = '1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L76_C4", "label": "return", "type": "return", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "vector": [13, 1, 0.4419, 0.0058, 1, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (type, subtype, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "label": "fitness_and_quality_parsed", "type": "function", "loc": [79, 110], "level": 0, "parent": null, "vector": [2, 0, 0.5494, 0.186, 0, 0.66, 0.6667, 176, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "fitness_and_quality_parsed", "arg_names": ["mime_type", "parsed_ranges"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fitness_and_quality_parsed(mime_type, parsed_ranges):\n \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns a tuple of\n the fitness value and the value of the 'q' quality parameter of the best\n match, or (-1, 0) if no match was found. Just as for quality_parsed(),\n 'parsed_ranges' must be a list of parsed media ranges."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L80_C4", "label": "expression", "type": "expression", "loc": [80, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "vector": [8, 1, 0.4855, 0.0465, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns a tuple of\n the fitness value and the value of the 'q' quality parameter of the best\n match, or (-1, 0) if no match was found. Just as for quality_parsed(),\n 'parsed_ranges' must be a list of parsed media ranges.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L88_C4", "label": "best_fitness =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "vector": [14, 1, 0.5116, 0.0058, 1, 0.65, 0.2, 745, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_fitness", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fitness = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L89_C4", "label": "best_fit_q =", "type": "assigned_variable", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "vector": [14, 1, 0.5174, 0.0058, 1, 0.65, 0.4, 26, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "best_fit_q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fit_q = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L90_C4", "label": "target_type, target_subtype, target_params = parse_media_range()", "type": "assigned_variable", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "vector": [14, 1, 0.5262, 0.0116, 1, 0.65, 0.6, 106, 3, 1, 0, 0, 68, 10, 1], "semantic": {"name": "target_type, target_subtype, target_params", "arg_names": [], "import_names": [], "rhs_call_name": "parse_media_range", "annotation": ""}, "snippet": " (target_type, target_subtype, target_params) =\\\n parse_media_range(mime_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "label": "for type, subtype, params", "type": "for", "loc": [92, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "vector": [6, 1, 0.5814, 0.0988, 1, 0.65, 0.8, 104, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "type, subtype, params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (type, subtype, params) in parsed_ranges:\n type_match = (type == target_type or\\\n type == '*' or\\\n target_type == '*')\n subtype_match = (subtype == target_subtype or\\\n subtype == '*' or\\\n target_subtype == '*')\n if type_match and subtype_match:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L93_C8", "label": "type_match =", "type": "assigned_variable", "loc": [93, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "vector": [14, 2, 0.5465, 0.0174, 2, 0.48, 0.0, 137, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "type_match", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type_match = (type == target_type or\\\n type == '*' or\\\n target_type == '*')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L96_C8", "label": "subtype_match =", "type": "assigned_variable", "loc": [96, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "vector": [14, 2, 0.564, 0.0174, 2, 0.48, 0.5, 399, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subtype_match", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subtype_match = (subtype == target_subtype or\\\n subtype == '*' or\\\n target_subtype == '*')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "label": "if", "type": "if", "loc": [99, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "vector": [4, 2, 0.6017, 0.0581, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type_match and subtype_match:\n param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \\\n target_params.iteritems() if key != 'q' and \\\n params.has_key(key) and value == params[key]], 0)\n fitness = (type == target_type) and 100 or 0\n fitness += (subtype == target_subtype) and 10 or 0\n fitness += param_matches\n if fitness > best_fitness:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L100_C12", "label": "param_matches = reduce()", "type": "assigned_variable", "loc": [100, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "vector": [14, 3, 0.5872, 0.0174, 3, 0.1, 0.0, 387, 3, 3, 0, 0, 622, 10, 3], "semantic": {"name": "param_matches", "arg_names": [], "import_names": [], "rhs_call_name": "reduce", "annotation": ""}, "snippet": " param_matches = reduce(lambda x, y: x + y, [1 for (key, value) in \\\n target_params.iteritems() if key != 'q' and \\\n params.has_key(key) and value == params[key]], 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L103_C12", "label": "fitness =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "vector": [14, 3, 0.5988, 0.0058, 3, 0.1, 0.5, 50, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fitness", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fitness = (type == target_type) and 100 or 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L106_C12", "label": "if", "type": "if", "loc": [106, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "vector": [4, 3, 0.6221, 0.0174, 3, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fitness > best_fitness:\n best_fitness = fitness\n best_fit_q = params['q']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L107_C16", "label": "best_fitness =", "type": "assigned_variable", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L106_C12", "vector": [14, 4, 0.6221, 0.0058, 4, 0.23, 0.0, 745, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_fitness", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fitness = fitness"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L108_C16", "label": "best_fit_q =", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L106_C12", "vector": [14, 4, 0.6279, 0.0058, 4, 0.23, 1.0, 26, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "best_fit_q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " best_fit_q = params['q']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L110_C4", "label": "return", "type": "return", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "vector": [13, 1, 0.6395, 0.0058, 1, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return best_fitness, float(best_fit_q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L113_C0", "label": "quality_parsed", "type": "function", "loc": [113, 123], "level": 0, "parent": null, "vector": [2, 0, 0.686, 0.064, 0, 0.66, 0.75, 779, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "quality_parsed", "arg_names": ["mime_type", "parsed_ranges"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def quality_parsed(mime_type, parsed_ranges):\n \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns the 'q'\n quality parameter of the best match, 0 if no match was found. This function\n bahaves the same as quality() except that 'parsed_ranges' must be a list of\n parsed media ranges."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L114_C4", "label": "expression", "type": "expression", "loc": [114, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L113_C0", "vector": [8, 1, 0.6831, 0.0465, 1, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Find the best match for a mime-type amongst parsed media-ranges.\n\n Find the best match for a given mime-type against a list of media_ranges\n that have already been parsed by parse_media_range(). Returns the 'q'\n quality parameter of the best match, 0 if no match was found. This function\n bahaves the same as quality() except that 'parsed_ranges' must be a list of\n parsed media ranges.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L123_C4", "label": "return", "type": "return", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L113_C0", "vector": [13, 1, 0.7151, 0.0058, 1, 0.43, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fitness_and_quality_parsed(mime_type, parsed_ranges)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "label": "quality", "type": "function", "loc": [126, 139], "level": 0, "parent": null, "vector": [2, 0, 0.7703, 0.0814, 0, 0.66, 0.8333, 897, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "quality", "arg_names": ["mime_type", "ranges"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def quality(mime_type, ranges):\n \"\"\"Return the quality ('q') of a mime-type against a list of media-ranges.\n\n Returns the quality 'q' of a mime-type when compared against the\n media-ranges in ranges. For example:\n\n >>> quality('text/html','text/*;q=0.3, text/html;q=0.7,\n text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L127_C4", "label": "expression", "type": "expression", "loc": [127, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "vector": [8, 1, 0.7645, 0.0581, 1, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return the quality ('q') of a mime-type against a list of media-ranges.\n\n Returns the quality 'q' of a mime-type when compared against the\n media-ranges in ranges. For example:\n\n >>> quality('text/html','text/*;q=0.3, text/html;q=0.7,\n text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')\n 0.7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L137_C4", "label": "parsed_ranges =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "vector": [14, 1, 0.7965, 0.0058, 1, 0.87, 0.5, 859, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "parsed_ranges", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parsed_ranges = [parse_media_range(r) for r in ranges.split(',')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L139_C4", "label": "return", "type": "return", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "vector": [13, 1, 0.8081, 0.0058, 1, 0.87, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return quality_parsed(mime_type, parsed_ranges)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "label": "best_match", "type": "function", "loc": [142, 166], "level": 0, "parent": null, "vector": [2, 0, 0.8953, 0.1453, 0, 0.66, 0.9167, 400, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "best_match", "arg_names": ["supported", "header"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def best_match(supported, header):\n \"\"\"Return mime-type with the highest quality ('q') from list of candidates.\n\n Takes a list of supported mime-types and finds the best match for all the\n media-ranges listed in header. The value of header must be a string that\n conforms to the format of the HTTP Accept: header. The value of 'supported'\n is a list of mime-types. The list of supported mime-types should be sorted\n in order of increasing desirability, in case of a situation where there is"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L143_C4", "label": "expression", "type": "expression", "loc": [143, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [8, 1, 0.8663, 0.0756, 1, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return mime-type with the highest quality ('q') from list of candidates.\n\n Takes a list of supported mime-types and finds the best match for all the\n media-ranges listed in header. The value of header must be a string that\n conforms to the format of the HTTP Accept: header. The value of 'supported'\n is a list of mime-types. The list of supported mime-types should be sorted\n in order of increasing desirability, in case of a situation where there is\n a tie."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L156_C4", "label": "split_header = _filter_blank()", "type": "assigned_variable", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [14, 1, 0.907, 0.0058, 1, 0.16, 0.1429, 434, 3, 1, 0, 0, 519, 10, 2], "semantic": {"name": "split_header", "arg_names": [], "import_names": [], "rhs_call_name": "_filter_blank", "annotation": ""}, "snippet": " split_header = _filter_blank(header.split(','))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L157_C4", "label": "parsed_header =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [14, 1, 0.9128, 0.0058, 1, 0.16, 0.2857, 633, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parsed_header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parsed_header = [parse_media_range(r) for r in split_header]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L158_C4", "label": "weighted_matches =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [14, 1, 0.9186, 0.0058, 1, 0.16, 0.4286, 904, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "weighted_matches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " weighted_matches = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L159_C4", "label": "pos =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [14, 1, 0.9244, 0.0058, 1, 0.16, 0.5714, 627, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L160_C4", "label": "for mime_type", "type": "for", "loc": [160, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [6, 1, 0.939, 0.0233, 1, 0.16, 0.7143, 188, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "mime_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for mime_type in supported:\n weighted_matches.append((fitness_and_quality_parsed(mime_type,\n parsed_header), pos, mime_type))\n pos += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L161_C8", "label": "append()", "type": "expression", "loc": [161, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L160_C4", "vector": [8, 2, 0.939, 0.0116, 2, 0.21, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " weighted_matches.append((fitness_and_quality_parsed(mime_type,\n parsed_header), pos, mime_type))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L164_C4", "label": "sort()", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [8, 1, 0.9535, 0.0058, 1, 0.16, 0.8571, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " weighted_matches.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L166_C4", "label": "return", "type": "return", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "vector": [13, 1, 0.9651, 0.0058, 1, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return weighted_matches[-1][0][1] and weighted_matches[-1][2] or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L169_C0", "label": "_filter_blank", "type": "function", "loc": [169, 172], "level": 0, "parent": null, "vector": [2, 0, 0.9913, 0.0233, 0, 0.66, 1.0, 519, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_filter_blank", "arg_names": ["i"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _filter_blank(i):\n for s in i:\n if s.strip():\n yield s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L170_C4", "label": "for s", "type": "for", "loc": [170, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L169_C0", "vector": [6, 1, 0.9942, 0.0174, 1, 0.68, 0.0, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in i:\n if s.strip():\n yield s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L171_C8", "label": "if", "type": "if", "loc": [171, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L170_C4", "vector": [4, 2, 0.9971, 0.0116, 2, 0.31, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s.strip():\n yield s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L172_C12", "label": "expression", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L171_C8", "vector": [8, 3, 1.0, 0.0058, 3, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield s"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Return_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99176:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99176:Expr_L172_C12"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for OAuth.
Utilities for making it easier to work with OAuth.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import copy
import httplib2
import logging
import oauth2 as oauth
import urllib
import urlparse
from anyjson import simplejson
try:
from urlparse import parse_qsl
except ImportError:
from cgi import parse_qsl
class Error(Exception):
"""Base error for this module."""
pass
class RequestError(Error):
"""Error occurred during request."""
pass
class MissingParameter(Error):
pass
class CredentialsInvalidError(Error):
pass
def _abstract():
raise NotImplementedError('You need to override this function')
def _oauth_uri(name, discovery, params):
"""Look up the OAuth URI from the discovery
document and add query parameters based on
params.
name - The name of the OAuth URI to lookup, one
of 'request', 'access', or 'authorize'.
discovery - Portion of discovery document the describes
the OAuth endpoints.
params - Dictionary that is used to form the query parameters
for the specified URI.
"""
if name not in ['request', 'access', 'authorize']:
raise KeyError(name)
keys = discovery[name]['parameters'].keys()
query = {}
for key in keys:
if key in params:
query[key] = params[key]
return discovery[name]['url'] + '?' + urllib.urlencode(query)
class Credentials(object):
"""Base class for all Credentials objects.
Subclasses must define an authorize() method
that applies the credentials to an HTTP transport.
"""
def authorize(self, http):
"""Take an httplib2.Http instance (or equivalent) and
authorizes it for the set of credentials, usually by
replacing http.request() with a method that adds in
the appropriate headers and then delegates to the original
Http.request() method.
"""
_abstract()
class Flow(object):
"""Base class for all Flow objects."""
pass
class Storage(object):
"""Base class for all Storage objects.
Store and retrieve a single credential.
"""
def get(self):
"""Retrieve credential.
Returns:
apiclient.oauth.Credentials
"""
_abstract()
def put(self, credentials):
"""Write a credential.
Args:
credentials: Credentials, the credentials to store.
"""
_abstract()
class OAuthCredentials(Credentials):
"""Credentials object for OAuth 1.0a
"""
def __init__(self, consumer, token, user_agent):
"""
consumer - An instance of oauth.Consumer.
token - An instance of oauth.Token constructed with
the access token and secret.
user_agent - The HTTP User-Agent to provide for this application.
"""
self.consumer = consumer
self.token = token
self.user_agent = user_agent
self.store = None
# True if the credentials have been revoked
self._invalid = False
@property
def invalid(self):
"""True if the credentials are invalid, such as being revoked."""
return getattr(self, "_invalid", False)
def set_store(self, store):
"""Set the storage for the credential.
Args:
store: callable, a callable that when passed a Credential
will store the credential back to where it came from.
This is needed to store the latest access_token if it
has been revoked.
"""
self.store = store
def __getstate__(self):
"""Trim the state down to something that can be pickled."""
d = copy.copy(self.__dict__)
del d['store']
return d
def __setstate__(self, state):
"""Reconstitute the state of the object from being pickled."""
self.__dict__.update(state)
self.store = None
def authorize(self, http):
"""Authorize an httplib2.Http instance with these Credentials
Args:
http - An instance of httplib2.Http
or something that acts like it.
Returns:
A modified instance of http that was passed in.
Example:
h = httplib2.Http()
h = credentials.authorize(h)
You can't create a new OAuth
subclass of httplib2.Authenication because
it never gets passed the absolute URI, which is
needed for signing. So instead we have to overload
'request' with a closure that adds in the
Authorization header and then calls the original version
of 'request()'.
"""
request_orig = http.request
signer = oauth.SignatureMethod_HMAC_SHA1()
# The closure that will replace 'httplib2.Http.request'.
def new_request(uri, method='GET', body=None, headers=None,
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
connection_type=None):
"""Modify the request headers to add the appropriate
Authorization header."""
response_code = 302
http.follow_redirects = False
while response_code in [301, 302]:
req = oauth.Request.from_consumer_and_token(
self.consumer, self.token, http_method=method, http_url=uri)
req.sign_request(signer, self.consumer, self.token)
if headers is None:
headers = {}
headers.update(req.to_header())
if 'user-agent' in headers:
headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']
else:
headers['user-agent'] = self.user_agent
resp, content = request_orig(uri, method, body, headers,
redirections, connection_type)
response_code = resp.status
if response_code in [301, 302]:
uri = resp['location']
# Update the stored credential if it becomes invalid.
if response_code == 401:
logging.info('Access token no longer valid: %s' % content)
self._invalid = True
if self.store is not None:
self.store(self)
raise CredentialsInvalidError("Credentials are no longer valid.")
return resp, content
http.request = new_request
return http
class TwoLeggedOAuthCredentials(Credentials):
"""Two Legged Credentials object for OAuth 1.0a.
The Two Legged object is created directly, not from a flow. Once you
authorize and httplib2.Http instance you can change the requestor and that
change will propogate to the authorized httplib2.Http instance. For example:
http = httplib2.Http()
http = credentials.authorize(http)
credentials.requestor = 'foo@example.info'
http.request(...)
credentials.requestor = 'bar@example.info'
http.request(...)
"""
def __init__(self, consumer_key, consumer_secret, user_agent):
"""
Args:
consumer_key: string, An OAuth 1.0 consumer key
consumer_secret: string, An OAuth 1.0 consumer secret
user_agent: string, The HTTP User-Agent to provide for this application.
"""
self.consumer = oauth.Consumer(consumer_key, consumer_secret)
self.user_agent = user_agent
self.store = None
# email address of the user to act on the behalf of.
self._requestor = None
@property
def invalid(self):
"""True if the credentials are invalid, such as being revoked.
Always returns False for Two Legged Credentials.
"""
return False
def getrequestor(self):
return self._requestor
def setrequestor(self, email):
self._requestor = email
requestor = property(getrequestor, setrequestor, None,
'The email address of the user to act on behalf of')
def set_store(self, store):
"""Set the storage for the credential.
Args:
store: callable, a callable that when passed a Credential
will store the credential back to where it came from.
This is needed to store the latest access_token if it
has been revoked.
"""
self.store = store
def __getstate__(self):
"""Trim the state down to something that can be pickled."""
d = copy.copy(self.__dict__)
del d['store']
return d
def __setstate__(self, state):
"""Reconstitute the state of the object from being pickled."""
self.__dict__.update(state)
self.store = None
def authorize(self, http):
"""Authorize an httplib2.Http instance with these Credentials
Args:
http - An instance of httplib2.Http
or something that acts like it.
Returns:
A modified instance of http that was passed in.
Example:
h = httplib2.Http()
h = credentials.authorize(h)
You can't create a new OAuth
subclass of httplib2.Authenication because
it never gets passed the absolute URI, which is
needed for signing. So instead we have to overload
'request' with a closure that adds in the
Authorization header and then calls the original version
of 'request()'.
"""
request_orig = http.request
signer = oauth.SignatureMethod_HMAC_SHA1()
# The closure that will replace 'httplib2.Http.request'.
def new_request(uri, method='GET', body=None, headers=None,
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
connection_type=None):
"""Modify the request headers to add the appropriate
Authorization header."""
response_code = 302
http.follow_redirects = False
while response_code in [301, 302]:
# add in xoauth_requestor_id=self._requestor to the uri
if self._requestor is None:
raise MissingParameter(
'Requestor must be set before using TwoLeggedOAuthCredentials')
parsed = list(urlparse.urlparse(uri))
q = parse_qsl(parsed[4])
q.append(('xoauth_requestor_id', self._requestor))
parsed[4] = urllib.urlencode(q)
uri = urlparse.urlunparse(parsed)
req = oauth.Request.from_consumer_and_token(
self.consumer, None, http_method=method, http_url=uri)
req.sign_request(signer, self.consumer, None)
if headers is None:
headers = {}
headers.update(req.to_header())
if 'user-agent' in headers:
headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']
else:
headers['user-agent'] = self.user_agent
resp, content = request_orig(uri, method, body, headers,
redirections, connection_type)
response_code = resp.status
if response_code in [301, 302]:
uri = resp['location']
if response_code == 401:
logging.info('Access token no longer valid: %s' % content)
# Do not store the invalid state of the Credentials because
# being 2LO they could be reinstated in the future.
raise CredentialsInvalidError("Credentials are invalid.")
return resp, content
http.request = new_request
return http
class FlowThreeLegged(Flow):
"""Does the Three Legged Dance for OAuth 1.0a.
"""
def __init__(self, discovery, consumer_key, consumer_secret, user_agent,
**kwargs):
"""
discovery - Section of the API discovery document that describes
the OAuth endpoints.
consumer_key - OAuth consumer key
consumer_secret - OAuth consumer secret
user_agent - The HTTP User-Agent that identifies the application.
**kwargs - The keyword arguments are all optional and required
parameters for the OAuth calls.
"""
self.discovery = discovery
self.consumer_key = consumer_key
self.consumer_secret = consumer_secret
self.user_agent = user_agent
self.params = kwargs
self.request_token = {}
required = {}
for uriinfo in discovery.itervalues():
for name, value in uriinfo['parameters'].iteritems():
if value['required'] and not name.startswith('oauth_'):
required[name] = 1
for key in required.iterkeys():
if key not in self.params:
raise MissingParameter('Required parameter %s not supplied' % key)
def step1_get_authorize_url(self, oauth_callback='oob'):
"""Returns a URI to redirect to the provider.
oauth_callback - Either the string 'oob' for a non-web-based application,
or a URI that handles the callback from the authorization
server.
If oauth_callback is 'oob' then pass in the
generated verification code to step2_exchange,
otherwise pass in the query parameters received
at the callback uri to step2_exchange.
"""
consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)
client = oauth.Client(consumer)
headers = {
'user-agent': self.user_agent,
'content-type': 'application/x-www-form-urlencoded'
}
body = urllib.urlencode({'oauth_callback': oauth_callback})
uri = _oauth_uri('request', self.discovery, self.params)
resp, content = client.request(uri, 'POST', headers=headers,
body=body)
if resp['status'] != '200':
logging.error('Failed to retrieve temporary authorization: %s', content)
raise RequestError('Invalid response %s.' % resp['status'])
self.request_token = dict(parse_qsl(content))
auth_params = copy.copy(self.params)
auth_params['oauth_token'] = self.request_token['oauth_token']
return _oauth_uri('authorize', self.discovery, auth_params)
def step2_exchange(self, verifier):
"""Exhanges an authorized request token
for OAuthCredentials.
Args:
verifier: string, dict - either the verifier token, or a dictionary
of the query parameters to the callback, which contains
the oauth_verifier.
Returns:
The Credentials object.
"""
if not (isinstance(verifier, str) or isinstance(verifier, unicode)):
verifier = verifier['oauth_verifier']
token = oauth.Token(
self.request_token['oauth_token'],
self.request_token['oauth_token_secret'])
token.set_verifier(verifier)
consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)
client = oauth.Client(consumer, token)
headers = {
'user-agent': self.user_agent,
'content-type': 'application/x-www-form-urlencoded'
}
uri = _oauth_uri('access', self.discovery, self.params)
resp, content = client.request(uri, 'POST', headers=headers)
if resp['status'] != '200':
logging.error('Failed to retrieve access token: %s', content)
raise RequestError('Invalid response %s.' % resp['status'])
oauth_params = dict(parse_qsl(content))
token = oauth.Token(
oauth_params['oauth_token'],
oauth_params['oauth_token_secret'])
return OAuthCredentials(consumer, token, self.user_agent)
| ajibawa-2023/Python-Code-Large/train/row_99178 | 201 | 483 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0083, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0414, 0.0021, 0, 0.66, 0.0476, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Import_L23_C0", "label": "copy import copy", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0021, 0, 0.66, 0.0952, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Import_L24_C0", "label": "httplib2 import httplib2", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0497, 0.0021, 0, 0.66, 0.1429, 273, 0, 1, 0, 0, 273, 0, 0], "semantic": {"name": "httplib2", "arg_names": [], "import_names": ["httplib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Import_L25_C0", "label": "logging import logging", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0518, 0.0021, 0, 0.66, 0.1905, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Import_L26_C0", "label": "oauth2 import oauth", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0538, 0.0021, 0, 0.66, 0.2381, 311, 0, 1, 0, 0, 311, 0, 0], "semantic": {"name": "oauth2", "arg_names": [], "import_names": ["oauth"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth2 as oauth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Import_L27_C0", "label": "urllib import urllib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0559, 0.0021, 0, 0.66, 0.2857, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Import_L28_C0", "label": "urlparse import urlparse", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.058, 0.0021, 0, 0.66, 0.3333, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urlparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ImportFrom_L29_C0", "label": "from anyjson import simplejson", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.0021, 0, 0.66, 0.381, 877, 0, 1, 0, 0, 877, 0, 0], "semantic": {"name": "anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Try_L31_C0", "label": "try", "type": "try", "loc": [31, 34], "level": 0, "parent": null, "vector": [7, 0, 0.0673, 0.0083, 0, 0.66, 0.4286, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from urlparse import parse_qsl\nexcept ImportError:\n from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ImportFrom_L32_C2", "label": "from urlparse import parse_qsl", "type": "import", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:Try_L31_C0", "vector": [1, 1, 0.0663, 0.0021, 1, 0.56, 0.0, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from urlparse import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ImportFrom_L34_C2", "label": "from cgi import parse_qsl", "type": "import", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:Try_L31_C0", "vector": [1, 1, 0.0704, 0.0021, 1, 0.56, 0.0, 934, 0, 1, 0, 0, 934, 0, 0], "semantic": {"name": "cgi", "arg_names": [], "import_names": ["parse_qsl"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cgi import parse_qsl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L37_C0", "label": "Error", "type": "class", "loc": [37, 39], "level": 0, "parent": null, "vector": [3, 0, 0.0787, 0.0062, 0, 0.66, 0.4762, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L38_C2", "label": "expression", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L37_C0", "vector": [8, 1, 0.0787, 0.0021, 1, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L42_C0", "label": "RequestError", "type": "class", "loc": [42, 44], "level": 0, "parent": null, "vector": [3, 0, 0.089, 0.0062, 0, 0.66, 0.5238, 183, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "RequestError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RequestError(Error):\n \"\"\"Error occurred during request.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L43_C2", "label": "expression", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L42_C0", "vector": [8, 1, 0.089, 0.0021, 1, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error occurred during request.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L47_C0", "label": "MissingParameter", "type": "class", "loc": [47, 48], "level": 0, "parent": null, "vector": [3, 0, 0.0983, 0.0041, 0, 0.66, 0.5714, 595, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "MissingParameter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MissingParameter(Error):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L51_C0", "label": "CredentialsInvalidError", "type": "class", "loc": [51, 52], "level": 0, "parent": null, "vector": [3, 0, 0.1066, 0.0041, 0, 0.66, 0.619, 436, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "CredentialsInvalidError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CredentialsInvalidError(Error):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L55_C0", "label": "_abstract", "type": "function", "loc": [55, 56], "level": 0, "parent": null, "vector": [2, 0, 0.1149, 0.0041, 0, 0.66, 0.6667, 629, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _abstract():\n raise NotImplementedError('You need to override this function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "label": "_oauth_uri", "type": "function", "loc": [59, 78], "level": 0, "parent": null, "vector": [2, 0, 0.1418, 0.0414, 0, 0.66, 0.7143, 122, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_oauth_uri", "arg_names": ["name", "discovery", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _oauth_uri(name, discovery, params):\n \"\"\"Look up the OAuth URI from the discovery\n document and add query parameters based on\n params.\n\n name - The name of the OAuth URI to lookup, one\n of 'request', 'access', or 'authorize'.\n discovery - Portion of discovery document the describes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L60_C2", "label": "expression", "type": "expression", "loc": [60, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "vector": [8, 1, 0.1346, 0.0228, 1, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Look up the OAuth URI from the discovery\n document and add query parameters based on\n params.\n\n name - The name of the OAuth URI to lookup, one\n of 'request', 'access', or 'authorize'.\n discovery - Portion of discovery document the describes\n the OAuth endpoints."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L71_C2", "label": "if", "type": "if", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "vector": [4, 1, 0.148, 0.0041, 1, 0.06, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in ['request', 'access', 'authorize']:\n raise KeyError(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L73_C2", "label": "keys = keys()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "vector": [14, 1, 0.1511, 0.0021, 1, 0.06, 0.4, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = discovery[name]['parameters'].keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L74_C2", "label": "query =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "vector": [14, 1, 0.1532, 0.0021, 1, 0.06, 0.6, 546, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L75_C2", "label": "for key", "type": "for", "loc": [75, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "vector": [6, 1, 0.1573, 0.0062, 1, 0.06, 0.8, 230, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in keys:\n if key in params:\n query[key] = params[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L76_C4", "label": "if", "type": "if", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L75_C2", "vector": [4, 2, 0.1584, 0.0041, 2, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key in params:\n query[key] = params[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L77_C6", "label": "assign", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L76_C4", "vector": [14, 3, 0.1594, 0.0021, 3, 0.3, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query[key] = params[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L78_C2", "label": "return", "type": "return", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "vector": [13, 1, 0.1615, 0.0021, 1, 0.06, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return discovery[name]['url'] + '?' + urllib.urlencode(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L81_C0", "label": "Credentials", "type": "class", "loc": [81, 95], "level": 0, "parent": null, "vector": [3, 0, 0.1822, 0.0311, 0, 0.66, 0.7619, 309, 0, 1, 0, 0, 186, 0, 1], "semantic": {"name": "Credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Credentials(object):\n \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method\n that applies the credentials to an HTTP transport.\n \"\"\"\n\n def authorize(self, http):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L82_C2", "label": "expression", "type": "expression", "loc": [82, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L81_C0", "vector": [8, 1, 0.1739, 0.0104, 1, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Credentials objects.\n\n Subclasses must define an authorize() method\n that applies the credentials to an HTTP transport.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L88_C2", "label": "authorize", "type": "function", "loc": [88, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L81_C0", "vector": [2, 1, 0.1894, 0.0166, 1, 0.3, 1.0, 880, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L89_C4", "label": "expression", "type": "expression", "loc": [89, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L88_C2", "vector": [8, 2, 0.1894, 0.0124, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Take an httplib2.Http instance (or equivalent) and\n authorizes it for the set of credentials, usually by\n replacing http.request() with a method that adds in\n the appropriate headers and then delegates to the original\n Http.request() method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L95_C4", "label": "_abstract()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L88_C2", "vector": [8, 2, 0.1967, 0.0021, 2, 0.81, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L98_C0", "label": "Flow", "type": "class", "loc": [98, 100], "level": 0, "parent": null, "vector": [3, 0, 0.205, 0.0062, 0, 0.66, 0.8095, 746, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "Flow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Flow(object):\n \"\"\"Base class for all Flow objects.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L99_C2", "label": "expression", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L98_C0", "vector": [8, 1, 0.205, 0.0021, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Flow objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "label": "Storage", "type": "class", "loc": [103, 123], "level": 0, "parent": null, "vector": [3, 0, 0.234, 0.0435, 0, 0.66, 0.8571, 850, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(object):\n \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential.\n \"\"\"\n\n def get(self):\n \"\"\"Retrieve credential."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L104_C2", "label": "expression", "type": "expression", "loc": [104, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "vector": [8, 1, 0.2184, 0.0083, 1, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for all Storage objects.\n\n Store and retrieve a single credential.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L109_C2", "label": "get", "type": "function", "loc": [109, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "vector": [2, 1, 0.2319, 0.0145, 1, 0.7, 0.5, 607, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve credential.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L110_C4", "label": "expression", "type": "expression", "loc": [110, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L109_C2", "vector": [8, 2, 0.2319, 0.0104, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve credential.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L115_C4", "label": "_abstract()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L109_C2", "vector": [8, 2, 0.2381, 0.0021, 2, 0.6, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L117_C2", "label": "put", "type": "function", "loc": [117, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "vector": [2, 1, 0.2484, 0.0145, 1, 0.7, 1.0, 636, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a credential.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L118_C4", "label": "expression", "type": "expression", "loc": [118, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L117_C2", "vector": [8, 2, 0.2484, 0.0104, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a credential.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L123_C4", "label": "_abstract()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L117_C2", "vector": [8, 2, 0.2547, 0.0021, 2, 0.66, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "label": "OAuthCredentials", "type": "class", "loc": [126, 235], "level": 0, "parent": null, "vector": [3, 0, 0.3737, 0.2277, 0, 0.66, 0.9048, 549, 0, 7, 0, 0, 309, 0, 12], "semantic": {"name": "OAuthCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuthCredentials(Credentials):\n \"\"\"Credentials object for OAuth 1.0a\n \"\"\"\n\n def __init__(self, consumer, token, user_agent):\n \"\"\"\n consumer - An instance of oauth.Consumer.\n token - An instance of oauth.Token constructed with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L127_C2", "label": "expression", "type": "expression", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [8, 1, 0.264, 0.0041, 1, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Credentials object for OAuth 1.0a\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "label": "__init__", "type": "function", "loc": [130, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [2, 1, 0.2826, 0.029, 1, 0.4, 0.1667, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "consumer", "token", "user_agent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, consumer, token, user_agent):\n \"\"\"\n consumer - An instance of oauth.Consumer.\n token - An instance of oauth.Token constructed with\n the access token and secret.\n user_agent - The HTTP User-Agent to provide for this application.\n \"\"\"\n self.consumer = consumer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L131_C4", "label": "expression", "type": "expression", "loc": [131, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "vector": [8, 2, 0.2764, 0.0124, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n consumer - An instance of oauth.Consumer.\n token - An instance of oauth.Token constructed with\n the access token and secret.\n user_agent - The HTTP User-Agent to provide for this application.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L137_C4", "label": "self.consumer =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "vector": [14, 2, 0.2836, 0.0021, 2, 0.78, 0.2, 33, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.consumer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.consumer = consumer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L138_C4", "label": "self.token =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "vector": [14, 2, 0.2857, 0.0021, 2, 0.78, 0.4, 150, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.token = token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L139_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "vector": [14, 2, 0.2878, 0.0021, 2, 0.78, 0.6, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L140_C4", "label": "self.store =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "vector": [14, 2, 0.2899, 0.0021, 2, 0.78, 0.8, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L143_C4", "label": "self._invalid =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "vector": [14, 2, 0.2961, 0.0021, 2, 0.78, 1.0, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._invalid = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L146_C2", "label": "invalid", "type": "function", "loc": [146, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [2, 1, 0.3043, 0.0062, 1, 0.4, 0.3333, 420, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "invalid", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def invalid(self):\n \"\"\"True if the credentials are invalid, such as being revoked.\"\"\"\n return getattr(self, \"_invalid\", False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L147_C4", "label": "expression", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L146_C2", "vector": [8, 2, 0.3043, 0.0021, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"True if the credentials are invalid, such as being revoked.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L148_C4", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L146_C2", "vector": [13, 2, 0.3064, 0.0021, 2, 0.35, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(self, \"_invalid\", False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L150_C2", "label": "set_store", "type": "function", "loc": [150, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [2, 1, 0.3199, 0.0207, 1, 0.4, 0.5, 939, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_store", "arg_names": ["self", "store"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_store(self, store):\n \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L151_C4", "label": "expression", "type": "expression", "loc": [151, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L150_C2", "vector": [8, 2, 0.3199, 0.0166, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L159_C4", "label": "self.store =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L150_C2", "vector": [14, 2, 0.3292, 0.0021, 2, 0.62, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = store"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "label": "__getstate__", "type": "function", "loc": [161, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [2, 1, 0.3375, 0.0104, 1, 0.4, 0.6667, 250, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n \"\"\"Trim the state down to something that can be pickled.\"\"\"\n d = copy.copy(self.__dict__)\n del d['store']\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L162_C4", "label": "expression", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "vector": [8, 2, 0.3354, 0.0021, 2, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Trim the state down to something that can be pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L163_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "vector": [14, 2, 0.3375, 0.0021, 2, 0.68, 0.5, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L165_C4", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "vector": [13, 2, 0.3416, 0.0021, 2, 0.68, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "label": "__setstate__", "type": "function", "loc": [167, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [2, 1, 0.3489, 0.0083, 1, 0.4, 0.8333, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setstate__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, state):\n \"\"\"Reconstitute the state of the object from being pickled.\"\"\"\n self.__dict__.update(state)\n self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L168_C4", "label": "expression", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "vector": [8, 2, 0.3478, 0.0021, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reconstitute the state of the object from being pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L169_C4", "label": "update()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "vector": [8, 2, 0.3499, 0.0021, 2, 0.22, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L170_C4", "label": "self.store =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "vector": [14, 2, 0.352, 0.0021, 2, 0.22, 1.0, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "label": "authorize", "type": "function", "loc": [172, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "vector": [2, 1, 0.4213, 0.1325, 1, 0.4, 1.0, 880, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L173_C4", "label": "expression", "type": "expression", "loc": [173, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "vector": [8, 2, 0.3799, 0.0455, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:\n A modified instance of http that was passed in."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L195_C4", "label": "request_orig =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "vector": [14, 2, 0.4037, 0.0021, 2, 0.22, 0.2, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request_orig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request_orig = http.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L196_C4", "label": "signer = SignatureMethod_HMAC_SHA1()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "vector": [14, 2, 0.4058, 0.0021, 2, 0.22, 0.4, 12, 3, 0, 0, 0, 948, 10, 1], "semantic": {"name": "signer", "arg_names": [], "import_names": [], "rhs_call_name": "SignatureMethod_HMAC_SHA1", "annotation": ""}, "snippet": " signer = oauth.SignatureMethod_HMAC_SHA1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "label": "new_request", "type": "function", "loc": [199, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "vector": [2, 2, 0.4462, 0.0704, 2, 0.22, 0.6, 23, 0, 6, 1, 0, 0, 0, 8], "semantic": {"name": "new_request", "arg_names": ["uri", "method", "body", "headers", "redirections", "connection_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_request(uri, method='GET', body=None, headers=None,\n redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n connection_type=None):\n \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\"\n response_code = 302\n http.follow_redirects = False\n while response_code in [301, 302]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L202_C6", "label": "expression", "type": "expression", "loc": [202, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "vector": [8, 3, 0.4193, 0.0041, 3, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L204_C6", "label": "response_code =", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "vector": [14, 3, 0.4224, 0.0021, 3, 0.37, 0.2, 558, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = 302"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L205_C6", "label": "http.follow_redirects =", "type": "assigned_variable", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "vector": [14, 3, 0.4244, 0.0021, 3, 0.37, 0.4, 45, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "http.follow_redirects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.follow_redirects = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "label": "while", "type": "while", "loc": [206, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "vector": [5, 3, 0.4431, 0.0352, 3, 0.37, 0.6, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while response_code in [301, 302]:\n req = oauth.Request.from_consumer_and_token(\n self.consumer, self.token, http_method=method, http_url=uri)\n req.sign_request(signer, self.consumer, self.token)\n if headers is None:\n headers = {}\n headers.update(req.to_header())\n if 'user-agent' in headers:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L207_C8", "label": "req = from_consumer_and_token()", "type": "assigned_variable", "loc": [207, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [14, 4, 0.4296, 0.0041, 4, 0.51, 0.0, 233, 3, 4, 0, 0, 319, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "from_consumer_and_token", "annotation": ""}, "snippet": " req = oauth.Request.from_consumer_and_token(\n self.consumer, self.token, http_method=method, http_url=uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L209_C8", "label": "sign_request()", "type": "expression", "loc": [209, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [8, 4, 0.4327, 0.0021, 4, 0.51, 0.1429, 817, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "sign_request", "arg_names": [], "import_names": [], "rhs_call_name": "sign_request", "annotation": ""}, "snippet": " req.sign_request(signer, self.consumer, self.token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L210_C8", "label": "if", "type": "if", "loc": [210, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [4, 4, 0.4358, 0.0041, 4, 0.51, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if headers is None:\n headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L211_C10", "label": "headers =", "type": "assigned_variable", "loc": [211, 211], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L210_C8", "vector": [14, 5, 0.4369, 0.0021, 5, 0.74, 0.0, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L212_C8", "label": "update()", "type": "expression", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [8, 4, 0.4389, 0.0021, 4, 0.51, 0.4286, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " headers.update(req.to_header())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L213_C8", "label": "if", "type": "if", "loc": [213, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [4, 4, 0.4441, 0.0083, 4, 0.51, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L214_C10", "label": "assign", "type": "assigned_variable", "loc": [214, 214], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L213_C8", "vector": [14, 5, 0.4431, 0.0021, 5, 0.72, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L216_C10", "label": "assign", "type": "assigned_variable", "loc": [216, 216], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L213_C8", "vector": [14, 5, 0.4472, 0.0021, 5, 0.72, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L218_C8", "label": "resp, content = request_orig()", "type": "assigned_variable", "loc": [218, 219], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [14, 4, 0.4524, 0.0041, 4, 0.51, 0.7143, 339, 3, 6, 0, 0, 112, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request_orig", "annotation": ""}, "snippet": " resp, content = request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L220_C8", "label": "response_code =", "type": "assigned_variable", "loc": [220, 220], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [14, 4, 0.4555, 0.0021, 4, 0.51, 0.8571, 558, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = resp.status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L221_C8", "label": "if", "type": "if", "loc": [221, 222], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "vector": [4, 4, 0.4586, 0.0041, 4, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code in [301, 302]:\n uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L222_C10", "label": "uri =", "type": "assigned_variable", "loc": [222, 222], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L221_C8", "vector": [14, 5, 0.4596, 0.0021, 5, 0.8, 0.0, 600, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "label": "if", "type": "if", "loc": [225, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "vector": [4, 3, 0.471, 0.0124, 3, 0.37, 0.8, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code == 401:\n logging.info('Access token no longer valid: %s' % content)\n self._invalid = True\n if self.store is not None:\n self.store(self)\n raise CredentialsInvalidError(\"Credentials are no longer valid.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L226_C8", "label": "info()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "vector": [8, 4, 0.4679, 0.0021, 4, 0.72, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('Access token no longer valid: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L227_C8", "label": "self._invalid =", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "vector": [14, 4, 0.47, 0.0021, 4, 0.72, 0.5, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._invalid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._invalid = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L228_C8", "label": "if", "type": "if", "loc": [228, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "vector": [4, 4, 0.4731, 0.0041, 4, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.store is not None:\n self.store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L229_C10", "label": "store()", "type": "expression", "loc": [229, 229], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L228_C8", "vector": [8, 5, 0.4741, 0.0021, 5, 0.82, 0.0, 354, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "store", "arg_names": [], "import_names": [], "rhs_call_name": "store", "annotation": ""}, "snippet": " self.store(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L232_C6", "label": "return", "type": "return", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "vector": [13, 3, 0.4803, 0.0021, 3, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp, content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L234_C4", "label": "http.request =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "vector": [14, 2, 0.4845, 0.0021, 2, 0.22, 0.8, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.request = new_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L235_C4", "label": "return", "type": "return", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "vector": [13, 2, 0.4865, 0.0021, 2, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "label": "TwoLeggedOAuthCredentials", "type": "class", "loc": [238, 377], "level": 0, "parent": null, "vector": [3, 0, 0.6366, 0.2899, 0, 0.66, 0.9524, 463, 0, 9, 0, 0, 309, 0, 19], "semantic": {"name": "TwoLeggedOAuthCredentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TwoLeggedOAuthCredentials(Credentials):\n \"\"\"Two Legged Credentials object for OAuth 1.0a.\n\n The Two Legged object is created directly, not from a flow. Once you\n authorize and httplib2.Http instance you can change the requestor and that\n change will propogate to the authorized httplib2.Http instance. For example:\n\n http = httplib2.Http()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L239_C2", "label": "expression", "type": "expression", "loc": [239, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [8, 1, 0.5083, 0.029, 1, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Two Legged Credentials object for OAuth 1.0a.\n\n The Two Legged object is created directly, not from a flow. Once you\n authorize and httplib2.Http instance you can change the requestor and that\n change will propogate to the authorized httplib2.Http instance. For example:\n\n http = httplib2.Http()\n http = credentials.authorize(http)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "label": "__init__", "type": "function", "loc": [254, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.5383, 0.0269, 1, 0.5, 0.1111, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "consumer_key", "consumer_secret", "user_agent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, consumer_key, consumer_secret, user_agent):\n \"\"\"\n Args:\n consumer_key: string, An OAuth 1.0 consumer key\n consumer_secret: string, An OAuth 1.0 consumer secret\n user_agent: string, The HTTP User-Agent to provide for this application.\n \"\"\"\n self.consumer = oauth.Consumer(consumer_key, consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L255_C4", "label": "expression", "type": "expression", "loc": [255, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "vector": [8, 2, 0.5331, 0.0124, 2, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Args:\n consumer_key: string, An OAuth 1.0 consumer key\n consumer_secret: string, An OAuth 1.0 consumer secret\n user_agent: string, The HTTP User-Agent to provide for this application.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L261_C4", "label": "self.consumer = Consumer()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "vector": [14, 2, 0.5404, 0.0021, 2, 0.67, 0.25, 33, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "self.consumer", "arg_names": [], "import_names": [], "rhs_call_name": "Consumer", "annotation": ""}, "snippet": " self.consumer = oauth.Consumer(consumer_key, consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L262_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "vector": [14, 2, 0.5424, 0.0021, 2, 0.67, 0.5, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L263_C4", "label": "self.store =", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "vector": [14, 2, 0.5445, 0.0021, 2, 0.67, 0.75, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L266_C4", "label": "self._requestor =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "vector": [14, 2, 0.5507, 0.0021, 2, 0.67, 1.0, 413, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._requestor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._requestor = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L269_C2", "label": "invalid", "type": "function", "loc": [269, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.5621, 0.0124, 1, 0.5, 0.2222, 420, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "invalid", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def invalid(self):\n \"\"\"True if the credentials are invalid, such as being revoked.\n\n Always returns False for Two Legged Credentials.\n \"\"\"\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L270_C4", "label": "expression", "type": "expression", "loc": [270, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L269_C2", "vector": [8, 2, 0.5621, 0.0083, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"True if the credentials are invalid, such as being revoked.\n\n Always returns False for Two Legged Credentials.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L274_C4", "label": "return", "type": "return", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L269_C2", "vector": [13, 2, 0.5673, 0.0021, 2, 0.38, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L276_C2", "label": "getrequestor", "type": "function", "loc": [276, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.5725, 0.0041, 1, 0.5, 0.3333, 217, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getrequestor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getrequestor(self):\n return self._requestor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L277_C4", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L276_C2", "vector": [13, 2, 0.5735, 0.0021, 2, 0.45, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._requestor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L279_C2", "label": "setrequestor", "type": "function", "loc": [279, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.5787, 0.0041, 1, 0.5, 0.4444, 716, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setrequestor", "arg_names": ["self", "email"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setrequestor(self, email):\n self._requestor = email"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L280_C4", "label": "self._requestor =", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L279_C2", "vector": [14, 2, 0.5797, 0.0021, 2, 0.03, 0.0, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._requestor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._requestor = email"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L282_C2", "label": "requestor = property()", "type": "assigned_variable", "loc": [282, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [14, 1, 0.5849, 0.0041, 1, 0.5, 0.5556, 483, 3, 4, 0, 0, 244, 10, 1], "semantic": {"name": "requestor", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " requestor = property(getrequestor, setrequestor, None,\n 'The email address of the user to act on behalf of')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L285_C2", "label": "set_store", "type": "function", "loc": [285, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.5994, 0.0207, 1, 0.5, 0.6667, 939, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_store", "arg_names": ["self", "store"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_store(self, store):\n \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L286_C4", "label": "expression", "type": "expression", "loc": [286, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L285_C2", "vector": [8, 2, 0.5994, 0.0166, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set the storage for the credential.\n\n Args:\n store: callable, a callable that when passed a Credential\n will store the credential back to where it came from.\n This is needed to store the latest access_token if it\n has been revoked.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L294_C4", "label": "self.store =", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L285_C2", "vector": [14, 2, 0.6087, 0.0021, 2, 0.34, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = store"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "label": "__getstate__", "type": "function", "loc": [296, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.617, 0.0104, 1, 0.5, 0.7778, 250, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n \"\"\"Trim the state down to something that can be pickled.\"\"\"\n d = copy.copy(self.__dict__)\n del d['store']\n return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L297_C4", "label": "expression", "type": "expression", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "vector": [8, 2, 0.6149, 0.0021, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Trim the state down to something that can be pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L298_C4", "label": "d = copy()", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "vector": [14, 2, 0.617, 0.0021, 2, 0.78, 0.5, 355, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d = copy.copy(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L300_C4", "label": "return", "type": "return", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "vector": [13, 2, 0.6211, 0.0021, 2, 0.78, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "label": "__setstate__", "type": "function", "loc": [302, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.6284, 0.0083, 1, 0.5, 0.8889, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__setstate__", "arg_names": ["self", "state"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, state):\n \"\"\"Reconstitute the state of the object from being pickled.\"\"\"\n self.__dict__.update(state)\n self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L303_C4", "label": "expression", "type": "expression", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "vector": [8, 2, 0.6273, 0.0021, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Reconstitute the state of the object from being pickled.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L304_C4", "label": "update()", "type": "expression", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "vector": [8, 2, 0.6294, 0.0021, 2, 0.38, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(state)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L305_C4", "label": "self.store =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "vector": [14, 2, 0.6315, 0.0021, 2, 0.38, 1.0, 375, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.store", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.store = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "label": "authorize", "type": "function", "loc": [307, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "vector": [2, 1, 0.7081, 0.147, 1, 0.5, 1.0, 880, 0, 2, 1, 0, 0, 0, 15], "semantic": {"name": "authorize", "arg_names": ["self", "http"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def authorize(self, http):\n \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L308_C4", "label": "expression", "type": "expression", "loc": [308, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "vector": [8, 2, 0.6594, 0.0455, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Authorize an httplib2.Http instance with these Credentials\n\n Args:\n http - An instance of httplib2.Http\n or something that acts like it.\n\n Returns:\n A modified instance of http that was passed in."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L330_C4", "label": "request_orig =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "vector": [14, 2, 0.6832, 0.0021, 2, 0.88, 0.2, 112, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "request_orig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " request_orig = http.request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L331_C4", "label": "signer = SignatureMethod_HMAC_SHA1()", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "vector": [14, 2, 0.6853, 0.0021, 2, 0.88, 0.4, 12, 3, 0, 0, 0, 948, 10, 1], "semantic": {"name": "signer", "arg_names": [], "import_names": [], "rhs_call_name": "SignatureMethod_HMAC_SHA1", "annotation": ""}, "snippet": " signer = oauth.SignatureMethod_HMAC_SHA1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "label": "new_request", "type": "function", "loc": [334, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "vector": [2, 2, 0.7329, 0.0849, 2, 0.88, 0.6, 23, 0, 6, 1, 0, 0, 0, 14], "semantic": {"name": "new_request", "arg_names": ["uri", "method", "body", "headers", "redirections", "connection_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_request(uri, method='GET', body=None, headers=None,\n redirections=httplib2.DEFAULT_MAX_REDIRECTS,\n connection_type=None):\n \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\"\n response_code = 302\n http.follow_redirects = False\n while response_code in [301, 302]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L337_C6", "label": "expression", "type": "expression", "loc": [337, 338], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "vector": [8, 3, 0.6988, 0.0041, 3, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Modify the request headers to add the appropriate\n Authorization header.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L339_C6", "label": "response_code =", "type": "assigned_variable", "loc": [339, 339], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "vector": [14, 3, 0.7019, 0.0021, 3, 0.92, 0.2, 558, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = 302"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L340_C6", "label": "http.follow_redirects =", "type": "assigned_variable", "loc": [340, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "vector": [14, 3, 0.7039, 0.0021, 3, 0.92, 0.4, 45, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "http.follow_redirects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.follow_redirects = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "label": "while", "type": "while", "loc": [341, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "vector": [5, 3, 0.7319, 0.0538, 3, 0.92, 0.6, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while response_code in [301, 302]:\n # add in xoauth_requestor_id=self._requestor to the uri\n if self._requestor is None:\n raise MissingParameter(\n 'Requestor must be set before using TwoLeggedOAuthCredentials')\n parsed = list(urlparse.urlparse(uri))\n q = parse_qsl(parsed[4])\n q.append(('xoauth_requestor_id', self._requestor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L343_C8", "label": "if", "type": "if", "loc": [343, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [4, 4, 0.7122, 0.0062, 4, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._requestor is None:\n raise MissingParameter(\n 'Requestor must be set before using TwoLeggedOAuthCredentials')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L346_C8", "label": "parsed = list()", "type": "assigned_variable", "loc": [346, 346], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7164, 0.0021, 4, 0.78, 0.0769, 313, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "parsed", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " parsed = list(urlparse.urlparse(uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L347_C8", "label": "q = parse_qsl()", "type": "assigned_variable", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7184, 0.0021, 4, 0.78, 0.1538, 516, 3, 1, 0, 0, 6, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "parse_qsl", "annotation": ""}, "snippet": " q = parse_qsl(parsed[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L348_C8", "label": "append()", "type": "expression", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [8, 4, 0.7205, 0.0021, 4, 0.78, 0.2308, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " q.append(('xoauth_requestor_id', self._requestor))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L349_C8", "label": " = urlencode()", "type": "assigned_variable", "loc": [349, 349], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7226, 0.0021, 4, 0.78, 0.3077, 0, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " parsed[4] = urllib.urlencode(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L350_C8", "label": "uri = urlunparse()", "type": "assigned_variable", "loc": [350, 350], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7246, 0.0021, 4, 0.78, 0.3846, 600, 3, 1, 0, 0, 618, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "urlunparse", "annotation": ""}, "snippet": " uri = urlparse.urlunparse(parsed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L352_C8", "label": "req = from_consumer_and_token()", "type": "assigned_variable", "loc": [352, 353], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7298, 0.0041, 4, 0.78, 0.4615, 233, 3, 4, 0, 0, 319, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "from_consumer_and_token", "annotation": ""}, "snippet": " req = oauth.Request.from_consumer_and_token(\n self.consumer, None, http_method=method, http_url=uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L354_C8", "label": "sign_request()", "type": "expression", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [8, 4, 0.7329, 0.0021, 4, 0.78, 0.5385, 817, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "sign_request", "arg_names": [], "import_names": [], "rhs_call_name": "sign_request", "annotation": ""}, "snippet": " req.sign_request(signer, self.consumer, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L355_C8", "label": "if", "type": "if", "loc": [355, 356], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [4, 4, 0.736, 0.0041, 4, 0.78, 0.6154, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if headers is None:\n headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L356_C10", "label": "headers =", "type": "assigned_variable", "loc": [356, 356], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L355_C8", "vector": [14, 5, 0.7371, 0.0021, 5, 0.51, 0.0, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L357_C8", "label": "update()", "type": "expression", "loc": [357, 357], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [8, 4, 0.7391, 0.0021, 4, 0.78, 0.6923, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " headers.update(req.to_header())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L358_C8", "label": "if", "type": "if", "loc": [358, 361], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [4, 4, 0.7443, 0.0083, 4, 0.78, 0.7692, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']\n else:\n headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L359_C10", "label": "assign", "type": "assigned_variable", "loc": [359, 359], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L358_C8", "vector": [14, 5, 0.7433, 0.0021, 5, 0.26, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L361_C10", "label": "assign", "type": "assigned_variable", "loc": [361, 361], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L358_C8", "vector": [14, 5, 0.7474, 0.0021, 5, 0.26, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = self.user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L362_C8", "label": "resp, content = request_orig()", "type": "assigned_variable", "loc": [362, 363], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7505, 0.0041, 4, 0.78, 0.8462, 339, 3, 6, 0, 0, 112, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request_orig", "annotation": ""}, "snippet": " resp, content = request_orig(uri, method, body, headers,\n redirections, connection_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L364_C8", "label": "response_code =", "type": "assigned_variable", "loc": [364, 364], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [14, 4, 0.7536, 0.0021, 4, 0.78, 0.9231, 558, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "response_code", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " response_code = resp.status"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L365_C8", "label": "if", "type": "if", "loc": [365, 366], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "vector": [4, 4, 0.7567, 0.0041, 4, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code in [301, 302]:\n uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L366_C10", "label": "uri =", "type": "assigned_variable", "loc": [366, 366], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L365_C8", "vector": [14, 5, 0.7578, 0.0021, 5, 0.46, 0.0, 600, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " uri = resp['location']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L368_C6", "label": "if", "type": "if", "loc": [368, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "vector": [4, 3, 0.766, 0.0104, 3, 0.92, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response_code == 401:\n logging.info('Access token no longer valid: %s' % content)\n # Do not store the invalid state of the Credentials because\n # being 2LO they could be reinstated in the future.\n raise CredentialsInvalidError(\"Credentials are invalid.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L369_C8", "label": "info()", "type": "expression", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L368_C6", "vector": [8, 4, 0.764, 0.0021, 4, 0.02, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('Access token no longer valid: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L374_C6", "label": "return", "type": "return", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "vector": [13, 3, 0.7743, 0.0021, 3, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp, content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L376_C4", "label": "http.request =", "type": "assigned_variable", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "vector": [14, 2, 0.7785, 0.0021, 2, 0.88, 0.8, 47, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "http.request", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " http.request = new_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L377_C4", "label": "return", "type": "return", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "vector": [13, 2, 0.7805, 0.0021, 2, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return http"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "label": "FlowThreeLegged", "type": "class", "loc": [380, 483], "level": 0, "parent": null, "vector": [3, 0, 0.8934, 0.2153, 0, 0.66, 1.0, 273, 0, 3, 0, 0, 746, 0, 30], "semantic": {"name": "FlowThreeLegged", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowThreeLegged(Flow):\n \"\"\"Does the Three Legged Dance for OAuth 1.0a.\n \"\"\"\n\n def __init__(self, discovery, consumer_key, consumer_secret, user_agent,\n **kwargs):\n \"\"\"\n discovery - Section of the API discovery document that describes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L381_C2", "label": "expression", "type": "expression", "loc": [381, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "vector": [8, 1, 0.7899, 0.0041, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Does the Three Legged Dance for OAuth 1.0a.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "label": "__init__", "type": "function", "loc": [384, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "vector": [2, 1, 0.8199, 0.0518, 1, 0.01, 0.3333, 555, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "discovery", "consumer_key", "consumer_secret", "user_agent", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, discovery, consumer_key, consumer_secret, user_agent,\n **kwargs):\n \"\"\"\n discovery - Section of the API discovery document that describes\n the OAuth endpoints.\n consumer_key - OAuth consumer key\n consumer_secret - OAuth consumer secret\n user_agent - The HTTP User-Agent that identifies the application."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L386_C4", "label": "expression", "type": "expression", "loc": [386, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [8, 2, 0.8075, 0.0186, 2, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n discovery - Section of the API discovery document that describes\n the OAuth endpoints.\n consumer_key - OAuth consumer key\n consumer_secret - OAuth consumer secret\n user_agent - The HTTP User-Agent that identifies the application.\n **kwargs - The keyword arguments are all optional and required\n parameters for the OAuth calls."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L395_C4", "label": "self.discovery =", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.8178, 0.0021, 2, 0.0, 0.1111, 432, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.discovery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.discovery = discovery"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L396_C4", "label": "self.consumer_key =", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.8199, 0.0021, 2, 0.0, 0.2222, 126, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.consumer_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.consumer_key = consumer_key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L397_C4", "label": "self.consumer_secret =", "type": "assigned_variable", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.8219, 0.0021, 2, 0.0, 0.3333, 519, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.consumer_secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.consumer_secret = consumer_secret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L398_C4", "label": "self.user_agent =", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.824, 0.0021, 2, 0.0, 0.4444, 723, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.user_agent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.user_agent = user_agent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L399_C4", "label": "self.params =", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.8261, 0.0021, 2, 0.0, 0.5556, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L400_C4", "label": "self.request_token =", "type": "assigned_variable", "loc": [400, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.8282, 0.0021, 2, 0.0, 0.6667, 763, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.request_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.request_token = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L401_C4", "label": "required =", "type": "assigned_variable", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [14, 2, 0.8302, 0.0021, 2, 0.0, 0.7778, 984, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "required", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " required = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L402_C4", "label": "for uriinfo", "type": "for", "loc": [402, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [6, 2, 0.8354, 0.0083, 2, 0.0, 0.8889, 825, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "uriinfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for uriinfo in discovery.itervalues():\n for name, value in uriinfo['parameters'].iteritems():\n if value['required'] and not name.startswith('oauth_'):\n required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L403_C6", "label": "for name, value", "type": "for", "loc": [403, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L402_C4", "vector": [6, 3, 0.8364, 0.0062, 3, 0.39, 0.0, 509, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in uriinfo['parameters'].iteritems():\n if value['required'] and not name.startswith('oauth_'):\n required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L404_C8", "label": "if", "type": "if", "loc": [404, 405], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L403_C6", "vector": [4, 4, 0.8375, 0.0041, 4, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value['required'] and not name.startswith('oauth_'):\n required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L405_C10", "label": "assign", "type": "assigned_variable", "loc": [405, 405], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L404_C8", "vector": [14, 5, 0.8385, 0.0021, 5, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " required[name] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L406_C4", "label": "for key", "type": "for", "loc": [406, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "vector": [6, 2, 0.8427, 0.0062, 2, 0.0, 1.0, 230, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in required.iterkeys():\n if key not in self.params:\n raise MissingParameter('Required parameter %s not supplied' % key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L407_C6", "label": "if", "type": "if", "loc": [407, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L406_C4", "vector": [4, 3, 0.8437, 0.0041, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key not in self.params:\n raise MissingParameter('Required parameter %s not supplied' % key)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "label": "step1_get_authorize_url", "type": "function", "loc": [410, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "vector": [2, 1, 0.883, 0.0704, 1, 0.01, 0.6667, 752, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "step1_get_authorize_url", "arg_names": ["self", "oauth_callback"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step1_get_authorize_url(self, oauth_callback='oob'):\n \"\"\"Returns a URI to redirect to the provider.\n\n oauth_callback - Either the string 'oob' for a non-web-based application,\n or a URI that handles the callback from the authorization\n server.\n\n If oauth_callback is 'oob' then pass in the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L411_C4", "label": "expression", "type": "expression", "loc": [411, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [8, 2, 0.8613, 0.0228, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns a URI to redirect to the provider.\n\n oauth_callback - Either the string 'oob' for a non-web-based application,\n or a URI that handles the callback from the authorization\n server.\n\n If oauth_callback is 'oob' then pass in the\n generated verification code to step2_exchange,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L422_C4", "label": "consumer = Consumer()", "type": "assigned_variable", "loc": [422, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.8737, 0.0021, 2, 0.32, 0.0909, 352, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "consumer", "arg_names": [], "import_names": [], "rhs_call_name": "Consumer", "annotation": ""}, "snippet": " consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L423_C4", "label": "client = Client()", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.8758, 0.0021, 2, 0.32, 0.1818, 608, 3, 1, 0, 0, 412, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": " client = oauth.Client(consumer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L425_C4", "label": "headers =", "type": "assigned_variable", "loc": [425, 428], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.883, 0.0083, 2, 0.32, 0.2727, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'user-agent': self.user_agent,\n 'content-type': 'application/x-www-form-urlencoded'\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L429_C4", "label": "body = urlencode()", "type": "assigned_variable", "loc": [429, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.8882, 0.0021, 2, 0.32, 0.3636, 477, 3, 1, 0, 0, 414, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "urlencode", "annotation": ""}, "snippet": " body = urllib.urlencode({'oauth_callback': oauth_callback})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L430_C4", "label": "uri = _oauth_uri()", "type": "assigned_variable", "loc": [430, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.8903, 0.0021, 2, 0.32, 0.4545, 600, 3, 3, 0, 0, 122, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "_oauth_uri", "annotation": ""}, "snippet": " uri = _oauth_uri('request', self.discovery, self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L432_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [432, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.8954, 0.0041, 2, 0.32, 0.5455, 339, 3, 4, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = client.request(uri, 'POST', headers=headers,\n body=body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L434_C4", "label": "if", "type": "if", "loc": [434, 436], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [4, 2, 0.9006, 0.0062, 2, 0.32, 0.6364, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp['status'] != '200':\n logging.error('Failed to retrieve temporary authorization: %s', content)\n raise RequestError('Invalid response %s.' % resp['status'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L435_C6", "label": "error()", "type": "expression", "loc": [435, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L434_C4", "vector": [8, 3, 0.9006, 0.0021, 3, 0.68, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Failed to retrieve temporary authorization: %s', content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L438_C4", "label": "self.request_token = dict()", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.9068, 0.0021, 2, 0.32, 0.7273, 763, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "self.request_token", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " self.request_token = dict(parse_qsl(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L440_C4", "label": "auth_params = copy()", "type": "assigned_variable", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.911, 0.0021, 2, 0.32, 0.8182, 601, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "auth_params", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " auth_params = copy.copy(self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L441_C4", "label": "assign", "type": "assigned_variable", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [14, 2, 0.913, 0.0021, 2, 0.32, 0.9091, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " auth_params['oauth_token'] = self.request_token['oauth_token']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L443_C4", "label": "return", "type": "return", "loc": [443, 443], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "vector": [13, 2, 0.9172, 0.0021, 2, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _oauth_uri('authorize', self.discovery, auth_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "label": "step2_exchange", "type": "function", "loc": [445, 483], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "vector": [2, 1, 0.9607, 0.0807, 1, 0.01, 1.0, 471, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "step2_exchange", "arg_names": ["self", "verifier"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def step2_exchange(self, verifier):\n \"\"\"Exhanges an authorized request token\n for OAuthCredentials.\n\n Args:\n verifier: string, dict - either the verifier token, or a dictionary\n of the query parameters to the callback, which contains\n the oauth_verifier."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L446_C4", "label": "expression", "type": "expression", "loc": [446, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [8, 2, 0.9327, 0.0207, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exhanges an authorized request token\n for OAuthCredentials.\n\n Args:\n verifier: string, dict - either the verifier token, or a dictionary\n of the query parameters to the callback, which contains\n the oauth_verifier.\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L457_C4", "label": "if", "type": "if", "loc": [457, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [4, 2, 0.9472, 0.0041, 2, 0.17, 0.0833, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (isinstance(verifier, str) or isinstance(verifier, unicode)):\n verifier = verifier['oauth_verifier']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L458_C6", "label": "verifier =", "type": "assigned_variable", "loc": [458, 458], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L457_C4", "vector": [14, 3, 0.9482, 0.0021, 3, 0.96, 0.0, 629, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "verifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " verifier = verifier['oauth_verifier']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L460_C4", "label": "token = Token()", "type": "assigned_variable", "loc": [460, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9545, 0.0062, 2, 0.17, 0.1667, 129, 3, 2, 0, 0, 92, 10, 1], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "Token", "annotation": ""}, "snippet": " token = oauth.Token(\n self.request_token['oauth_token'],\n self.request_token['oauth_token_secret'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L463_C4", "label": "set_verifier()", "type": "expression", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [8, 2, 0.9586, 0.0021, 2, 0.17, 0.25, 943, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_verifier", "arg_names": [], "import_names": [], "rhs_call_name": "set_verifier", "annotation": ""}, "snippet": " token.set_verifier(verifier)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L464_C4", "label": "consumer = Consumer()", "type": "assigned_variable", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9607, 0.0021, 2, 0.17, 0.3333, 352, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "consumer", "arg_names": [], "import_names": [], "rhs_call_name": "Consumer", "annotation": ""}, "snippet": " consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L465_C4", "label": "client = Client()", "type": "assigned_variable", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9627, 0.0021, 2, 0.17, 0.4167, 608, 3, 2, 0, 0, 412, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "Client", "annotation": ""}, "snippet": " client = oauth.Client(consumer, token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L467_C4", "label": "headers =", "type": "assigned_variable", "loc": [467, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.97, 0.0083, 2, 0.17, 0.5, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {\n 'user-agent': self.user_agent,\n 'content-type': 'application/x-www-form-urlencoded'\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L472_C4", "label": "uri = _oauth_uri()", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9772, 0.0021, 2, 0.17, 0.5833, 600, 3, 3, 0, 0, 122, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "_oauth_uri", "annotation": ""}, "snippet": " uri = _oauth_uri('access', self.discovery, self.params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L473_C4", "label": "resp, content = request()", "type": "assigned_variable", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9793, 0.0021, 2, 0.17, 0.6667, 339, 3, 3, 0, 0, 50, 10, 1], "semantic": {"name": "resp, content", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " resp, content = client.request(uri, 'POST', headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L474_C4", "label": "if", "type": "if", "loc": [474, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [4, 2, 0.9834, 0.0062, 2, 0.17, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp['status'] != '200':\n logging.error('Failed to retrieve access token: %s', content)\n raise RequestError('Invalid response %s.' % resp['status'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L475_C6", "label": "error()", "type": "expression", "loc": [475, 475], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L474_C4", "vector": [8, 3, 0.9834, 0.0021, 3, 0.04, 0.0, 771, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Failed to retrieve access token: %s', content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L478_C4", "label": "oauth_params = dict()", "type": "assigned_variable", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9896, 0.0021, 2, 0.17, 0.8333, 47, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "oauth_params", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " oauth_params = dict(parse_qsl(content))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L479_C4", "label": "token = Token()", "type": "assigned_variable", "loc": [479, 481], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [14, 2, 0.9938, 0.0062, 2, 0.17, 0.9167, 129, 3, 2, 0, 0, 92, 10, 1], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "Token", "annotation": ""}, "snippet": " token = oauth.Token(\n oauth_params['oauth_token'],\n oauth_params['oauth_token_secret'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L483_C4", "label": "return", "type": "return", "loc": [483, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "vector": [13, 2, 1.0, 0.0021, 2, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return OAuthCredentials(consumer, token, self.user_agent)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99178:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:ImportFrom_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:Try_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:ImportFrom_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L75_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L77_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L117_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L117_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L117_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L146_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L146_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L146_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L150_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L150_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L161_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L167_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L202_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L204_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L211_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L214_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L216_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L206_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L222_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L225_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L229_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L232_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L172_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L254_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L276_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L276_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L279_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L279_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L282_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L285_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L285_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L296_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L302_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L337_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L339_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L340_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L355_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L356_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L358_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L359_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L358_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L361_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:While_L341_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L366_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L368_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L368_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L374_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L381_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L403_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L403_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L405_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L384_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:For_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L407_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L430_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L432_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L434_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L435_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L440_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L441_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L410_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:ClassDef_L380_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L458_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L460_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L463_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L472_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L473_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:If_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Expr_L475_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L478_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Assign_L479_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99178:FunctionDef_L445_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99178:Return_L483_C4"}] |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Model objects for requests and responses.
Each API may support one or more serializations, such
as JSON, Atom, etc. The model classes are responsible
for converting between the wire format and the Python
object representation.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import gflags
import logging
import urllib
from errors import HttpError
from oauth2client.anyjson import simplejson
FLAGS = gflags.FLAGS
gflags.DEFINE_boolean('dump_request_response', False,
'Dump all http server requests and responses. '
)
def _abstract():
raise NotImplementedError('You need to override this function')
class Model(object):
"""Model base class.
All Model classes should implement this interface.
The Model serializes and de-serializes between a wire
format such as JSON and a Python object representation.
"""
def request(self, headers, path_params, query_params, body_value):
"""Updates outgoing requests with a serialized body.
Args:
headers: dict, request headers
path_params: dict, parameters that appear in the request path
query_params: dict, parameters that appear in the query
body_value: object, the request body as a Python object, which must be
serializable.
Returns:
A tuple of (headers, path_params, query, body)
headers: dict, request headers
path_params: dict, parameters that appear in the request path
query: string, query part of the request URI
body: string, the body serialized in the desired wire format.
"""
_abstract()
def response(self, resp, content):
"""Convert the response wire format into a Python object.
Args:
resp: httplib2.Response, the HTTP response headers and status
content: string, the body of the HTTP response
Returns:
The body de-serialized as a Python object.
Raises:
apiclient.errors.HttpError if a non 2xx response is received.
"""
_abstract()
class BaseModel(Model):
"""Base model class.
Subclasses should provide implementations for the "serialize" and
"deserialize" methods, as well as values for the following class attributes.
Attributes:
accept: The value to use for the HTTP Accept header.
content_type: The value to use for the HTTP Content-type header.
no_content_response: The value to return when deserializing a 204 "No
Content" response.
alt_param: The value to supply as the "alt" query parameter for requests.
"""
accept = None
content_type = None
no_content_response = None
alt_param = None
def _log_request(self, headers, path_params, query, body):
"""Logs debugging information about the request if requested."""
if FLAGS.dump_request_response:
logging.info('--request-start--')
logging.info('-headers-start-')
for h, v in headers.iteritems():
logging.info('%s: %s', h, v)
logging.info('-headers-end-')
logging.info('-path-parameters-start-')
for h, v in path_params.iteritems():
logging.info('%s: %s', h, v)
logging.info('-path-parameters-end-')
logging.info('body: %s', body)
logging.info('query: %s', query)
logging.info('--request-end--')
def request(self, headers, path_params, query_params, body_value):
"""Updates outgoing requests with a serialized body.
Args:
headers: dict, request headers
path_params: dict, parameters that appear in the request path
query_params: dict, parameters that appear in the query
body_value: object, the request body as a Python object, which must be
serializable by simplejson.
Returns:
A tuple of (headers, path_params, query, body)
headers: dict, request headers
path_params: dict, parameters that appear in the request path
query: string, query part of the request URI
body: string, the body serialized as JSON
"""
query = self._build_query(query_params)
headers['accept'] = self.accept
headers['accept-encoding'] = 'gzip, deflate'
if 'user-agent' in headers:
headers['user-agent'] += ' '
else:
headers['user-agent'] = ''
headers['user-agent'] += 'google-api-python-client/1.0'
if body_value is not None:
headers['content-type'] = self.content_type
body_value = self.serialize(body_value)
self._log_request(headers, path_params, query, body_value)
return (headers, path_params, query, body_value)
def _build_query(self, params):
"""Builds a query string.
Args:
params: dict, the query parameters
Returns:
The query parameters properly encoded into an HTTP URI query string.
"""
if self.alt_param is not None:
params.update({'alt': self.alt_param})
astuples = []
for key, value in params.iteritems():
if type(value) == type([]):
for x in value:
x = x.encode('utf-8')
astuples.append((key, x))
else:
if getattr(value, 'encode', False) and callable(value.encode):
value = value.encode('utf-8')
astuples.append((key, value))
return '?' + urllib.urlencode(astuples)
def _log_response(self, resp, content):
"""Logs debugging information about the response if requested."""
if FLAGS.dump_request_response:
logging.info('--response-start--')
for h, v in resp.iteritems():
logging.info('%s: %s', h, v)
if content:
logging.info(content)
logging.info('--response-end--')
def response(self, resp, content):
"""Convert the response wire format into a Python object.
Args:
resp: httplib2.Response, the HTTP response headers and status
content: string, the body of the HTTP response
Returns:
The body de-serialized as a Python object.
Raises:
apiclient.errors.HttpError if a non 2xx response is received.
"""
self._log_response(resp, content)
# Error handling is TBD, for example, do we retry
# for some operation/error combinations?
if resp.status < 300:
if resp.status == 204:
# A 204: No Content response should be treated differently
# to all the other success states
return self.no_content_response
return self.deserialize(content)
else:
logging.debug('Content from bad request was: %s' % content)
raise HttpError(resp, content)
def serialize(self, body_value):
"""Perform the actual Python object serialization.
Args:
body_value: object, the request body as a Python object.
Returns:
string, the body in serialized form.
"""
_abstract()
def deserialize(self, content):
"""Perform the actual deserialization from response string to Python
object.
Args:
content: string, the body of the HTTP response
Returns:
The body de-serialized as a Python object.
"""
_abstract()
class JsonModel(BaseModel):
"""Model class for JSON.
Serializes and de-serializes between JSON and the Python
object representation of HTTP request and response bodies.
"""
accept = 'application/json'
content_type = 'application/json'
alt_param = 'json'
def __init__(self, data_wrapper=False):
"""Construct a JsonModel.
Args:
data_wrapper: boolean, wrap requests and responses in a data wrapper
"""
self._data_wrapper = data_wrapper
def serialize(self, body_value):
if (isinstance(body_value, dict) and 'data' not in body_value and
self._data_wrapper):
body_value = {'data': body_value}
return simplejson.dumps(body_value)
def deserialize(self, content):
body = simplejson.loads(content)
if isinstance(body, dict) and 'data' in body:
body = body['data']
return body
@property
def no_content_response(self):
return {}
class RawModel(JsonModel):
"""Model class for requests that don't return JSON.
Serializes and de-serializes between JSON and the Python
object representation of HTTP request, and returns the raw bytes
of the response body.
"""
accept = '*/*'
content_type = 'application/json'
alt_param = None
def deserialize(self, content):
return content
@property
def no_content_response(self):
return ''
class MediaModel(JsonModel):
"""Model class for requests that return Media.
Serializes and de-serializes between JSON and the Python
object representation of HTTP request, and returns the raw bytes
of the response body.
"""
accept = '*/*'
content_type = 'application/json'
alt_param = 'media'
def deserialize(self, content):
return content
@property
def no_content_response(self):
return ''
class ProtocolBufferModel(BaseModel):
"""Model class for protocol buffers.
Serializes and de-serializes the binary protocol buffer sent in the HTTP
request and response bodies.
"""
accept = 'application/x-protobuf'
content_type = 'application/x-protobuf'
alt_param = 'proto'
def __init__(self, protocol_buffer):
"""Constructs a ProtocolBufferModel.
The serialzed protocol buffer returned in an HTTP response will be
de-serialized using the given protocol buffer class.
Args:
protocol_buffer: The protocol buffer class used to de-serialize a
response from the API.
"""
self._protocol_buffer = protocol_buffer
def serialize(self, body_value):
return body_value.SerializeToString()
def deserialize(self, content):
return self._protocol_buffer.FromString(content)
@property
def no_content_response(self):
return self._protocol_buffer()
def makepatch(original, modified):
"""Create a patch object.
Some methods support PATCH, an efficient way to send updates to a resource.
This method allows the easy construction of patch bodies by looking at the
differences between a resource before and after it was modified.
Args:
original: object, the original deserialized resource
modified: object, the modified deserialized resource
Returns:
An object that contains only the changes from original to modified, in a
form suitable to pass to a PATCH method.
Example usage:
item = service.activities().get(postid=postid, userid=userid).execute()
original = copy.deepcopy(item)
item['object']['content'] = 'This is updated.'
service.activities.patch(postid=postid, userid=userid,
body=makepatch(original, item)).execute()
"""
patch = {}
for key, original_value in original.iteritems():
modified_value = modified.get(key, None)
if modified_value is None:
# Use None to signal that the element is deleted
patch[key] = None
elif original_value != modified_value:
if type(original_value) == type({}):
# Recursively descend objects
patch[key] = makepatch(original_value, modified_value)
else:
# In the case of simple types or arrays we just replace
patch[key] = modified_value
else:
# Don't add anything to patch if there's no change
pass
for key in modified:
if key not in original:
patch[key] = modified[key]
return patch
| ajibawa-2023/Python-Code-Large/train/row_99179 | 154 | 385 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 23], "level": 0, "parent": null, "vector": [8, 0, 0.0519, 0.0182, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Model objects for requests and responses.\n\nEach API may support one or more serializations, such\nas JSON, Atom, etc. The model classes are responsible\nfor converting between the wire format and the Python\nobject representation.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L25_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.0649, 0.0026, 0, 0.66, 0.0625, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Import_L27_C0", "label": "gflags import gflags", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0701, 0.0026, 0, 0.66, 0.125, 927, 0, 1, 0, 0, 927, 0, 0], "semantic": {"name": "gflags", "arg_names": [], "import_names": ["gflags"], "rhs_call_name": "", "annotation": ""}, "snippet": "import gflags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Import_L28_C0", "label": "logging import logging", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.0727, 0.0026, 0, 0.66, 0.1875, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Import_L29_C0", "label": "urllib import urllib", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0753, 0.0026, 0, 0.66, 0.25, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ImportFrom_L31_C0", "label": "from errors import HttpError", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0805, 0.0026, 0, 0.66, 0.3125, 841, 0, 1, 0, 0, 841, 0, 0], "semantic": {"name": "errors", "arg_names": [], "import_names": ["HttpError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from errors import HttpError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ImportFrom_L32_C0", "label": "from oauth2client.anyjson import simplejson", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0831, 0.0026, 0, 0.66, 0.375, 822, 0, 1, 0, 0, 822, 0, 0], "semantic": {"name": "oauth2client.anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L34_C0", "label": "FLAGS =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.0883, 0.0026, 0, 0.66, 0.4375, 578, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "FLAGS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FLAGS = gflags.FLAGS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L36_C0", "label": "DEFINE_boolean()", "type": "expression", "loc": [36, 38], "level": 0, "parent": null, "vector": [8, 0, 0.0961, 0.0078, 0, 0.66, 0.5, 403, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "DEFINE_boolean", "arg_names": [], "import_names": [], "rhs_call_name": "DEFINE_boolean", "annotation": ""}, "snippet": "gflags.DEFINE_boolean('dump_request_response', False,\n 'Dump all http server requests and responses. '\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L41_C0", "label": "_abstract", "type": "function", "loc": [41, 42], "level": 0, "parent": null, "vector": [2, 0, 0.1078, 0.0052, 0, 0.66, 0.5625, 629, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _abstract():\n raise NotImplementedError('You need to override this function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "label": "Model", "type": "class", "loc": [45, 85], "level": 0, "parent": null, "vector": [3, 0, 0.1688, 0.1065, 0, 0.66, 0.625, 929, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "Model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Model(object):\n \"\"\"Model base class.\n\n All Model classes should implement this interface.\n The Model serializes and de-serializes between a wire\n format such as JSON and a Python object representation.\n \"\"\"\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "vector": [8, 1, 0.126, 0.0156, 1, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model base class.\n\n All Model classes should implement this interface.\n The Model serializes and de-serializes between a wire\n format such as JSON and a Python object representation.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L53_C2", "label": "request", "type": "function", "loc": [53, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "vector": [2, 1, 0.1597, 0.0468, 1, 0.0, 0.5, 50, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "request", "arg_names": ["self", "headers", "path_params", "query_params", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def request(self, headers, path_params, query_params, body_value):\n \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L53_C2", "vector": [8, 2, 0.1597, 0.0416, 2, 0.16, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be\n serializable."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L70_C4", "label": "_abstract()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L53_C2", "vector": [8, 2, 0.1818, 0.0026, 2, 0.16, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L72_C2", "label": "response", "type": "function", "loc": [72, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "vector": [2, 1, 0.2039, 0.0364, 1, 0.0, 1.0, 511, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "response", "arg_names": ["self", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def response(self, resp, content):\n \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L73_C4", "label": "expression", "type": "expression", "loc": [73, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L72_C2", "vector": [8, 2, 0.2039, 0.0312, 2, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:\n The body de-serialized as a Python object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L85_C4", "label": "_abstract()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L72_C2", "vector": [8, 2, 0.2208, 0.0026, 2, 0.85, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "label": "BaseModel", "type": "class", "loc": [88, 235], "level": 0, "parent": null, "vector": [3, 0, 0.4195, 0.3844, 0, 0.66, 0.6875, 389, 0, 7, 0, 0, 929, 0, 37], "semantic": {"name": "BaseModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseModel(Model):\n \"\"\"Base model class.\n\n Subclasses should provide implementations for the \"serialize\" and\n \"deserialize\" methods, as well as values for the following class attributes.\n\n Attributes:\n accept: The value to use for the HTTP Accept header."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L89_C2", "label": "expression", "type": "expression", "loc": [89, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [8, 1, 0.2455, 0.0312, 1, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base model class.\n\n Subclasses should provide implementations for the \"serialize\" and\n \"deserialize\" methods, as well as values for the following class attributes.\n\n Attributes:\n accept: The value to use for the HTTP Accept header.\n content_type: The value to use for the HTTP Content-type header."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L102_C2", "label": "accept =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [14, 1, 0.2649, 0.0026, 1, 0.06, 0.0909, 829, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L103_C2", "label": "content_type =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [14, 1, 0.2675, 0.0026, 1, 0.06, 0.1818, 610, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L104_C2", "label": "no_content_response =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [14, 1, 0.2701, 0.0026, 1, 0.06, 0.2727, 329, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "no_content_response", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " no_content_response = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L105_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [14, 1, 0.2727, 0.0026, 1, 0.06, 0.3636, 776, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L107_C2", "label": "_log_request", "type": "function", "loc": [107, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.2961, 0.039, 1, 0.06, 0.4545, 720, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "_log_request", "arg_names": ["self", "headers", "path_params", "query", "body"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _log_request(self, headers, path_params, query, body):\n \"\"\"Logs debugging information about the request if requested.\"\"\"\n if FLAGS.dump_request_response:\n logging.info('--request-start--')\n logging.info('-headers-start-')\n for h, v in headers.iteritems():\n logging.info('%s: %s', h, v)\n logging.info('-headers-end-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L108_C4", "label": "expression", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L107_C2", "vector": [8, 2, 0.2805, 0.0026, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Logs debugging information about the request if requested.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "label": "if", "type": "if", "loc": [109, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L107_C2", "vector": [4, 2, 0.2987, 0.0338, 2, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if FLAGS.dump_request_response:\n logging.info('--request-start--')\n logging.info('-headers-start-')\n for h, v in headers.iteritems():\n logging.info('%s: %s', h, v)\n logging.info('-headers-end-')\n logging.info('-path-parameters-start-')\n for h, v in path_params.iteritems():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L110_C6", "label": "info()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.2857, 0.0026, 3, 0.82, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--request-start--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L111_C6", "label": "info()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.2883, 0.0026, 3, 0.82, 0.1111, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-headers-start-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L112_C6", "label": "for h, v", "type": "for", "loc": [112, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [6, 3, 0.2922, 0.0052, 3, 0.82, 0.2222, 971, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for h, v in headers.iteritems():\n logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L113_C8", "label": "info()", "type": "expression", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L112_C6", "vector": [8, 4, 0.2935, 0.0026, 4, 0.15, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L114_C6", "label": "info()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.2961, 0.0026, 3, 0.82, 0.3333, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-headers-end-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L115_C6", "label": "info()", "type": "expression", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.2987, 0.0026, 3, 0.82, 0.4444, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-path-parameters-start-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L116_C6", "label": "for h, v", "type": "for", "loc": [116, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [6, 3, 0.3026, 0.0052, 3, 0.82, 0.5556, 971, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for h, v in path_params.iteritems():\n logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L117_C8", "label": "info()", "type": "expression", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L116_C6", "vector": [8, 4, 0.3039, 0.0026, 4, 0.98, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L118_C6", "label": "info()", "type": "expression", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.3065, 0.0026, 3, 0.82, 0.6667, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('-path-parameters-end-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L119_C6", "label": "info()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.3091, 0.0026, 3, 0.82, 0.7778, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('body: %s', body)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L120_C6", "label": "info()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.3117, 0.0026, 3, 0.82, 0.8889, 730, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('query: %s', query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L121_C6", "label": "info()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "vector": [8, 3, 0.3143, 0.0026, 3, 0.82, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--request-end--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "label": "request", "type": "function", "loc": [123, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.3584, 0.0805, 1, 0.06, 0.5455, 50, 0, 5, 1, 0, 0, 0, 3], "semantic": {"name": "request", "arg_names": ["self", "headers", "path_params", "query_params", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def request(self, headers, path_params, query_params, body_value):\n \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L124_C4", "label": "expression", "type": "expression", "loc": [124, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [8, 2, 0.3416, 0.0416, 2, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Updates outgoing requests with a serialized body.\n\n Args:\n headers: dict, request headers\n path_params: dict, parameters that appear in the request path\n query_params: dict, parameters that appear in the query\n body_value: object, the request body as a Python object, which must be\n serializable by simplejson."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L140_C4", "label": "query = _build_query()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [14, 2, 0.3636, 0.0026, 2, 0.1, 0.1429, 546, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "_build_query", "annotation": ""}, "snippet": " query = self._build_query(query_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L141_C4", "label": "assign", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [14, 2, 0.3662, 0.0026, 2, 0.1, 0.2857, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['accept'] = self.accept"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L142_C4", "label": "assign", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [14, 2, 0.3688, 0.0026, 2, 0.1, 0.4286, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['accept-encoding'] = 'gzip, deflate'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L143_C4", "label": "if", "type": "if", "loc": [143, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [4, 2, 0.3753, 0.0104, 2, 0.1, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'user-agent' in headers:\n headers['user-agent'] += ' '\n else:\n headers['user-agent'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L146_C6", "label": "assign", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L143_C4", "vector": [14, 3, 0.3792, 0.0026, 3, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['user-agent'] = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L149_C4", "label": "if", "type": "if", "loc": [149, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [4, 2, 0.3896, 0.0078, 2, 0.1, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if body_value is not None:\n headers['content-type'] = self.content_type\n body_value = self.serialize(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L150_C6", "label": "assign", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L149_C4", "vector": [14, 3, 0.3896, 0.0026, 3, 0.82, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers['content-type'] = self.content_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L151_C6", "label": "body_value = serialize()", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L149_C4", "vector": [14, 3, 0.3922, 0.0026, 3, 0.82, 1.0, 70, 3, 1, 0, 0, 50, 10, 1], "semantic": {"name": "body_value", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " body_value = self.serialize(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L152_C4", "label": "_log_request()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [8, 2, 0.3948, 0.0026, 2, 0.1, 0.8571, 720, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_log_request", "arg_names": [], "import_names": [], "rhs_call_name": "_log_request", "annotation": ""}, "snippet": " self._log_request(headers, path_params, query, body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L153_C4", "label": "return", "type": "return", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "vector": [13, 2, 0.3974, 0.0026, 2, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (headers, path_params, query, body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "label": "_build_query", "type": "function", "loc": [155, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.4299, 0.0571, 1, 0.06, 0.6364, 453, 0, 2, 1, 0, 0, 0, 11], "semantic": {"name": "_build_query", "arg_names": ["self", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _build_query(self, params):\n \"\"\"Builds a query string.\n\n Args:\n params: dict, the query parameters\n\n Returns:\n The query parameters properly encoded into an HTTP URI query string."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L156_C4", "label": "expression", "type": "expression", "loc": [156, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "vector": [8, 2, 0.4143, 0.0208, 2, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Builds a query string.\n\n Args:\n params: dict, the query parameters\n\n Returns:\n The query parameters properly encoded into an HTTP URI query string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L164_C4", "label": "if", "type": "if", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "vector": [4, 2, 0.4273, 0.0052, 2, 0.82, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.alt_param is not None:\n params.update({'alt': self.alt_param})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L165_C6", "label": "update()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L164_C4", "vector": [8, 3, 0.4286, 0.0026, 3, 0.39, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " params.update({'alt': self.alt_param})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L166_C4", "label": "astuples =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "vector": [14, 2, 0.4312, 0.0026, 2, 0.82, 0.5, 731, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "astuples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " astuples = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L167_C4", "label": "for key, value", "type": "for", "loc": [167, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "vector": [6, 2, 0.4442, 0.0234, 2, 0.82, 0.75, 839, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in params.iteritems():\n if type(value) == type([]):\n for x in value:\n x = x.encode('utf-8')\n astuples.append((key, x))\n else:\n if getattr(value, 'encode', False) and callable(value.encode):\n value = value.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "label": "if", "type": "if", "loc": [168, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L167_C4", "vector": [4, 3, 0.4455, 0.0208, 3, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n for x in value:\n x = x.encode('utf-8')\n astuples.append((key, x))\n else:\n if getattr(value, 'encode', False) and callable(value.encode):\n value = value.encode('utf-8')\n astuples.append((key, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L169_C8", "label": "for x", "type": "for", "loc": [169, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "vector": [6, 4, 0.4416, 0.0078, 4, 0.45, 0.0, 190, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in value:\n x = x.encode('utf-8')\n astuples.append((key, x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L170_C10", "label": "x = encode()", "type": "assigned_variable", "loc": [170, 170], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L169_C8", "vector": [14, 5, 0.4416, 0.0026, 5, 0.09, 0.0, 190, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " x = x.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L171_C10", "label": "append()", "type": "expression", "loc": [171, 171], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L169_C8", "vector": [8, 5, 0.4442, 0.0026, 5, 0.09, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " astuples.append((key, x))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L173_C8", "label": "if", "type": "if", "loc": [173, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "vector": [4, 4, 0.4506, 0.0052, 4, 0.45, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(value, 'encode', False) and callable(value.encode):\n value = value.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L174_C10", "label": "value = encode()", "type": "assigned_variable", "loc": [174, 174], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L173_C8", "vector": [14, 5, 0.4519, 0.0026, 5, 0.44, 0.0, 441, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " value = value.encode('utf-8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L175_C8", "label": "append()", "type": "expression", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "vector": [8, 4, 0.4545, 0.0026, 4, 0.45, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " astuples.append((key, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L176_C4", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "vector": [13, 2, 0.4571, 0.0026, 2, 0.82, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '?' + urllib.urlencode(astuples)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L178_C2", "label": "_log_response", "type": "function", "loc": [178, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.4727, 0.0234, 1, 0.06, 0.7273, 660, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "_log_response", "arg_names": ["self", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _log_response(self, resp, content):\n \"\"\"Logs debugging information about the response if requested.\"\"\"\n if FLAGS.dump_request_response:\n logging.info('--response-start--')\n for h, v in resp.iteritems():\n logging.info('%s: %s', h, v)\n if content:\n logging.info(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L179_C4", "label": "expression", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L178_C2", "vector": [8, 2, 0.4649, 0.0026, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Logs debugging information about the response if requested.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "label": "if", "type": "if", "loc": [180, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L178_C2", "vector": [4, 2, 0.4753, 0.0182, 2, 0.61, 1.0, 0, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if FLAGS.dump_request_response:\n logging.info('--response-start--')\n for h, v in resp.iteritems():\n logging.info('%s: %s', h, v)\n if content:\n logging.info(content)\n logging.info('--response-end--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L181_C6", "label": "info()", "type": "expression", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "vector": [8, 3, 0.4701, 0.0026, 3, 0.6, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--response-start--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L182_C6", "label": "for h, v", "type": "for", "loc": [182, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "vector": [6, 3, 0.474, 0.0052, 3, 0.6, 0.3333, 971, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "h, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for h, v in resp.iteritems():\n logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L183_C8", "label": "info()", "type": "expression", "loc": [183, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L182_C6", "vector": [8, 4, 0.4753, 0.0026, 4, 0.01, 0.0, 730, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('%s: %s', h, v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L184_C6", "label": "if", "type": "if", "loc": [184, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "vector": [4, 3, 0.4792, 0.0052, 3, 0.6, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if content:\n logging.info(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L185_C8", "label": "info()", "type": "expression", "loc": [185, 185], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L184_C6", "vector": [8, 4, 0.4805, 0.0026, 4, 0.47, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L186_C6", "label": "info()", "type": "expression", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "vector": [8, 3, 0.4831, 0.0026, 3, 0.6, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " logging.info('--response-end--')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "label": "response", "type": "function", "loc": [188, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.5195, 0.0649, 1, 0.06, 0.8182, 511, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "response", "arg_names": ["self", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def response(self, resp, content):\n \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L189_C4", "label": "expression", "type": "expression", "loc": [189, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "vector": [8, 2, 0.5052, 0.0312, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert the response wire format into a Python object.\n\n Args:\n resp: httplib2.Response, the HTTP response headers and status\n content: string, the body of the HTTP response\n\n Returns:\n The body de-serialized as a Python object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L201_C4", "label": "_log_response()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "vector": [8, 2, 0.5221, 0.0026, 2, 0.29, 0.5, 660, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_log_response", "arg_names": [], "import_names": [], "rhs_call_name": "_log_response", "annotation": ""}, "snippet": " self._log_response(resp, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "label": "if", "type": "if", "loc": [204, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "vector": [4, 2, 0.5403, 0.0234, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status < 300:\n if resp.status == 204:\n # A 204: No Content response should be treated differently\n # to all the other success states\n return self.no_content_response\n return self.deserialize(content)\n else:\n logging.debug('Content from bad request was: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L205_C6", "label": "if", "type": "if", "loc": [205, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "vector": [4, 3, 0.5364, 0.0104, 3, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp.status == 204:\n # A 204: No Content response should be treated differently\n # to all the other success states\n return self.no_content_response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L208_C8", "label": "return", "type": "return", "loc": [208, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L205_C6", "vector": [13, 4, 0.5403, 0.0026, 4, 0.01, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.no_content_response"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L209_C6", "label": "return", "type": "return", "loc": [209, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "vector": [13, 3, 0.5429, 0.0026, 3, 0.18, 0.5, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.deserialize(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L211_C6", "label": "debug()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "vector": [8, 3, 0.5481, 0.0026, 3, 0.18, 1.0, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " logging.debug('Content from bad request was: %s' % content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L214_C2", "label": "serialize", "type": "function", "loc": [214, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.5675, 0.026, 1, 0.06, 0.9091, 50, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, body_value):\n \"\"\"Perform the actual Python object serialization.\n\n Args:\n body_value: object, the request body as a Python object.\n\n Returns:\n string, the body in serialized form."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L215_C4", "label": "expression", "type": "expression", "loc": [215, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L214_C2", "vector": [8, 2, 0.5675, 0.0208, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Perform the actual Python object serialization.\n\n Args:\n body_value: object, the request body as a Python object.\n\n Returns:\n string, the body in serialized form.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L223_C4", "label": "_abstract()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L214_C2", "vector": [8, 2, 0.5792, 0.0026, 2, 0.62, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L225_C2", "label": "deserialize", "type": "function", "loc": [225, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "vector": [2, 1, 0.5974, 0.0286, 1, 0.06, 1.0, 223, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n \"\"\"Perform the actual deserialization from response string to Python\n object.\n\n Args:\n content: string, the body of the HTTP response\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L226_C4", "label": "expression", "type": "expression", "loc": [226, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L225_C2", "vector": [8, 2, 0.5974, 0.0234, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Perform the actual deserialization from response string to Python\n object.\n\n Args:\n content: string, the body of the HTTP response\n\n Returns:\n The body de-serialized as a Python object."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L235_C4", "label": "_abstract()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L225_C2", "vector": [8, 2, 0.6104, 0.0026, 2, 0.87, 1.0, 629, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_abstract", "arg_names": [], "import_names": [], "rhs_call_name": "_abstract", "annotation": ""}, "snippet": " _abstract()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "label": "JsonModel", "type": "class", "loc": [238, 270], "level": 0, "parent": null, "vector": [3, 0, 0.6597, 0.0857, 0, 0.66, 0.75, 705, 0, 4, 0, 0, 389, 0, 4], "semantic": {"name": "JsonModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JsonModel(BaseModel):\n \"\"\"Model class for JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request and response bodies.\n \"\"\"\n accept = 'application/json'\n content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L239_C2", "label": "expression", "type": "expression", "loc": [239, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [8, 1, 0.626, 0.013, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request and response bodies.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L244_C2", "label": "accept =", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [14, 1, 0.6338, 0.0026, 1, 0.93, 0.1429, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L245_C2", "label": "content_type =", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [14, 1, 0.6364, 0.0026, 1, 0.93, 0.2857, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L246_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [14, 1, 0.639, 0.0026, 1, 0.93, 0.4286, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = 'json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L248_C2", "label": "__init__", "type": "function", "loc": [248, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [2, 1, 0.6519, 0.0182, 1, 0.93, 0.5714, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "data_wrapper"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, data_wrapper=False):\n \"\"\"Construct a JsonModel.\n\n Args:\n data_wrapper: boolean, wrap requests and responses in a data wrapper\n \"\"\"\n self._data_wrapper = data_wrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L249_C4", "label": "expression", "type": "expression", "loc": [249, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L248_C2", "vector": [8, 2, 0.6519, 0.013, 2, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Construct a JsonModel.\n\n Args:\n data_wrapper: boolean, wrap requests and responses in a data wrapper\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L254_C4", "label": "self._data_wrapper =", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L248_C2", "vector": [14, 2, 0.6597, 0.0026, 2, 0.65, 1.0, 282, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._data_wrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_wrapper = data_wrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L256_C2", "label": "serialize", "type": "function", "loc": [256, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [2, 1, 0.6701, 0.013, 1, 0.93, 0.7143, 50, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "serialize", "arg_names": ["self", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, body_value):\n if (isinstance(body_value, dict) and 'data' not in body_value and\n self._data_wrapper):\n body_value = {'data': body_value}\n return simplejson.dumps(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L257_C4", "label": "if", "type": "if", "loc": [257, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L256_C2", "vector": [4, 2, 0.6701, 0.0078, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (isinstance(body_value, dict) and 'data' not in body_value and\n self._data_wrapper):\n body_value = {'data': body_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L259_C6", "label": "body_value =", "type": "assigned_variable", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L257_C4", "vector": [14, 3, 0.6727, 0.0026, 3, 0.93, 0.0, 70, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "body_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " body_value = {'data': body_value}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L260_C4", "label": "return", "type": "return", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L256_C2", "vector": [13, 2, 0.6753, 0.0026, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return simplejson.dumps(body_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "label": "deserialize", "type": "function", "loc": [262, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [2, 1, 0.6857, 0.013, 1, 0.93, 0.8571, 223, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n body = simplejson.loads(content)\n if isinstance(body, dict) and 'data' in body:\n body = body['data']\n return body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L263_C4", "label": "body = loads()", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "vector": [14, 2, 0.6831, 0.0026, 2, 0.6, 0.0, 477, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " body = simplejson.loads(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L264_C4", "label": "if", "type": "if", "loc": [264, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "vector": [4, 2, 0.687, 0.0052, 2, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(body, dict) and 'data' in body:\n body = body['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L265_C6", "label": "body =", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L264_C4", "vector": [14, 3, 0.6883, 0.0026, 3, 0.65, 0.0, 477, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "body", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " body = body['data']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L266_C4", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "vector": [13, 2, 0.6909, 0.0026, 2, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L269_C2", "label": "no_content_response", "type": "function", "loc": [269, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "vector": [2, 1, 0.7, 0.0052, 1, 0.93, 1.0, 329, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L270_C4", "label": "return", "type": "return", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L269_C2", "vector": [13, 2, 0.7013, 0.0026, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "label": "RawModel", "type": "class", "loc": [273, 289], "level": 0, "parent": null, "vector": [3, 0, 0.7299, 0.0442, 0, 0.66, 0.8125, 845, 0, 2, 0, 0, 705, 0, 0], "semantic": {"name": "RawModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RawModel(JsonModel):\n \"\"\"Model class for requests that don't return JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\"\n accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L274_C2", "label": "expression", "type": "expression", "loc": [274, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "vector": [8, 1, 0.7182, 0.0156, 1, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for requests that don't return JSON.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L280_C2", "label": "accept =", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "vector": [14, 1, 0.7273, 0.0026, 1, 0.41, 0.2, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L281_C2", "label": "content_type =", "type": "assigned_variable", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "vector": [14, 1, 0.7299, 0.0026, 1, 0.41, 0.4, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L282_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "vector": [14, 1, 0.7325, 0.0026, 1, 0.41, 0.6, 776, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L284_C2", "label": "deserialize", "type": "function", "loc": [284, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "vector": [2, 1, 0.739, 0.0052, 1, 0.41, 0.8, 223, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L285_C4", "label": "return", "type": "return", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L284_C2", "vector": [13, 2, 0.7403, 0.0026, 2, 0.0, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L288_C2", "label": "no_content_response", "type": "function", "loc": [288, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "vector": [2, 1, 0.7494, 0.0052, 1, 0.41, 1.0, 329, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L289_C4", "label": "return", "type": "return", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L288_C2", "vector": [13, 2, 0.7506, 0.0026, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "label": "MediaModel", "type": "class", "loc": [292, 308], "level": 0, "parent": null, "vector": [3, 0, 0.7792, 0.0442, 0, 0.66, 0.875, 632, 0, 2, 0, 0, 705, 0, 0], "semantic": {"name": "MediaModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaModel(JsonModel):\n \"\"\"Model class for requests that return Media.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\"\n accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L293_C2", "label": "expression", "type": "expression", "loc": [293, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "vector": [8, 1, 0.7675, 0.0156, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for requests that return Media.\n\n Serializes and de-serializes between JSON and the Python\n object representation of HTTP request, and returns the raw bytes\n of the response body.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L299_C2", "label": "accept =", "type": "assigned_variable", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "vector": [14, 1, 0.7766, 0.0026, 1, 0.68, 0.2, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = '*/*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L300_C2", "label": "content_type =", "type": "assigned_variable", "loc": [300, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "vector": [14, 1, 0.7792, 0.0026, 1, 0.68, 0.4, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/json'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L301_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [301, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "vector": [14, 1, 0.7818, 0.0026, 1, 0.68, 0.6, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = 'media'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L303_C2", "label": "deserialize", "type": "function", "loc": [303, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "vector": [2, 1, 0.7883, 0.0052, 1, 0.68, 0.8, 223, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L304_C4", "label": "return", "type": "return", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L303_C2", "vector": [13, 2, 0.7896, 0.0026, 2, 0.72, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L307_C2", "label": "no_content_response", "type": "function", "loc": [307, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "vector": [2, 1, 0.7987, 0.0052, 1, 0.68, 1.0, 329, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L308_C4", "label": "return", "type": "return", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L307_C2", "vector": [13, 2, 0.8, 0.0026, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "label": "ProtocolBufferModel", "type": "class", "loc": [311, 341], "level": 0, "parent": null, "vector": [3, 0, 0.8468, 0.0805, 0, 0.66, 0.9375, 730, 0, 4, 0, 0, 389, 0, 3], "semantic": {"name": "ProtocolBufferModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProtocolBufferModel(BaseModel):\n \"\"\"Model class for protocol buffers.\n\n Serializes and de-serializes the binary protocol buffer sent in the HTTP\n request and response bodies.\n \"\"\"\n accept = 'application/x-protobuf'\n content_type = 'application/x-protobuf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L312_C2", "label": "expression", "type": "expression", "loc": [312, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [8, 1, 0.8156, 0.013, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Model class for protocol buffers.\n\n Serializes and de-serializes the binary protocol buffer sent in the HTTP\n request and response bodies.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L317_C2", "label": "accept =", "type": "assigned_variable", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [14, 1, 0.8234, 0.0026, 1, 0.77, 0.1429, 829, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "accept", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " accept = 'application/x-protobuf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L318_C2", "label": "content_type =", "type": "assigned_variable", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [14, 1, 0.826, 0.0026, 1, 0.77, 0.2857, 610, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "content_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " content_type = 'application/x-protobuf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L319_C2", "label": "alt_param =", "type": "assigned_variable", "loc": [319, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [14, 1, 0.8286, 0.0026, 1, 0.77, 0.4286, 776, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "alt_param", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alt_param = 'proto'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L321_C2", "label": "__init__", "type": "function", "loc": [321, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [2, 1, 0.8468, 0.0286, 1, 0.77, 0.5714, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "protocol_buffer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, protocol_buffer):\n \"\"\"Constructs a ProtocolBufferModel.\n\n The serialzed protocol buffer returned in an HTTP response will be\n de-serialized using the given protocol buffer class.\n\n Args:\n protocol_buffer: The protocol buffer class used to de-serialize a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L322_C4", "label": "expression", "type": "expression", "loc": [322, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L321_C2", "vector": [8, 2, 0.8468, 0.0234, 2, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructs a ProtocolBufferModel.\n\n The serialzed protocol buffer returned in an HTTP response will be\n de-serialized using the given protocol buffer class.\n\n Args:\n protocol_buffer: The protocol buffer class used to de-serialize a\n response from the API."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L331_C4", "label": "self._protocol_buffer =", "type": "assigned_variable", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L321_C2", "vector": [14, 2, 0.8597, 0.0026, 2, 0.89, 1.0, 175, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._protocol_buffer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._protocol_buffer = protocol_buffer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L333_C2", "label": "serialize", "type": "function", "loc": [333, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [2, 1, 0.8662, 0.0052, 1, 0.77, 0.7143, 50, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "body_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, body_value):\n return body_value.SerializeToString()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L334_C4", "label": "return", "type": "return", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L333_C2", "vector": [13, 2, 0.8675, 0.0026, 2, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return body_value.SerializeToString()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L336_C2", "label": "deserialize", "type": "function", "loc": [336, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [2, 1, 0.874, 0.0052, 1, 0.77, 0.8571, 223, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "deserialize", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deserialize(self, content):\n return self._protocol_buffer.FromString(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L337_C4", "label": "return", "type": "return", "loc": [337, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L336_C2", "vector": [13, 2, 0.8753, 0.0026, 2, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._protocol_buffer.FromString(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L340_C2", "label": "no_content_response", "type": "function", "loc": [340, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "vector": [2, 1, 0.8844, 0.0052, 1, 0.77, 1.0, 329, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "no_content_response", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_content_response(self):\n return self._protocol_buffer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L341_C4", "label": "return", "type": "return", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L340_C2", "vector": [13, 2, 0.8857, 0.0026, 2, 0.28, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._protocol_buffer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "label": "makepatch", "type": "function", "loc": [344, 385], "level": 0, "parent": null, "vector": [2, 0, 0.9468, 0.1091, 0, 0.66, 1.0, 703, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "makepatch", "arg_names": ["original", "modified"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def makepatch(original, modified):\n \"\"\"Create a patch object.\n\n Some methods support PATCH, an efficient way to send updates to a resource.\n This method allows the easy construction of patch bodies by looking at the\n differences between a resource before and after it was modified.\n\n Args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L345_C2", "label": "expression", "type": "expression", "loc": [345, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "vector": [8, 1, 0.9208, 0.0519, 1, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Create a patch object.\n\n Some methods support PATCH, an efficient way to send updates to a resource.\n This method allows the easy construction of patch bodies by looking at the\n differences between a resource before and after it was modified.\n\n Args:\n original: object, the original deserialized resource"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L365_C2", "label": "patch =", "type": "assigned_variable", "loc": [365, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "vector": [14, 1, 0.9481, 0.0026, 1, 0.82, 0.25, 775, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "patch", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L366_C2", "label": "for key, original_value", "type": "for", "loc": [366, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "vector": [6, 1, 0.9688, 0.039, 1, 0.82, 0.5, 200, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "key, original_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, original_value in original.iteritems():\n modified_value = modified.get(key, None)\n if modified_value is None:\n # Use None to signal that the element is deleted\n patch[key] = None\n elif original_value != modified_value:\n if type(original_value) == type({}):\n # Recursively descend objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L367_C4", "label": "modified_value = get()", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L366_C2", "vector": [14, 2, 0.9532, 0.0026, 2, 0.03, 0.0, 243, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "modified_value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " modified_value = modified.get(key, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L368_C4", "label": "if", "type": "if", "loc": [368, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L366_C2", "vector": [4, 2, 0.9714, 0.0338, 2, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if modified_value is None:\n # Use None to signal that the element is deleted\n patch[key] = None\n elif original_value != modified_value:\n if type(original_value) == type({}):\n # Recursively descend objects\n patch[key] = makepatch(original_value, modified_value)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L370_C6", "label": "assign", "type": "assigned_variable", "loc": [370, 370], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L368_C4", "vector": [14, 3, 0.961, 0.0026, 3, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch[key] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L371_C4", "label": "if", "type": "if", "loc": [371, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L368_C4", "vector": [4, 3, 0.9753, 0.026, 3, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif original_value != modified_value:\n if type(original_value) == type({}):\n # Recursively descend objects\n patch[key] = makepatch(original_value, modified_value)\n else:\n # In the case of simple types or arrays we just replace\n patch[key] = modified_value\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L372_C6", "label": "if", "type": "if", "loc": [372, 377], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L371_C4", "vector": [4, 4, 0.9727, 0.0156, 4, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(original_value) == type({}):\n # Recursively descend objects\n patch[key] = makepatch(original_value, modified_value)\n else:\n # In the case of simple types or arrays we just replace\n patch[key] = modified_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L374_C8", "label": " = makepatch()", "type": "assigned_variable", "loc": [374, 374], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L372_C6", "vector": [14, 5, 0.9714, 0.0026, 5, 0.49, 0.0, 0, 3, 2, 0, 0, 703, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "makepatch", "annotation": ""}, "snippet": " patch[key] = makepatch(original_value, modified_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L377_C8", "label": "assign", "type": "assigned_variable", "loc": [377, 377], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L372_C6", "vector": [14, 5, 0.9792, 0.0026, 5, 0.49, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch[key] = modified_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L381_C2", "label": "for key", "type": "for", "loc": [381, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "vector": [6, 1, 0.9922, 0.0078, 1, 0.82, 0.75, 230, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in modified:\n if key not in original:\n patch[key] = modified[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L382_C4", "label": "if", "type": "if", "loc": [382, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L381_C2", "vector": [4, 2, 0.9935, 0.0052, 2, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key not in original:\n patch[key] = modified[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L383_C6", "label": "assign", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L382_C4", "vector": [14, 3, 0.9948, 0.0026, 3, 0.88, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " patch[key] = modified[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L385_C2", "label": "return", "type": "return", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "vector": [13, 1, 1.0, 0.0026, 1, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return patch"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L110_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L112_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L114_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L115_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L116_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L116_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L118_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L119_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L120_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L121_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L146_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L150_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L151_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L170_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L171_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L174_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L168_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L155_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L178_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L178_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L181_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L182_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L182_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L184_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L184_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L186_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L188_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L205_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L209_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L211_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L225_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L225_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L225_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L244_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L245_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L246_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L248_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L248_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L248_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L256_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L256_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L259_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L256_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L265_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L262_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L274_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L280_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L281_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L282_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L284_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L273_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L288_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L288_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L293_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L299_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L300_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L301_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L303_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L303_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L307_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L307_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L312_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L317_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L319_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L321_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L321_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L321_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L333_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L333_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L336_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L336_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L340_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L340_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Expr_L345_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L365_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L366_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L366_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L366_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L370_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L372_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L372_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L372_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L381_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:For_L381_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:If_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Assign_L383_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99179:FunctionDef_L344_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99179:Return_L385_C2"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for OAuth.
Utilities for making it easier to work with OAuth 1.0 credentials.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import pickle
import threading
from apiclient.oauth import Storage as BaseStorage
class Storage(BaseStorage):
"""Store and retrieve a single credential to and from a file."""
def __init__(self, filename):
self._filename = filename
self._lock = threading.Lock()
def get(self):
"""Retrieve Credential from file.
Returns:
apiclient.oauth.Credentials
"""
self._lock.acquire()
try:
f = open(self._filename, 'r')
credentials = pickle.loads(f.read())
f.close()
credentials.set_store(self.put)
except:
credentials = None
self._lock.release()
return credentials
def put(self, credentials):
"""Write a pickled Credentials to file.
Args:
credentials: Credentials, the credentials to store.
"""
self._lock.acquire()
f = open(self._filename, 'w')
f.write(pickle.dumps(credentials))
f.close()
self._lock.release()
| ajibawa-2023/Python-Code-Large/train/row_99181 | 28 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 18], "level": 0, "parent": null, "vector": [8, 0, 0.2619, 0.0635, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for OAuth.\n\nUtilities for making it easier to work with OAuth 1.0 credentials.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.3175, 0.0159, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Import_L22_C0", "label": "pickle import pickle", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.3492, 0.0159, 0, 0.66, 0.4, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Import_L23_C0", "label": "threading import threading", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.3651, 0.0159, 0, 0.66, 0.6, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:ImportFrom_L25_C0", "label": "from apiclient.oauth import BaseStorage", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.3968, 0.0159, 0, 0.66, 0.8, 791, 0, 1, 0, 0, 791, 0, 0], "semantic": {"name": "apiclient.oauth", "arg_names": [], "import_names": ["BaseStorage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.oauth import Storage as BaseStorage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "label": "Storage", "type": "class", "loc": [28, 63], "level": 0, "parent": null, "vector": [3, 0, 0.7222, 0.5714, 0, 0.66, 1.0, 850, 0, 3, 0, 0, 775, 0, 14], "semantic": {"name": "Storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Storage(BaseStorage):\n \"\"\"Store and retrieve a single credential to and from a file.\"\"\"\n\n def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()\n\n def get(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L29_C2", "label": "expression", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "vector": [8, 1, 0.4603, 0.0159, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from a file.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L31_C2", "label": "__init__", "type": "function", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "vector": [2, 1, 0.5079, 0.0476, 1, 0.92, 0.3333, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, filename):\n self._filename = filename\n self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L32_C4", "label": "self._filename =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L31_C2", "vector": [14, 2, 0.5079, 0.0159, 2, 0.48, 0.0, 146, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._filename = filename"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L33_C4", "label": "self._lock = Lock()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L31_C2", "vector": [14, 2, 0.5238, 0.0159, 2, 0.48, 1.0, 143, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self._lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self._lock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "label": "get", "type": "function", "loc": [35, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "vector": [2, 1, 0.6825, 0.2698, 1, 0.92, 0.6667, 607, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve Credential from file.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\"\n self._lock.acquire()\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L36_C4", "label": "expression", "type": "expression", "loc": [36, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "vector": [8, 2, 0.6032, 0.0794, 2, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from file.\n\n Returns:\n apiclient.oauth.Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L41_C4", "label": "acquire()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "vector": [8, 2, 0.6508, 0.0159, 2, 0.91, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "label": "try", "type": "try", "loc": [42, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "vector": [7, 2, 0.7143, 0.1111, 2, 0.91, 0.5, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n f = open(self._filename, 'r')\n credentials = pickle.loads(f.read())\n f.close()\n credentials.set_store(self.put)\n except:\n credentials = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L43_C6", "label": "f = open()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "vector": [14, 3, 0.6825, 0.0159, 3, 0.92, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L44_C6", "label": "credentials = loads()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "vector": [14, 3, 0.6984, 0.0159, 3, 0.92, 0.3333, 198, 3, 1, 0, 0, 88, 10, 2], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " credentials = pickle.loads(f.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L45_C6", "label": "close()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "vector": [8, 3, 0.7143, 0.0159, 3, 0.92, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L46_C6", "label": "set_store()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "vector": [8, 3, 0.7302, 0.0159, 3, 0.92, 1.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credentials.set_store(self.put)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L48_C6", "label": "credentials =", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "vector": [14, 3, 0.7619, 0.0159, 3, 0.92, 0.0, 198, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "credentials", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credentials = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L49_C4", "label": "release()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "vector": [8, 2, 0.7778, 0.0159, 2, 0.91, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Return_L51_C4", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "vector": [13, 2, 0.8095, 0.0159, 2, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "label": "put", "type": "function", "loc": [53, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "vector": [2, 1, 0.9206, 0.1746, 1, 0.92, 1.0, 636, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a pickled Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n self._lock.acquire()\n f = open(self._filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L54_C4", "label": "expression", "type": "expression", "loc": [54, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "vector": [8, 2, 0.8889, 0.0794, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a pickled Credentials to file.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L59_C4", "label": "acquire()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "vector": [8, 2, 0.9365, 0.0159, 2, 0.35, 0.2, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self._lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L60_C4", "label": "f = open()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "vector": [14, 2, 0.9524, 0.0159, 2, 0.35, 0.4, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " f = open(self._filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L61_C4", "label": "write()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "vector": [8, 2, 0.9683, 0.0159, 2, 0.35, 0.6, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write(pickle.dumps(credentials))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L62_C4", "label": "close()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "vector": [8, 2, 0.9841, 0.0159, 2, 0.35, 0.8, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " f.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L63_C4", "label": "release()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "vector": [8, 2, 1.0, 0.0159, 2, 0.35, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self._lock.release()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L31_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L31_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L43_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L44_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L46_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L48_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L35_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Return_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99181:FunctionDef_L53_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99181:Expr_L63_C4"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import apiclient
import base64
import pickle
from django.db import models
class OAuthCredentialsField(models.Field):
__metaclass__ = models.SubfieldBase
def db_type(self):
return 'VARCHAR'
def to_python(self, value):
if value is None:
return None
if isinstance(value, apiclient.oauth.Credentials):
return value
return pickle.loads(base64.b64decode(value))
def get_db_prep_value(self, value):
return base64.b64encode(pickle.dumps(value))
class FlowThreeLeggedField(models.Field):
__metaclass__ = models.SubfieldBase
def db_type(self):
return 'VARCHAR'
def to_python(self, value):
print "In to_python", value
if value is None:
return None
if isinstance(value, apiclient.oauth.FlowThreeLegged):
return value
return pickle.loads(base64.b64decode(value))
def get_db_prep_value(self, value):
return base64.b64encode(pickle.dumps(value))
| ajibawa-2023/Python-Code-Large/train/row_99182 | 29 | 56 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Import_L15_C0", "label": "apiclient import apiclient", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2679, 0.0179, 0, 0.66, 0.0, 629, 0, 1, 0, 0, 629, 0, 0], "semantic": {"name": "apiclient", "arg_names": [], "import_names": ["apiclient"], "rhs_call_name": "", "annotation": ""}, "snippet": "import apiclient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Import_L16_C0", "label": "base64 import base64", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.0179, 0, 0.66, 0.2, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Import_L17_C0", "label": "pickle import pickle", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3036, 0.0179, 0, 0.66, 0.4, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:ImportFrom_L19_C0", "label": "from django.db import models", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3393, 0.0179, 0, 0.66, 0.6, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["models"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "label": "OAuthCredentialsField", "type": "class", "loc": [22, 37], "level": 0, "parent": null, "vector": [3, 0, 0.5268, 0.2857, 0, 0.66, 0.8, 325, 0, 3, 0, 0, 922, 0, 5], "semantic": {"name": "OAuthCredentialsField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuthCredentialsField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Assign_L24_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "vector": [14, 1, 0.4286, 0.0179, 1, 0.98, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L26_C2", "label": "db_type", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "vector": [2, 1, 0.4732, 0.0357, 1, 0.98, 0.3333, 976, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "db_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_type(self):\n return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L26_C2", "vector": [13, 2, 0.4821, 0.0179, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "label": "to_python", "type": "function", "loc": [29, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "vector": [2, 1, 0.5625, 0.1071, 1, 0.98, 0.6667, 800, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n if value is None:\n return None\n if isinstance(value, apiclient.oauth.Credentials):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L30_C4", "label": "if", "type": "if", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "vector": [4, 2, 0.5446, 0.0357, 2, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L31_C6", "label": "return", "type": "return", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L30_C4", "vector": [13, 3, 0.5536, 0.0179, 3, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L32_C4", "label": "if", "type": "if", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "vector": [4, 2, 0.5804, 0.0357, 2, 0.16, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, apiclient.oauth.Credentials):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L33_C6", "label": "return", "type": "return", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L32_C4", "vector": [13, 3, 0.5893, 0.0179, 3, 0.02, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "vector": [13, 2, 0.6071, 0.0179, 2, 0.16, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L36_C2", "label": "get_db_prep_value", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "vector": [2, 1, 0.6518, 0.0357, 1, 0.98, 1.0, 728, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value):\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L37_C4", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L36_C2", "vector": [13, 2, 0.6607, 0.0179, 2, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "label": "FlowThreeLeggedField", "type": "class", "loc": [40, 56], "level": 0, "parent": null, "vector": [3, 0, 0.8571, 0.3036, 0, 0.66, 1.0, 390, 0, 3, 0, 0, 922, 0, 6], "semantic": {"name": "FlowThreeLeggedField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowThreeLeggedField(models.Field):\n\n __metaclass__ = models.SubfieldBase\n\n def db_type(self):\n return 'VARCHAR'\n\n def to_python(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Assign_L42_C2", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "vector": [14, 1, 0.75, 0.0179, 1, 0.69, 0.0, 203, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = models.SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L44_C2", "label": "db_type", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "vector": [2, 1, 0.7946, 0.0357, 1, 0.69, 0.3333, 976, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "db_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_type(self):\n return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L44_C2", "vector": [13, 2, 0.8036, 0.0179, 2, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'VARCHAR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "label": "to_python", "type": "function", "loc": [47, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "vector": [2, 1, 0.8929, 0.125, 1, 0.69, 0.6667, 800, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "to_python", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_python(self, value):\n print(\"In to_python\", value)\n if value is None:\n return None\n if isinstance(value, apiclient.oauth.FlowThreeLegged):\n return value\n return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Expr_L48_C4", "label": "print()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "vector": [8, 2, 0.8571, 0.0179, 2, 0.36, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"In to_python\", value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "vector": [4, 2, 0.8839, 0.0357, 2, 0.36, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L50_C6", "label": "return", "type": "return", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L49_C4", "vector": [13, 3, 0.8929, 0.0179, 3, 0.76, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L51_C4", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "vector": [4, 2, 0.9196, 0.0357, 2, 0.36, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, apiclient.oauth.FlowThreeLegged):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L52_C6", "label": "return", "type": "return", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L51_C4", "vector": [13, 3, 0.9286, 0.0179, 3, 0.96, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "vector": [13, 2, 0.9464, 0.0179, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(base64.b64decode(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L55_C2", "label": "get_db_prep_value", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "vector": [2, 1, 0.9911, 0.0357, 1, 0.69, 1.0, 728, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_db_prep_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_value(self, value):\n return base64.b64encode(pickle.dumps(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L55_C2", "vector": [13, 2, 1.0, 0.0179, 2, 0.65, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(pickle.dumps(value))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L26_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L31_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L33_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L36_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L50_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L52_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99182:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99182:Return_L56_C4"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utilities for Google App Engine
Utilities for making it easier to use the
Google API Client for Python on Google App Engine.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import pickle
from google.appengine.ext import db
from apiclient.oauth import OAuthCredentials
from apiclient.oauth import FlowThreeLegged
class FlowThreeLeggedProperty(db.Property):
"""Utility property that allows easy
storage and retreival of an
apiclient.oauth.FlowThreeLegged"""
# Tell what the user type is.
data_type = FlowThreeLegged
# For writing to datastore.
def get_value_for_datastore(self, model_instance):
flow = super(FlowThreeLeggedProperty,
self).get_value_for_datastore(model_instance)
return db.Blob(pickle.dumps(flow))
# For reading from datastore.
def make_value_from_datastore(self, value):
if value is None:
return None
return pickle.loads(value)
def validate(self, value):
if value is not None and not isinstance(value, FlowThreeLegged):
raise BadValueError('Property %s must be convertible '
'to a FlowThreeLegged instance (%s)' %
(self.name, value))
return super(FlowThreeLeggedProperty, self).validate(value)
def empty(self, value):
return not value
class OAuthCredentialsProperty(db.Property):
"""Utility property that allows easy
storage and retrieval of
apiclient.oath.OAuthCredentials
"""
# Tell what the user type is.
data_type = OAuthCredentials
# For writing to datastore.
def get_value_for_datastore(self, model_instance):
cred = super(OAuthCredentialsProperty,
self).get_value_for_datastore(model_instance)
return db.Blob(pickle.dumps(cred))
# For reading from datastore.
def make_value_from_datastore(self, value):
if value is None:
return None
return pickle.loads(value)
def validate(self, value):
if value is not None and not isinstance(value, OAuthCredentials):
raise BadValueError('Property %s must be convertible '
'to an OAuthCredentials instance (%s)' %
(self.name, value))
return super(OAuthCredentialsProperty, self).validate(value)
def empty(self, value):
return not value
class StorageByKeyName(object):
"""Store and retrieve a single credential to and from
the App Engine datastore.
This Storage helper presumes the Credentials
have been stored as a CredenialsProperty
on a datastore model class, and that entities
are stored by key_name.
"""
def __init__(self, model, key_name, property_name):
"""Constructor for Storage.
Args:
model: db.Model, model class
key_name: string, key name for the entity that has the credentials
property_name: string, name of the property that is a CredentialsProperty
"""
self.model = model
self.key_name = key_name
self.property_name = property_name
def get(self):
"""Retrieve Credential from datastore.
Returns:
Credentials
"""
entity = self.model.get_or_insert(self.key_name)
credential = getattr(entity, self.property_name)
if credential and hasattr(credential, 'set_store'):
credential.set_store(self.put)
return credential
def put(self, credentials):
"""Write a Credentials to the datastore.
Args:
credentials: Credentials, the credentials to store.
"""
entity = self.model.get_or_insert(self.key_name)
setattr(entity, self.property_name, credentials)
entity.put()
| ajibawa-2023/Python-Code-Large/train/row_99183 | 55 | 135 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.1259, 0.037, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utilities for Google App Engine\n\nUtilities for making it easier to use the\nGoogle API Client for Python on Google App Engine.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1556, 0.0074, 0, 0.66, 0.125, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Import_L23_C0", "label": "pickle import pickle", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1704, 0.0074, 0, 0.66, 0.25, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:ImportFrom_L25_C0", "label": "from google.appengine.ext import db", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.1852, 0.0074, 0, 0.66, 0.375, 167, 0, 1, 0, 0, 167, 0, 0], "semantic": {"name": "google.appengine.ext", "arg_names": [], "import_names": ["db"], "rhs_call_name": "", "annotation": ""}, "snippet": "from google.appengine.ext import db"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:ImportFrom_L26_C0", "label": "from apiclient.oauth import OAuthCredentials", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.1926, 0.0074, 0, 0.66, 0.5, 791, 0, 1, 0, 0, 791, 0, 0], "semantic": {"name": "apiclient.oauth", "arg_names": [], "import_names": ["OAuthCredentials"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.oauth import OAuthCredentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:ImportFrom_L27_C0", "label": "from apiclient.oauth import FlowThreeLegged", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0074, 0, 0.66, 0.625, 791, 0, 1, 0, 0, 791, 0, 0], "semantic": {"name": "apiclient.oauth", "arg_names": [], "import_names": ["FlowThreeLegged"], "rhs_call_name": "", "annotation": ""}, "snippet": "from apiclient.oauth import FlowThreeLegged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "label": "FlowThreeLeggedProperty", "type": "class", "loc": [30, 58], "level": 0, "parent": null, "vector": [3, 0, 0.3259, 0.2148, 0, 0.66, 0.75, 427, 0, 4, 0, 0, 394, 0, 9], "semantic": {"name": "FlowThreeLeggedProperty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FlowThreeLeggedProperty(db.Property):\n \"\"\"Utility property that allows easy\n storage and retreival of an\n apiclient.oauth.FlowThreeLegged\"\"\"\n\n # Tell what the user type is.\n data_type = FlowThreeLegged\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L31_C2", "label": "expression", "type": "expression", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "vector": [8, 1, 0.237, 0.0222, 1, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility property that allows easy\n storage and retreival of an\n apiclient.oauth.FlowThreeLegged\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L36_C2", "label": "data_type =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "vector": [14, 1, 0.2667, 0.0074, 1, 0.74, 0.2, 5, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_type = FlowThreeLegged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L39_C2", "label": "get_value_for_datastore", "type": "function", "loc": [39, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "vector": [2, 1, 0.3, 0.0296, 1, 0.74, 0.4, 18, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_value_for_datastore", "arg_names": ["self", "model_instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_value_for_datastore(self, model_instance):\n flow = super(FlowThreeLeggedProperty,\n self).get_value_for_datastore(model_instance)\n return db.Blob(pickle.dumps(flow))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L40_C4", "label": "flow = get_value_for_datastore()", "type": "assigned_variable", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L39_C2", "vector": [14, 2, 0.3, 0.0148, 2, 0.22, 0.0, 258, 3, 1, 0, 0, 18, 10, 2], "semantic": {"name": "flow", "arg_names": [], "import_names": [], "rhs_call_name": "get_value_for_datastore", "annotation": ""}, "snippet": " flow = super(FlowThreeLeggedProperty,\n self).get_value_for_datastore(model_instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L39_C2", "vector": [13, 2, 0.3111, 0.0074, 2, 0.22, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return db.Blob(pickle.dumps(flow))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L45_C2", "label": "make_value_from_datastore", "type": "function", "loc": [45, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "vector": [2, 1, 0.3444, 0.0296, 1, 0.74, 0.6, 331, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "make_value_from_datastore", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_value_from_datastore(self, value):\n if value is None:\n return None\n return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L46_C4", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L45_C2", "vector": [4, 2, 0.3444, 0.0148, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L47_C6", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L46_C4", "vector": [13, 3, 0.3481, 0.0074, 3, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L48_C4", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L45_C2", "vector": [13, 2, 0.3556, 0.0074, 2, 0.18, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L50_C2", "label": "validate", "type": "function", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "vector": [2, 1, 0.3889, 0.0444, 1, 0.74, 0.8, 628, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "validate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self, value):\n if value is not None and not isinstance(value, FlowThreeLegged):\n raise BadValueError('Property %s must be convertible '\n 'to a FlowThreeLegged instance (%s)' %\n (self.name, value))\n return super(FlowThreeLeggedProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L51_C4", "label": "if", "type": "if", "loc": [51, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L50_C2", "vector": [4, 2, 0.3889, 0.0296, 2, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is not None and not isinstance(value, FlowThreeLegged):\n raise BadValueError('Property %s must be convertible '\n 'to a FlowThreeLegged instance (%s)' %\n (self.name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L50_C2", "vector": [13, 2, 0.4074, 0.0074, 2, 0.27, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(FlowThreeLeggedProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L57_C2", "label": "empty", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "vector": [2, 1, 0.4259, 0.0148, 1, 0.74, 1.0, 365, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "empty", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty(self, value):\n return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L57_C2", "vector": [13, 2, 0.4296, 0.0074, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "label": "OAuthCredentialsProperty", "type": "class", "loc": [61, 90], "level": 0, "parent": null, "vector": [3, 0, 0.5593, 0.2222, 0, 0.66, 0.875, 211, 0, 4, 0, 0, 394, 0, 9], "semantic": {"name": "OAuthCredentialsProperty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OAuthCredentialsProperty(db.Property):\n \"\"\"Utility property that allows easy\n storage and retrieval of\n apiclient.oath.OAuthCredentials\n \"\"\"\n\n # Tell what the user type is.\n data_type = OAuthCredentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L62_C2", "label": "expression", "type": "expression", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "vector": [8, 1, 0.4704, 0.0296, 1, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Utility property that allows easy\n storage and retrieval of\n apiclient.oath.OAuthCredentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L68_C2", "label": "data_type =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "vector": [14, 1, 0.5037, 0.0074, 1, 0.1, 0.2, 5, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_type = OAuthCredentials"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L71_C2", "label": "get_value_for_datastore", "type": "function", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "vector": [2, 1, 0.537, 0.0296, 1, 0.1, 0.4, 18, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_value_for_datastore", "arg_names": ["self", "model_instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_value_for_datastore(self, model_instance):\n cred = super(OAuthCredentialsProperty,\n self).get_value_for_datastore(model_instance)\n return db.Blob(pickle.dumps(cred))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L72_C4", "label": "cred = get_value_for_datastore()", "type": "assigned_variable", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L71_C2", "vector": [14, 2, 0.537, 0.0148, 2, 0.55, 0.0, 458, 3, 1, 0, 0, 18, 10, 2], "semantic": {"name": "cred", "arg_names": [], "import_names": [], "rhs_call_name": "get_value_for_datastore", "annotation": ""}, "snippet": " cred = super(OAuthCredentialsProperty,\n self).get_value_for_datastore(model_instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L74_C4", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L71_C2", "vector": [13, 2, 0.5481, 0.0074, 2, 0.55, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return db.Blob(pickle.dumps(cred))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L77_C2", "label": "make_value_from_datastore", "type": "function", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "vector": [2, 1, 0.5815, 0.0296, 1, 0.1, 0.6, 331, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "make_value_from_datastore", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_value_from_datastore(self, value):\n if value is None:\n return None\n return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L78_C4", "label": "if", "type": "if", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L77_C2", "vector": [4, 2, 0.5815, 0.0148, 2, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L79_C6", "label": "return", "type": "return", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L78_C4", "vector": [13, 3, 0.5852, 0.0074, 3, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L77_C2", "vector": [13, 2, 0.5926, 0.0074, 2, 0.15, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pickle.loads(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L82_C2", "label": "validate", "type": "function", "loc": [82, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "vector": [2, 1, 0.6259, 0.0444, 1, 0.1, 0.8, 628, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "validate", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self, value):\n if value is not None and not isinstance(value, OAuthCredentials):\n raise BadValueError('Property %s must be convertible '\n 'to an OAuthCredentials instance (%s)' %\n (self.name, value))\n return super(OAuthCredentialsProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L83_C4", "label": "if", "type": "if", "loc": [83, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L82_C2", "vector": [4, 2, 0.6259, 0.0296, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is not None and not isinstance(value, OAuthCredentials):\n raise BadValueError('Property %s must be convertible '\n 'to an OAuthCredentials instance (%s)' %\n (self.name, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L87_C4", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L82_C2", "vector": [13, 2, 0.6444, 0.0074, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(OAuthCredentialsProperty, self).validate(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L89_C2", "label": "empty", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "vector": [2, 1, 0.663, 0.0148, 1, 0.1, 1.0, 365, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "empty", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty(self, value):\n return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L90_C4", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L89_C2", "vector": [13, 2, 0.6667, 0.0074, 2, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "label": "StorageByKeyName", "type": "class", "loc": [93, 135], "level": 0, "parent": null, "vector": [3, 0, 0.8444, 0.3185, 0, 0.66, 1.0, 621, 0, 3, 0, 0, 186, 0, 7], "semantic": {"name": "StorageByKeyName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StorageByKeyName(object):\n \"\"\"Store and retrieve a single credential to and from\n the App Engine datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsProperty\n on a datastore model class, and that entities\n are stored by key_name."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L94_C2", "label": "expression", "type": "expression", "loc": [94, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "vector": [8, 1, 0.7222, 0.0593, 1, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Store and retrieve a single credential to and from\n the App Engine datastore.\n\n This Storage helper presumes the Credentials\n have been stored as a CredenialsProperty\n on a datastore model class, and that entities\n are stored by key_name.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "label": "__init__", "type": "function", "loc": [103, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "vector": [2, 1, 0.8, 0.0815, 1, 0.82, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "model", "key_name", "property_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, model, key_name, property_name):\n \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n property_name: string, name of the property that is a CredentialsProperty\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L104_C4", "label": "expression", "type": "expression", "loc": [104, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "vector": [8, 2, 0.7926, 0.0519, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for Storage.\n\n Args:\n model: db.Model, model class\n key_name: string, key name for the entity that has the credentials\n property_name: string, name of the property that is a CredentialsProperty\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L111_C4", "label": "self.model =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "vector": [14, 2, 0.8222, 0.0074, 2, 0.72, 0.3333, 81, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L112_C4", "label": "self.key_name =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "vector": [14, 2, 0.8296, 0.0074, 2, 0.72, 0.6667, 40, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.key_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.key_name = key_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L113_C4", "label": "self.property_name =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "vector": [14, 2, 0.837, 0.0074, 2, 0.72, 1.0, 742, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.property_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.property_name = property_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "label": "get", "type": "function", "loc": [115, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "vector": [2, 1, 0.8889, 0.0815, 1, 0.82, 0.6667, 607, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self):\n \"\"\"Retrieve Credential from datastore.\n\n Returns:\n Credentials\n \"\"\"\n entity = self.model.get_or_insert(self.key_name)\n credential = getattr(entity, self.property_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L116_C4", "label": "expression", "type": "expression", "loc": [116, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "vector": [8, 2, 0.8741, 0.037, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Retrieve Credential from datastore.\n\n Returns:\n Credentials\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L121_C4", "label": "entity = get_or_insert()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "vector": [14, 2, 0.8963, 0.0074, 2, 0.46, 0.25, 214, 3, 1, 0, 0, 323, 10, 1], "semantic": {"name": "entity", "arg_names": [], "import_names": [], "rhs_call_name": "get_or_insert", "annotation": ""}, "snippet": " entity = self.model.get_or_insert(self.key_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L122_C4", "label": "credential = getattr()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "vector": [14, 2, 0.9037, 0.0074, 2, 0.46, 0.5, 443, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "credential", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " credential = getattr(entity, self.property_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L123_C4", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "vector": [4, 2, 0.9148, 0.0148, 2, 0.46, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if credential and hasattr(credential, 'set_store'):\n credential.set_store(self.put)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L124_C6", "label": "set_store()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L123_C4", "vector": [8, 3, 0.9185, 0.0074, 3, 0.15, 0.0, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_store", "arg_names": [], "import_names": [], "rhs_call_name": "set_store", "annotation": ""}, "snippet": " credential.set_store(self.put)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L125_C4", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "vector": [13, 2, 0.9259, 0.0074, 2, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return credential"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "label": "put", "type": "function", "loc": [127, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "vector": [2, 1, 0.9704, 0.0667, 1, 0.82, 1.0, 636, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "put", "arg_names": ["self", "credentials"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def put(self, credentials):\n \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\"\n entity = self.model.get_or_insert(self.key_name)\n setattr(entity, self.property_name, credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L128_C4", "label": "expression", "type": "expression", "loc": [128, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "vector": [8, 2, 0.963, 0.037, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write a Credentials to the datastore.\n\n Args:\n credentials: Credentials, the credentials to store.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L133_C4", "label": "entity = get_or_insert()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "vector": [14, 2, 0.9852, 0.0074, 2, 0.38, 0.3333, 214, 3, 1, 0, 0, 323, 10, 1], "semantic": {"name": "entity", "arg_names": [], "import_names": [], "rhs_call_name": "get_or_insert", "annotation": ""}, "snippet": " entity = self.model.get_or_insert(self.key_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L134_C4", "label": "setattr()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "vector": [8, 2, 0.9926, 0.0074, 2, 0.38, 0.6667, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(entity, self.property_name, credentials)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L135_C4", "label": "put()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "vector": [8, 2, 1.0, 0.0074, 2, 0.38, 1.0, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " entity.put()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L47_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L77_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L79_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L77_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L89_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L103_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:If_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L124_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Return_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:ClassDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99183:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99183:Expr_L135_C4"}] |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Errors for the library.
All exceptions defined by the library
should be defined in this file.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
from oauth2client.anyjson import simplejson
class Error(Exception):
"""Base error for this module."""
pass
class HttpError(Error):
"""HTTP data was invalid or unexpected."""
def __init__(self, resp, content, uri=None):
self.resp = resp
self.content = content
self.uri = uri
def _get_reason(self):
"""Calculate the reason for the error from the response content."""
if self.resp.get('content-type', '').startswith('application/json'):
try:
data = simplejson.loads(self.content)
reason = data['error']['message']
except (ValueError, KeyError):
reason = self.content
else:
reason = self.resp.reason
return reason
def __repr__(self):
if self.uri:
return '<HttpError %s when requesting %s returned "%s">' % (
self.resp.status, self.uri, self._get_reason())
else:
return '<HttpError %s "%s">' % (self.resp.status, self._get_reason())
__str__ = __repr__
class InvalidJsonError(Error):
"""The JSON returned could not be parsed."""
pass
class UnknownLinkType(Error):
"""Link type unknown or unexpected."""
pass
class UnknownApiNameOrVersion(Error):
"""No API with that name and version exists."""
pass
class UnacceptableMimeTypeError(Error):
"""That is an unacceptable mimetype for this operation."""
pass
class MediaUploadSizeError(Error):
"""Media is larger than the method can accept."""
pass
class ResumableUploadError(Error):
"""Error occured during resumable upload."""
pass
class BatchError(HttpError):
"""Error occured during batch operations."""
def __init__(self, reason, resp=None, content=None):
self.resp = resp
self.content = content
self.reason = reason
def __repr__(self):
return '<BatchError %s "%s">' % (self.resp.status, self.reason)
__str__ = __repr__
class UnexpectedMethodError(Error):
"""Exception raised by RequestMockBuilder on unexpected calls."""
def __init__(self, methodId=None):
"""Constructor for an UnexpectedMethodError."""
super(UnexpectedMethodError, self).__init__(
'Received unexpected call %s' % methodId)
class UnexpectedBodyError(Error):
"""Exception raised by RequestMockBuilder on unexpected bodies."""
def __init__(self, expected, provided):
"""Constructor for an UnexpectedMethodError."""
super(UnexpectedBodyError, self).__init__(
'Expected: [%s] - Provided: [%s]' % (expected, provided))
| ajibawa-2023/Python-Code-Large/train/row_99185 | 56 | 123 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 21], "level": 0, "parent": null, "vector": [8, 0, 0.1545, 0.0407, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Errors for the library.\n\nAll exceptions defined by the library\nshould be defined in this file.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L23_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.187, 0.0081, 0, 0.66, 0.0769, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ImportFrom_L26_C0", "label": "from oauth2client.anyjson import simplejson", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.2114, 0.0081, 0, 0.66, 0.1538, 822, 0, 1, 0, 0, 822, 0, 0], "semantic": {"name": "oauth2client.anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L29_C0", "label": "Error", "type": "class", "loc": [29, 31], "level": 0, "parent": null, "vector": [3, 0, 0.2439, 0.0244, 0, 0.66, 0.2308, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Base error for this module.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L30_C2", "label": "expression", "type": "expression", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L29_C0", "vector": [8, 1, 0.2439, 0.0081, 1, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base error for this module.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "label": "HttpError", "type": "class", "loc": [34, 61], "level": 0, "parent": null, "vector": [3, 0, 0.3862, 0.2276, 0, 0.66, 0.3077, 466, 0, 3, 0, 0, 529, 0, 5], "semantic": {"name": "HttpError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HttpError(Error):\n \"\"\"HTTP data was invalid or unexpected.\"\"\"\n\n def __init__(self, resp, content, uri=None):\n self.resp = resp\n self.content = content\n self.uri = uri\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L35_C2", "label": "expression", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "vector": [8, 1, 0.2846, 0.0081, 1, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"HTTP data was invalid or unexpected.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "label": "__init__", "type": "function", "loc": [37, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "vector": [2, 1, 0.313, 0.0325, 1, 0.38, 0.25, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "resp", "content", "uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, resp, content, uri=None):\n self.resp = resp\n self.content = content\n self.uri = uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L38_C4", "label": "self.resp =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "vector": [14, 2, 0.3089, 0.0081, 2, 0.45, 0.0, 454, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resp = resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L39_C4", "label": "self.content =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "vector": [14, 2, 0.3171, 0.0081, 2, 0.45, 0.5, 943, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.content = content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L40_C4", "label": "self.uri =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "vector": [14, 2, 0.3252, 0.0081, 2, 0.45, 1.0, 399, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.uri = uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "label": "_get_reason", "type": "function", "loc": [42, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "vector": [2, 1, 0.3821, 0.0894, 1, 0.38, 0.5, 385, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_reason", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_reason(self):\n \"\"\"Calculate the reason for the error from the response content.\"\"\"\n if self.resp.get('content-type', '').startswith('application/json'):\n try:\n data = simplejson.loads(self.content)\n reason = data['error']['message']\n except (ValueError, KeyError):\n reason = self.content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L43_C4", "label": "expression", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "vector": [8, 2, 0.3496, 0.0081, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Calculate the reason for the error from the response content.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L44_C4", "label": "if", "type": "if", "loc": [44, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "vector": [4, 2, 0.3862, 0.065, 2, 0.06, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.resp.get('content-type', '').startswith('application/json'):\n try:\n data = simplejson.loads(self.content)\n reason = data['error']['message']\n except (ValueError, KeyError):\n reason = self.content\n else:\n reason = self.resp.reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "label": "try", "type": "try", "loc": [45, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L44_C4", "vector": [7, 3, 0.3821, 0.0407, 3, 0.08, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n data = simplejson.loads(self.content)\n reason = data['error']['message']\n except (ValueError, KeyError):\n reason = self.content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L46_C8", "label": "data = loads()", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "vector": [14, 4, 0.374, 0.0081, 4, 0.22, 0.0, 929, 3, 1, 0, 0, 88, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "loads", "annotation": ""}, "snippet": " data = simplejson.loads(self.content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L47_C8", "label": "reason =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "vector": [14, 4, 0.3821, 0.0081, 4, 0.22, 1.0, 424, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reason = data['error']['message']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L49_C8", "label": "reason =", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "vector": [14, 4, 0.3984, 0.0081, 4, 0.22, 0.0, 424, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reason = self.content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L51_C6", "label": "reason =", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L44_C4", "vector": [14, 3, 0.4146, 0.0081, 3, 0.08, 1.0, 424, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reason = self.resp.reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "vector": [13, 2, 0.4228, 0.0081, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L54_C2", "label": "__repr__", "type": "function", "loc": [54, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "vector": [2, 1, 0.4593, 0.0488, 1, 0.38, 0.75, 204, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n if self.uri:\n return '<HttpError %s when requesting %s returned \"%s\">' % (\n self.resp.status, self.uri, self._get_reason())\n else:\n return '<HttpError %s \"%s\">' % (self.resp.status, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L55_C4", "label": "if", "type": "if", "loc": [55, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L54_C2", "vector": [4, 2, 0.4634, 0.0407, 2, 0.07, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.uri:\n return '<HttpError %s when requesting %s returned \"%s\">' % (\n self.resp.status, self.uri, self._get_reason())\n else:\n return '<HttpError %s \"%s\">' % (self.resp.status, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L56_C6", "label": "return", "type": "return", "loc": [56, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L55_C4", "vector": [13, 3, 0.4593, 0.0163, 3, 0.33, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<HttpError %s when requesting %s returned \"%s\">' % (\n self.resp.status, self.uri, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L59_C6", "label": "return", "type": "return", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L55_C4", "vector": [13, 3, 0.4797, 0.0081, 3, 0.33, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<HttpError %s \"%s\">' % (self.resp.status, self._get_reason())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L61_C2", "label": "__str__ =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "vector": [14, 1, 0.4959, 0.0081, 1, 0.38, 1.0, 527, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __str__ = __repr__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L64_C0", "label": "InvalidJsonError", "type": "class", "loc": [64, 66], "level": 0, "parent": null, "vector": [3, 0, 0.5285, 0.0244, 0, 0.66, 0.3846, 57, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "InvalidJsonError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidJsonError(Error):\n \"\"\"The JSON returned could not be parsed.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L65_C2", "label": "expression", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L64_C0", "vector": [8, 1, 0.5285, 0.0081, 1, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The JSON returned could not be parsed.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L69_C0", "label": "UnknownLinkType", "type": "class", "loc": [69, 71], "level": 0, "parent": null, "vector": [3, 0, 0.5691, 0.0244, 0, 0.66, 0.4615, 980, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnknownLinkType", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnknownLinkType(Error):\n \"\"\"Link type unknown or unexpected.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L70_C2", "label": "expression", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L69_C0", "vector": [8, 1, 0.5691, 0.0081, 1, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Link type unknown or unexpected.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L74_C0", "label": "UnknownApiNameOrVersion", "type": "class", "loc": [74, 76], "level": 0, "parent": null, "vector": [3, 0, 0.6098, 0.0244, 0, 0.66, 0.5385, 850, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnknownApiNameOrVersion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnknownApiNameOrVersion(Error):\n \"\"\"No API with that name and version exists.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L75_C2", "label": "expression", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L74_C0", "vector": [8, 1, 0.6098, 0.0081, 1, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"No API with that name and version exists.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L79_C0", "label": "UnacceptableMimeTypeError", "type": "class", "loc": [79, 81], "level": 0, "parent": null, "vector": [3, 0, 0.6504, 0.0244, 0, 0.66, 0.6154, 915, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "UnacceptableMimeTypeError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnacceptableMimeTypeError(Error):\n \"\"\"That is an unacceptable mimetype for this operation.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L80_C2", "label": "expression", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L79_C0", "vector": [8, 1, 0.6504, 0.0081, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"That is an unacceptable mimetype for this operation.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L84_C0", "label": "MediaUploadSizeError", "type": "class", "loc": [84, 86], "level": 0, "parent": null, "vector": [3, 0, 0.6911, 0.0244, 0, 0.66, 0.6923, 809, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "MediaUploadSizeError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaUploadSizeError(Error):\n \"\"\"Media is larger than the method can accept.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L85_C2", "label": "expression", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L84_C0", "vector": [8, 1, 0.6911, 0.0081, 1, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Media is larger than the method can accept.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L89_C0", "label": "ResumableUploadError", "type": "class", "loc": [89, 91], "level": 0, "parent": null, "vector": [3, 0, 0.7317, 0.0244, 0, 0.66, 0.7692, 519, 0, 0, 0, 0, 529, 0, 0], "semantic": {"name": "ResumableUploadError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResumableUploadError(Error):\n \"\"\"Error occured during resumable upload.\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L90_C2", "label": "expression", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L89_C0", "vector": [8, 1, 0.7317, 0.0081, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error occured during resumable upload.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "label": "BatchError", "type": "class", "loc": [94, 105], "level": 0, "parent": null, "vector": [3, 0, 0.8089, 0.0976, 0, 0.66, 0.8462, 864, 0, 2, 0, 0, 466, 0, 0], "semantic": {"name": "BatchError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BatchError(HttpError):\n \"\"\"Error occured during batch operations.\"\"\"\n\n def __init__(self, reason, resp=None, content=None):\n self.resp = resp\n self.content = content\n self.reason = reason\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L95_C2", "label": "expression", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "vector": [8, 1, 0.7724, 0.0081, 1, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Error occured during batch operations.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "label": "__init__", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "vector": [2, 1, 0.8008, 0.0325, 1, 0.62, 0.3333, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "reason", "resp", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, reason, resp=None, content=None):\n self.resp = resp\n self.content = content\n self.reason = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L98_C4", "label": "self.resp =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "vector": [14, 2, 0.7967, 0.0081, 2, 0.93, 0.0, 454, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resp = resp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L99_C4", "label": "self.content =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "vector": [14, 2, 0.8049, 0.0081, 2, 0.93, 0.5, 943, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.content = content"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L100_C4", "label": "self.reason =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "vector": [14, 2, 0.813, 0.0081, 2, 0.93, 1.0, 831, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.reason", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.reason = reason"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L102_C2", "label": "__repr__", "type": "function", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "vector": [2, 1, 0.8333, 0.0163, 1, 0.62, 0.6667, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return '<BatchError %s \"%s\">' % (self.resp.status, self.reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L103_C6", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L102_C2", "vector": [13, 2, 0.8374, 0.0081, 2, 0.97, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<BatchError %s \"%s\">' % (self.resp.status, self.reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L105_C2", "label": "__str__ =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "vector": [14, 1, 0.8537, 0.0081, 1, 0.62, 1.0, 527, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __str__ = __repr__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L108_C0", "label": "UnexpectedMethodError", "type": "class", "loc": [108, 114], "level": 0, "parent": null, "vector": [3, 0, 0.9024, 0.0569, 0, 0.66, 0.9231, 748, 0, 1, 0, 0, 529, 0, 2], "semantic": {"name": "UnexpectedMethodError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnexpectedMethodError(Error):\n \"\"\"Exception raised by RequestMockBuilder on unexpected calls.\"\"\"\n\n def __init__(self, methodId=None):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedMethodError, self).__init__(\n 'Received unexpected call %s' % methodId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L109_C2", "label": "expression", "type": "expression", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L108_C0", "vector": [8, 1, 0.8862, 0.0081, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exception raised by RequestMockBuilder on unexpected calls.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L111_C2", "label": "__init__", "type": "function", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L108_C0", "vector": [2, 1, 0.9146, 0.0325, 1, 0.81, 1.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "methodId"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, methodId=None):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedMethodError, self).__init__(\n 'Received unexpected call %s' % methodId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L111_C2", "vector": [8, 2, 0.9106, 0.0081, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for an UnexpectedMethodError.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L113_C4", "label": "__init__()", "type": "expression", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L111_C2", "vector": [8, 2, 0.9228, 0.0163, 2, 0.5, 1.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(UnexpectedMethodError, self).__init__(\n 'Received unexpected call %s' % methodId)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L117_C0", "label": "UnexpectedBodyError", "type": "class", "loc": [117, 123], "level": 0, "parent": null, "vector": [3, 0, 0.9756, 0.0569, 0, 0.66, 1.0, 14, 0, 1, 0, 0, 529, 0, 2], "semantic": {"name": "UnexpectedBodyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnexpectedBodyError(Error):\n \"\"\"Exception raised by RequestMockBuilder on unexpected bodies.\"\"\"\n\n def __init__(self, expected, provided):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedBodyError, self).__init__(\n 'Expected: [%s] - Provided: [%s]' % (expected, provided))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L118_C2", "label": "expression", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L117_C0", "vector": [8, 1, 0.9593, 0.0081, 1, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Exception raised by RequestMockBuilder on unexpected bodies.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L120_C2", "label": "__init__", "type": "function", "loc": [120, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L117_C0", "vector": [2, 1, 0.9878, 0.0325, 1, 0.12, 1.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "expected", "provided"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, expected, provided):\n \"\"\"Constructor for an UnexpectedMethodError.\"\"\"\n super(UnexpectedBodyError, self).__init__(\n 'Expected: [%s] - Provided: [%s]' % (expected, provided))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L121_C4", "label": "expression", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L120_C2", "vector": [8, 2, 0.9837, 0.0081, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor for an UnexpectedMethodError.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L122_C4", "label": "__init__()", "type": "expression", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L120_C2", "vector": [8, 2, 0.9959, 0.0163, 2, 0.42, 1.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(UnexpectedBodyError, self).__init__(\n 'Expected: [%s] - Provided: [%s]' % (expected, provided))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L37_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:Try_L45_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L51_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L56_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L59_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Return_L103_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Assign_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:ClassDef_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99185:FunctionDef_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99185:Expr_L122_C4"}] |
__version__ = "1.0c2"
| ajibawa-2023/Python-Code-Large/train/row_99186 | 1 | 1 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99186:Assign_L1_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"1.0c2\""}] | [] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Schema processing for discovery based APIs
Schemas holds an APIs discovery schemas. It can return those schema as
deserialized JSON objects, or pretty print them as prototype objects that
conform to the schema.
For example, given the schema:
schema = \"\"\"{
"Foo": {
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of the collection."
},
"kind": {
"type": "string",
"description": "Type of the collection ('calendar#acl').",
"default": "calendar#acl"
},
"nextPageToken": {
"type": "string",
"description": "Token used to access the next
page of this result. Omitted if no further results are available."
}
}
}
}\"\"\"
s = Schemas(schema)
print s.prettyPrintByName('Foo')
Produces the following output:
{
"nextPageToken": "A String", # Token used to access the
# next page of this result. Omitted if no further results are available.
"kind": "A String", # Type of the collection ('calendar#acl').
"etag": "A String", # ETag of the collection.
},
The constructor takes a discovery document in which to look up named schema.
"""
# TODO(jcgregorio) support format, enum, minimum, maximum
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import copy
from oauth2client.anyjson import simplejson
class Schemas(object):
"""Schemas for an API."""
def __init__(self, discovery):
"""Constructor.
Args:
discovery: object, Deserialized discovery document from which we pull
out the named schema.
"""
self.schemas = discovery.get('schemas', {})
# Cache of pretty printed schemas.
self.pretty = {}
def _prettyPrintByName(self, name, seen=None, dent=0):
"""Get pretty printed object prototype from the schema name.
Args:
name: string, Name of schema in the discovery document.
seen: list of string, Names of schema already seen. Used to handle
recursive definitions.
Returns:
string, A string that contains a prototype object with
comments that conforms to the given schema.
"""
if seen is None:
seen = []
if name in seen:
# Do not fall into an infinite loop over recursive definitions.
return '# Object with schema name: %s' % name
seen.append(name)
if name not in self.pretty:
self.pretty[name] = _SchemaToStruct(self.schemas[name],
seen, dent).to_str(self._prettyPrintByName)
seen.pop()
return self.pretty[name]
def prettyPrintByName(self, name):
"""Get pretty printed object prototype from the schema name.
Args:
name: string, Name of schema in the discovery document.
Returns:
string, A string that contains a prototype object with
comments that conforms to the given schema.
"""
# Return with trailing comma and newline removed.
return self._prettyPrintByName(name, seen=[], dent=1)[:-2]
def _prettyPrintSchema(self, schema, seen=None, dent=0):
"""Get pretty printed object prototype of schema.
Args:
schema: object, Parsed JSON schema.
seen: list of string, Names of schema already seen. Used to handle
recursive definitions.
Returns:
string, A string that contains a prototype object with
comments that conforms to the given schema.
"""
if seen is None:
seen = []
return _SchemaToStruct(schema, seen, dent).to_str(self._prettyPrintByName)
def prettyPrintSchema(self, schema):
"""Get pretty printed object prototype of schema.
Args:
schema: object, Parsed JSON schema.
Returns:
string, A string that contains a prototype object with
comments that conforms to the given schema.
"""
# Return with trailing comma and newline removed.
return self._prettyPrintSchema(schema, dent=1)[:-2]
def get(self, name):
"""Get deserialized JSON schema from the schema name.
Args:
name: string, Schema name.
"""
return self.schemas[name]
class _SchemaToStruct(object):
"""Convert schema to a prototype object."""
def __init__(self, schema, seen, dent=0):
"""Constructor.
Args:
schema: object, Parsed JSON schema.
seen: list, List of names of schema already seen while parsing. Used to
handle recursive definitions.
dent: int, Initial indentation depth.
"""
# The result of this parsing kept as list of strings.
self.value = []
# The final value of the parsing.
self.string = None
# The parsed JSON schema.
self.schema = schema
# Indentation level.
self.dent = dent
# Method that when called returns a prototype object for the schema with
# the given name.
self.from_cache = None
# List of names of schema already seen while parsing.
self.seen = seen
def emit(self, text):
"""Add text as a line to the output.
Args:
text: string, Text to output.
"""
self.value.extend([" " * self.dent, text, '\n'])
def emitBegin(self, text):
"""Add text to the output, but with no line terminator.
Args:
text: string, Text to output.
"""
self.value.extend([" " * self.dent, text])
def emitEnd(self, text, comment):
"""Add text and comment to the output with line terminator.
Args:
text: string, Text to output.
comment: string, Python comment.
"""
if comment:
divider = '\n' + ' ' * (self.dent + 2) + '# '
lines = comment.splitlines()
lines = [x.rstrip() for x in lines]
comment = divider.join(lines)
self.value.extend([text, ' # ', comment, '\n'])
else:
self.value.extend([text, '\n'])
def indent(self):
"""Increase indentation level."""
self.dent += 1
def undent(self):
"""Decrease indentation level."""
self.dent -= 1
def _to_str_impl(self, schema):
"""Prototype object based on the schema, in Python code with comments.
Args:
schema: object, Parsed JSON schema file.
Returns:
Prototype object based on the schema, in Python code with comments.
"""
stype = schema.get('type')
if stype == 'object':
self.emitEnd('{', schema.get('description', ''))
self.indent()
for pname, pschema in schema.get('properties', {}).iteritems():
self.emitBegin('"%s": ' % pname)
self._to_str_impl(pschema)
self.undent()
self.emit('},')
elif '$ref' in schema:
schemaName = schema['$ref']
description = schema.get('description', '')
s = self.from_cache(schemaName, self.seen)
parts = s.splitlines()
self.emitEnd(parts[0], description)
for line in parts[1:]:
self.emit(line.rstrip())
elif stype == 'boolean':
value = schema.get('default', 'True or False')
self.emitEnd('%s,' % str(value), schema.get('description', ''))
elif stype == 'string':
value = schema.get('default', 'A String')
self.emitEnd('"%s",' % str(value), schema.get('description', ''))
elif stype == 'integer':
value = schema.get('default', '42')
self.emitEnd('%s,' % str(value), schema.get('description', ''))
elif stype == 'number':
value = schema.get('default', '3.14')
self.emitEnd('%s,' % str(value), schema.get('description', ''))
elif stype == 'null':
self.emitEnd('None,', schema.get('description', ''))
elif stype == 'any':
self.emitEnd('"",', schema.get('description', ''))
elif stype == 'array':
self.emitEnd('[', schema.get('description'))
self.indent()
self.emitBegin('')
self._to_str_impl(schema['items'])
self.undent()
self.emit('],')
else:
self.emit('Unknown type! %s' % stype)
self.emitEnd('', '')
self.string = ''.join(self.value)
return self.string
def to_str(self, from_cache):
"""Prototype object based on the schema, in Python code with comments.
Args:
from_cache: callable(name, seen), Callable that retrieves an object
prototype for a schema with the given name. Seen is a list of schema
names already seen as we recursively descend the schema definition.
Returns:
Prototype object based on the schema, in Python code with comments.
The lines of the code will all be properly indented.
"""
self.from_cache = from_cache
return self._to_str_impl(self.schema)
| ajibawa-2023/Python-Code-Large/train/row_99187 | 114 | 303 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 58], "level": 0, "parent": null, "vector": [8, 0, 0.1205, 0.1452, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Schema processing for discovery based APIs\n\nSchemas holds an APIs discovery schemas. It can return those schema as\ndeserialized JSON objects, or pretty print them as prototype objects that\nconform to the schema.\n\nFor example, given the schema:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L62_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.2046, 0.0033, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Import_L64_C0", "label": "copy import copy", "type": "import", "loc": [64, 64], "level": 0, "parent": null, "vector": [1, 0, 0.2112, 0.0033, 0, 0.66, 0.4, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:ImportFrom_L65_C0", "label": "from oauth2client.anyjson import simplejson", "type": "import", "loc": [65, 65], "level": 0, "parent": null, "vector": [1, 0, 0.2145, 0.0033, 0, 0.66, 0.6, 822, 0, 1, 0, 0, 822, 0, 0], "semantic": {"name": "oauth2client.anyjson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": "from oauth2client.anyjson import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "label": "Schemas", "type": "class", "loc": [68, 160], "level": 0, "parent": null, "vector": [3, 0, 0.3762, 0.3069, 0, 0.66, 0.8, 892, 0, 6, 0, 0, 186, 0, 9], "semantic": {"name": "Schemas", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Schemas(object):\n \"\"\"Schemas for an API.\"\"\"\n\n def __init__(self, discovery):\n \"\"\"Constructor.\n\n Args:\n discovery: object, Deserialized discovery document from which we pull"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L69_C2", "label": "expression", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [8, 1, 0.2277, 0.0033, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Schemas for an API.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "label": "__init__", "type": "function", "loc": [71, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [2, 1, 0.2508, 0.0363, 1, 0.93, 0.1667, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "discovery"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, discovery):\n \"\"\"Constructor.\n\n Args:\n discovery: object, Deserialized discovery document from which we pull\n out the named schema.\n \"\"\"\n self.schemas = discovery.get('schemas', {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L72_C4", "label": "expression", "type": "expression", "loc": [72, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "vector": [8, 2, 0.2459, 0.0198, 2, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n discovery: object, Deserialized discovery document from which we pull\n out the named schema.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L78_C4", "label": "self.schemas = get()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "vector": [14, 2, 0.2574, 0.0033, 2, 0.04, 0.5, 365, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.schemas", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.schemas = discovery.get('schemas', {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L81_C4", "label": "self.pretty =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "vector": [14, 2, 0.2673, 0.0033, 2, 0.04, 1.0, 608, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.pretty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pretty = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "label": "_prettyPrintByName", "type": "function", "loc": [83, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [2, 1, 0.3168, 0.0891, 1, 0.93, 0.3333, 869, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "_prettyPrintByName", "arg_names": ["self", "name", "seen", "dent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prettyPrintByName(self, name, seen=None, dent=0):\n \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L84_C4", "label": "expression", "type": "expression", "loc": [84, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [8, 2, 0.2937, 0.0363, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L95_C4", "label": "if", "type": "if", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [4, 2, 0.3152, 0.0066, 2, 0.06, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if seen is None:\n seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L96_C6", "label": "seen =", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L95_C4", "vector": [14, 3, 0.3168, 0.0033, 3, 0.78, 0.0, 212, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L98_C4", "label": "if", "type": "if", "loc": [98, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [4, 2, 0.3267, 0.0099, 2, 0.06, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in seen:\n # Do not fall into an infinite loop over recursive definitions.\n return '# Object with schema name: %s' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L100_C6", "label": "return", "type": "return", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L98_C4", "vector": [13, 3, 0.33, 0.0033, 3, 0.01, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '# Object with schema name: %s' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L101_C4", "label": "append()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [8, 2, 0.3333, 0.0033, 2, 0.06, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " seen.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L103_C4", "label": "if", "type": "if", "loc": [103, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [4, 2, 0.3432, 0.0099, 2, 0.06, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self.pretty:\n self.pretty[name] = _SchemaToStruct(self.schemas[name],\n seen, dent).to_str(self._prettyPrintByName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L104_C6", "label": " = to_str()", "type": "assigned_variable", "loc": [104, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L103_C4", "vector": [14, 3, 0.3449, 0.0066, 3, 0.15, 0.0, 0, 3, 1, 0, 0, 798, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "to_str", "annotation": ""}, "snippet": " self.pretty[name] = _SchemaToStruct(self.schemas[name],\n seen, dent).to_str(self._prettyPrintByName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L107_C4", "label": "pop()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [8, 2, 0.3531, 0.0033, 2, 0.06, 0.8333, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " seen.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L109_C4", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "vector": [13, 2, 0.3597, 0.0033, 2, 0.06, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.pretty[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L111_C2", "label": "prettyPrintByName", "type": "function", "loc": [111, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [2, 1, 0.3845, 0.0396, 1, 0.93, 0.5, 940, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "prettyPrintByName", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prettyPrintByName(self, name):\n \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n\n Returns:\n string, A string that contains a prototype object with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L111_C2", "vector": [8, 2, 0.3828, 0.0297, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype from the schema name.\n\n Args:\n name: string, Name of schema in the discovery document.\n\n Returns:\n string, A string that contains a prototype object with\n comments that conforms to the given schema."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L122_C4", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L111_C2", "vector": [13, 2, 0.4026, 0.0033, 2, 0.81, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._prettyPrintByName(name, seen=[], dent=1)[:-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "label": "_prettyPrintSchema", "type": "function", "loc": [124, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [2, 1, 0.434, 0.0528, 1, 0.93, 0.6667, 62, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "_prettyPrintSchema", "arg_names": ["self", "schema", "seen", "dent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prettyPrintSchema(self, schema, seen=None, dent=0):\n \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L125_C4", "label": "expression", "type": "expression", "loc": [125, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "vector": [8, 2, 0.429, 0.0363, 2, 0.79, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list of string, Names of schema already seen. Used to handle\n recursive definitions.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L136_C4", "label": "if", "type": "if", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "vector": [4, 2, 0.4505, 0.0066, 2, 0.79, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if seen is None:\n seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L137_C6", "label": "seen =", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L136_C4", "vector": [14, 3, 0.4521, 0.0033, 3, 0.62, 0.0, 212, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seen = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L139_C4", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "vector": [13, 2, 0.4587, 0.0033, 2, 0.79, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _SchemaToStruct(schema, seen, dent).to_str(self._prettyPrintByName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L141_C2", "label": "prettyPrintSchema", "type": "function", "loc": [141, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [2, 1, 0.4835, 0.0396, 1, 0.93, 0.8333, 276, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "prettyPrintSchema", "arg_names": ["self", "schema"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prettyPrintSchema(self, schema):\n \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n\n Returns:\n string, A string that contains a prototype object with"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L142_C4", "label": "expression", "type": "expression", "loc": [142, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L141_C2", "vector": [8, 2, 0.4818, 0.0297, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get pretty printed object prototype of schema.\n\n Args:\n schema: object, Parsed JSON schema.\n\n Returns:\n string, A string that contains a prototype object with\n comments that conforms to the given schema."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L152_C4", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L141_C2", "vector": [13, 2, 0.5017, 0.0033, 2, 0.92, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._prettyPrintSchema(schema, dent=1)[:-2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L154_C2", "label": "get", "type": "function", "loc": [154, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "vector": [2, 1, 0.5182, 0.0231, 1, 0.93, 1.0, 607, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self, name):\n \"\"\"Get deserialized JSON schema from the schema name.\n\n Args:\n name: string, Schema name.\n \"\"\"\n return self.schemas[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L155_C4", "label": "expression", "type": "expression", "loc": [155, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L154_C2", "vector": [8, 2, 0.5182, 0.0165, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get deserialized JSON schema from the schema name.\n\n Args:\n name: string, Schema name.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L160_C4", "label": "return", "type": "return", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L154_C2", "vector": [13, 2, 0.5281, 0.0033, 2, 0.66, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.schemas[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "label": "_SchemaToStruct", "type": "class", "loc": [163, 303], "level": 0, "parent": null, "vector": [3, 0, 0.769, 0.4653, 0, 0.66, 1.0, 130, 0, 8, 0, 0, 186, 0, 54], "semantic": {"name": "_SchemaToStruct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SchemaToStruct(object):\n \"\"\"Convert schema to a prototype object.\"\"\"\n\n def __init__(self, schema, seen, dent=0):\n \"\"\"Constructor.\n\n Args:\n schema: object, Parsed JSON schema."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L164_C2", "label": "expression", "type": "expression", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [8, 1, 0.5413, 0.0033, 1, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert schema to a prototype object.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "label": "__init__", "type": "function", "loc": [166, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.5908, 0.0891, 1, 0.72, 0.125, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "schema", "seen", "dent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, schema, seen, dent=0):\n \"\"\"Constructor.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list, List of names of schema already seen while parsing. Used to\n handle recursive definitions.\n dent: int, Initial indentation depth."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L167_C4", "label": "expression", "type": "expression", "loc": [167, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [8, 2, 0.5627, 0.0264, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n schema: object, Parsed JSON schema.\n seen: list, List of names of schema already seen while parsing. Used to\n handle recursive definitions.\n dent: int, Initial indentation depth.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L176_C4", "label": "self.value =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [14, 2, 0.5809, 0.0033, 2, 0.4, 0.1667, 966, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L179_C4", "label": "self.string =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [14, 2, 0.5908, 0.0033, 2, 0.4, 0.3333, 182, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.string = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L182_C4", "label": "self.schema =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [14, 2, 0.6007, 0.0033, 2, 0.4, 0.5, 698, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.schema", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.schema = schema"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L185_C4", "label": "self.dent =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [14, 2, 0.6106, 0.0033, 2, 0.4, 0.6667, 840, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dent = dent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L189_C4", "label": "self.from_cache =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [14, 2, 0.6238, 0.0033, 2, 0.4, 0.8333, 122, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.from_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.from_cache = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L192_C4", "label": "self.seen =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "vector": [14, 2, 0.6337, 0.0033, 2, 0.4, 1.0, 607, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seen = seen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L194_C2", "label": "emit", "type": "function", "loc": [194, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.6502, 0.0231, 1, 0.72, 0.25, 627, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emit(self, text):\n \"\"\"Add text as a line to the output.\n\n Args:\n text: string, Text to output.\n \"\"\"\n self.value.extend([\" \" * self.dent, text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L195_C4", "label": "expression", "type": "expression", "loc": [195, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L194_C2", "vector": [8, 2, 0.6502, 0.0165, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add text as a line to the output.\n\n Args:\n text: string, Text to output.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L200_C4", "label": "extend()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L194_C2", "vector": [8, 2, 0.6601, 0.0033, 2, 0.5, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([\" \" * self.dent, text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L202_C2", "label": "emitBegin", "type": "function", "loc": [202, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.6766, 0.0231, 1, 0.72, 0.375, 293, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emitBegin", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emitBegin(self, text):\n \"\"\"Add text to the output, but with no line terminator.\n\n Args:\n text: string, Text to output.\n \"\"\"\n self.value.extend([\" \" * self.dent, text])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L203_C4", "label": "expression", "type": "expression", "loc": [203, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L202_C2", "vector": [8, 2, 0.6766, 0.0165, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add text to the output, but with no line terminator.\n\n Args:\n text: string, Text to output.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L208_C4", "label": "extend()", "type": "expression", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L202_C2", "vector": [8, 2, 0.6865, 0.0033, 2, 0.51, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([\" \" * self.dent, text])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L210_C2", "label": "emitEnd", "type": "function", "loc": [210, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.7162, 0.0495, 1, 0.72, 0.5, 568, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "emitEnd", "arg_names": ["self", "text", "comment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emitEnd(self, text, comment):\n \"\"\"Add text and comment to the output with line terminator.\n\n Args:\n text: string, Text to output.\n comment: string, Python comment.\n \"\"\"\n if comment:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L211_C4", "label": "expression", "type": "expression", "loc": [211, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L210_C2", "vector": [8, 2, 0.7046, 0.0198, 2, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add text and comment to the output with line terminator.\n\n Args:\n text: string, Text to output.\n comment: string, Python comment.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "label": "if", "type": "if", "loc": [217, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L210_C2", "vector": [4, 2, 0.7277, 0.0264, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if comment:\n divider = '\\n' + ' ' * (self.dent + 2) + '# '\n lines = comment.splitlines()\n lines = [x.rstrip() for x in lines]\n comment = divider.join(lines)\n self.value.extend([text, ' # ', comment, '\\n'])\n else:\n self.value.extend([text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L218_C6", "label": "divider =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "vector": [14, 3, 0.7195, 0.0033, 3, 0.94, 0.0, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "divider", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " divider = '\\n' + ' ' * (self.dent + 2) + '# '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L219_C6", "label": "lines = splitlines()", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "vector": [14, 3, 0.7228, 0.0033, 3, 0.94, 0.2, 73, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " lines = comment.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L220_C6", "label": "lines =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "vector": [14, 3, 0.7261, 0.0033, 3, 0.94, 0.4, 73, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines = [x.rstrip() for x in lines]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L221_C6", "label": "comment = join()", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "vector": [14, 3, 0.7294, 0.0033, 3, 0.94, 0.6, 34, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " comment = divider.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L222_C6", "label": "extend()", "type": "expression", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "vector": [8, 3, 0.7327, 0.0033, 3, 0.94, 0.8, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([text, ' # ', comment, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L224_C6", "label": "extend()", "type": "expression", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "vector": [8, 3, 0.7393, 0.0033, 3, 0.94, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.value.extend([text, '\\n'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L226_C2", "label": "indent", "type": "function", "loc": [226, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.7492, 0.0099, 1, 0.72, 0.625, 231, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "indent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def indent(self):\n \"\"\"Increase indentation level.\"\"\"\n self.dent += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L227_C4", "label": "expression", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L226_C2", "vector": [8, 2, 0.7492, 0.0033, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Increase indentation level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L230_C2", "label": "undent", "type": "function", "loc": [230, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.7624, 0.0099, 1, 0.72, 0.75, 937, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "undent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def undent(self):\n \"\"\"Decrease indentation level.\"\"\"\n self.dent -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L231_C4", "label": "expression", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L230_C2", "vector": [8, 2, 0.7624, 0.0033, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Decrease indentation level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "label": "_to_str_impl", "type": "function", "loc": [234, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.8614, 0.1815, 1, 0.72, 0.875, 954, 0, 2, 1, 0, 0, 0, 46], "semantic": {"name": "_to_str_impl", "arg_names": ["self", "schema"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_str_impl(self, schema):\n \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n schema: object, Parsed JSON schema file.\n\n Returns:\n Prototype object based on the schema, in Python code with comments."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L235_C4", "label": "expression", "type": "expression", "loc": [235, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "vector": [8, 2, 0.7871, 0.0264, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n schema: object, Parsed JSON schema file.\n\n Returns:\n Prototype object based on the schema, in Python code with comments.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L243_C4", "label": "stype = get()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "vector": [14, 2, 0.802, 0.0033, 2, 0.57, 0.25, 15, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "stype", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " stype = schema.get('type')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "label": "if", "type": "if", "loc": [244, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "vector": [4, 2, 0.8729, 0.1386, 2, 0.57, 0.5, 0, 0, 0, 0, 0, 0, 0, 44], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stype == 'object':\n self.emitEnd('{', schema.get('description', ''))\n self.indent()\n for pname, pschema in schema.get('properties', {}).iteritems():\n self.emitBegin('\"%s\": ' % pname)\n self._to_str_impl(pschema)\n self.undent()\n self.emit('},')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L245_C6", "label": "emitEnd()", "type": "expression", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "vector": [8, 3, 0.8086, 0.0033, 3, 0.03, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('{', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L246_C6", "label": "indent()", "type": "expression", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "vector": [8, 3, 0.8119, 0.0033, 3, 0.03, 0.2, 231, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indent", "arg_names": [], "import_names": [], "rhs_call_name": "indent", "annotation": ""}, "snippet": " self.indent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L247_C6", "label": "for pname, pschema", "type": "for", "loc": [247, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "vector": [6, 3, 0.8185, 0.0099, 3, 0.03, 0.4, 119, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "pname, pschema", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pname, pschema in schema.get('properties', {}).iteritems():\n self.emitBegin('\"%s\": ' % pname)\n self._to_str_impl(pschema)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L248_C8", "label": "emitBegin()", "type": "expression", "loc": [248, 248], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L247_C6", "vector": [8, 4, 0.8185, 0.0033, 4, 0.48, 0.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emitBegin", "arg_names": [], "import_names": [], "rhs_call_name": "emitBegin", "annotation": ""}, "snippet": " self.emitBegin('\"%s\": ' % pname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L249_C8", "label": "_to_str_impl()", "type": "expression", "loc": [249, 249], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L247_C6", "vector": [8, 4, 0.8218, 0.0033, 4, 0.48, 1.0, 954, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_to_str_impl", "arg_names": [], "import_names": [], "rhs_call_name": "_to_str_impl", "annotation": ""}, "snippet": " self._to_str_impl(pschema)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L250_C6", "label": "undent()", "type": "expression", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "vector": [8, 3, 0.8251, 0.0033, 3, 0.03, 0.6, 937, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "undent", "arg_names": [], "import_names": [], "rhs_call_name": "undent", "annotation": ""}, "snippet": " self.undent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L251_C6", "label": "emit()", "type": "expression", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "vector": [8, 3, 0.8284, 0.0033, 3, 0.03, 0.8, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit('},')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "label": "if", "type": "if", "loc": [252, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "vector": [4, 3, 0.8861, 0.1122, 3, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 0, 35], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif '$ref' in schema:\n schemaName = schema['$ref']\n description = schema.get('description', '')\n s = self.from_cache(schemaName, self.seen)\n parts = s.splitlines()\n self.emitEnd(parts[0], description)\n for line in parts[1:]:\n self.emit(line.rstrip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L253_C6", "label": "schemaName =", "type": "assigned_variable", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [14, 4, 0.835, 0.0033, 4, 0.21, 0.0, 5, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "schemaName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " schemaName = schema['$ref']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L254_C6", "label": "description = get()", "type": "assigned_variable", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [14, 4, 0.8383, 0.0033, 4, 0.21, 0.1667, 306, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " description = schema.get('description', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L255_C6", "label": "s = from_cache()", "type": "assigned_variable", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [14, 4, 0.8416, 0.0033, 4, 0.21, 0.3333, 553, 3, 2, 0, 0, 27, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "from_cache", "annotation": ""}, "snippet": " s = self.from_cache(schemaName, self.seen)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L256_C6", "label": "parts = splitlines()", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [14, 4, 0.8449, 0.0033, 4, 0.21, 0.5, 13, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " parts = s.splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L257_C6", "label": "emitEnd()", "type": "expression", "loc": [257, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [8, 4, 0.8482, 0.0033, 4, 0.21, 0.6667, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd(parts[0], description)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L258_C6", "label": "for line", "type": "for", "loc": [258, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [6, 4, 0.8531, 0.0066, 4, 0.21, 0.8333, 373, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in parts[1:]:\n self.emit(line.rstrip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L259_C8", "label": "emit()", "type": "expression", "loc": [259, 259], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L258_C6", "vector": [8, 5, 0.8548, 0.0033, 5, 0.84, 0.0, 627, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit(line.rstrip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "label": "if", "type": "if", "loc": [260, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "vector": [4, 4, 0.8993, 0.0858, 4, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'boolean':\n value = schema.get('default', 'True or False')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'string':\n value = schema.get('default', 'A String')\n self.emitEnd('\"%s\",' % str(value), schema.get('description', ''))\n elif stype == 'integer':\n value = schema.get('default', '42')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L261_C6", "label": "value = get()", "type": "assigned_variable", "loc": [261, 261], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "vector": [14, 5, 0.8614, 0.0033, 5, 0.45, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', 'True or False')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L262_C6", "label": "emitEnd()", "type": "expression", "loc": [262, 262], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "vector": [8, 5, 0.8647, 0.0033, 5, 0.45, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('%s,' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "label": "if", "type": "if", "loc": [263, 285], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "vector": [4, 5, 0.9043, 0.0759, 5, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'string':\n value = schema.get('default', 'A String')\n self.emitEnd('\"%s\",' % str(value), schema.get('description', ''))\n elif stype == 'integer':\n value = schema.get('default', '42')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'number':\n value = schema.get('default', '3.14')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L264_C6", "label": "value = get()", "type": "assigned_variable", "loc": [264, 264], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "vector": [14, 6, 0.8713, 0.0033, 6, 0.28, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', 'A String')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L265_C6", "label": "emitEnd()", "type": "expression", "loc": [265, 265], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "vector": [8, 6, 0.8746, 0.0033, 6, 0.28, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('\"%s\",' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "label": "if", "type": "if", "loc": [266, 285], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "vector": [4, 6, 0.9092, 0.066, 6, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'integer':\n value = schema.get('default', '42')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'number':\n value = schema.get('default', '3.14')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'null':\n self.emitEnd('None,', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L267_C6", "label": "value = get()", "type": "assigned_variable", "loc": [267, 267], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "vector": [14, 7, 0.8812, 0.0033, 7, 0.9, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', '42')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L268_C6", "label": "emitEnd()", "type": "expression", "loc": [268, 268], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "vector": [8, 7, 0.8845, 0.0033, 7, 0.9, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('%s,' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "label": "if", "type": "if", "loc": [269, 285], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "vector": [4, 7, 0.9142, 0.0561, 7, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'number':\n value = schema.get('default', '3.14')\n self.emitEnd('%s,' % str(value), schema.get('description', ''))\n elif stype == 'null':\n self.emitEnd('None,', schema.get('description', ''))\n elif stype == 'any':\n self.emitEnd('\"\",', schema.get('description', ''))\n elif stype == 'array':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L270_C6", "label": "value = get()", "type": "assigned_variable", "loc": [270, 270], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "vector": [14, 8, 0.8911, 0.0033, 8, 0.2, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = schema.get('default', '3.14')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L271_C6", "label": "emitEnd()", "type": "expression", "loc": [271, 271], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "vector": [8, 8, 0.8944, 0.0033, 8, 0.2, 0.5, 568, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('%s,' % str(value), schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L272_C4", "label": "if", "type": "if", "loc": [272, 285], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "vector": [4, 8, 0.9191, 0.0462, 8, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'null':\n self.emitEnd('None,', schema.get('description', ''))\n elif stype == 'any':\n self.emitEnd('\"\",', schema.get('description', ''))\n elif stype == 'array':\n self.emitEnd('[', schema.get('description'))\n self.indent()\n self.emitBegin('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L273_C6", "label": "emitEnd()", "type": "expression", "loc": [273, 273], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L272_C4", "vector": [8, 9, 0.901, 0.0033, 9, 0.72, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('None,', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L274_C4", "label": "if", "type": "if", "loc": [274, 285], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L272_C4", "vector": [4, 9, 0.9224, 0.0396, 9, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'any':\n self.emitEnd('\"\",', schema.get('description', ''))\n elif stype == 'array':\n self.emitEnd('[', schema.get('description'))\n self.indent()\n self.emitBegin('')\n self._to_str_impl(schema['items'])\n self.undent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L275_C6", "label": "emitEnd()", "type": "expression", "loc": [275, 275], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L274_C4", "vector": [8, 10, 0.9076, 0.0033, 10, 0.64, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('\"\",', schema.get('description', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "label": "if", "type": "if", "loc": [276, 285], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L274_C4", "vector": [4, 10, 0.9257, 0.033, 10, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stype == 'array':\n self.emitEnd('[', schema.get('description'))\n self.indent()\n self.emitBegin('')\n self._to_str_impl(schema['items'])\n self.undent()\n self.emit('],')\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L277_C6", "label": "emitEnd()", "type": "expression", "loc": [277, 277], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9142, 0.0033, 11, 0.07, 0.0, 568, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('[', schema.get('description'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L278_C6", "label": "indent()", "type": "expression", "loc": [278, 278], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9175, 0.0033, 11, 0.07, 0.1429, 231, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "indent", "arg_names": [], "import_names": [], "rhs_call_name": "indent", "annotation": ""}, "snippet": " self.indent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L279_C6", "label": "emitBegin()", "type": "expression", "loc": [279, 279], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9208, 0.0033, 11, 0.07, 0.2857, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emitBegin", "arg_names": [], "import_names": [], "rhs_call_name": "emitBegin", "annotation": ""}, "snippet": " self.emitBegin('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L280_C6", "label": "_to_str_impl()", "type": "expression", "loc": [280, 280], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9241, 0.0033, 11, 0.07, 0.4286, 954, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_to_str_impl", "arg_names": [], "import_names": [], "rhs_call_name": "_to_str_impl", "annotation": ""}, "snippet": " self._to_str_impl(schema['items'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L281_C6", "label": "undent()", "type": "expression", "loc": [281, 281], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9274, 0.0033, 11, 0.07, 0.5714, 937, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "undent", "arg_names": [], "import_names": [], "rhs_call_name": "undent", "annotation": ""}, "snippet": " self.undent()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L282_C6", "label": "emit()", "type": "expression", "loc": [282, 282], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9307, 0.0033, 11, 0.07, 0.7143, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit('],')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L284_C6", "label": "emit()", "type": "expression", "loc": [284, 284], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9373, 0.0033, 11, 0.07, 0.8571, 627, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "emit", "arg_names": [], "import_names": [], "rhs_call_name": "emit", "annotation": ""}, "snippet": " self.emit('Unknown type! %s' % stype)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L285_C6", "label": "emitEnd()", "type": "expression", "loc": [285, 285], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "vector": [8, 11, 0.9406, 0.0033, 11, 0.07, 1.0, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "emitEnd", "arg_names": [], "import_names": [], "rhs_call_name": "emitEnd", "annotation": ""}, "snippet": " self.emitEnd('', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L287_C4", "label": "self.string = join()", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "vector": [14, 2, 0.9472, 0.0033, 2, 0.57, 0.75, 182, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "self.string", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.string = ''.join(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L288_C4", "label": "return", "type": "return", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "vector": [13, 2, 0.9505, 0.0033, 2, 0.57, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "label": "to_str", "type": "function", "loc": [290, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "vector": [2, 1, 0.9785, 0.0462, 1, 0.72, 1.0, 798, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "to_str", "arg_names": ["self", "from_cache"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def to_str(self, from_cache):\n \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n from_cache: callable(name, seen), Callable that retrieves an object\n prototype for a schema with the given name. Seen is a list of schema\n names already seen as we recursively descend the schema definition.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L291_C4", "label": "expression", "type": "expression", "loc": [291, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "vector": [8, 2, 0.9769, 0.0363, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Prototype object based on the schema, in Python code with comments.\n\n Args:\n from_cache: callable(name, seen), Callable that retrieves an object\n prototype for a schema with the given name. Seen is a list of schema\n names already seen as we recursively descend the schema definition.\n\n Returns:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L302_C4", "label": "self.from_cache =", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "vector": [14, 2, 0.9967, 0.0033, 2, 0.92, 0.5, 122, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.from_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.from_cache = from_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L303_C4", "label": "return", "type": "return", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "vector": [13, 2, 1.0, 0.0033, 2, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._to_str_impl(self.schema)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L71_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L96_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L100_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L104_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L124_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L141_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L154_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L166_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L194_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L194_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L194_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L202_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L202_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L202_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L210_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L210_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L210_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L218_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L219_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L220_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L221_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L222_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L224_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L226_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L230_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L245_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L246_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L247_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L247_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L247_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L250_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L251_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L253_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L254_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L255_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L256_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L257_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L258_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:For_L258_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L261_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L262_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L264_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L265_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L267_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L268_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L266_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L270_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L271_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L273_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L275_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L277_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L278_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L279_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L280_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L281_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L282_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L284_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:If_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L285_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L234_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:ClassDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Expr_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Assign_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99187:FunctionDef_L290_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99187:Return_L303_C4"}] |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Utility module to import a JSON module
Hides all the messy details of exactly where
we get a simplejson module from.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
try: # pragma: no cover
import simplejson
except ImportError: # pragma: no cover
try:
# Try to import from django, should work on App Engine
from django.utils import simplejson
except ImportError:
# Should work for Python2.6 and higher.
import json as simplejson
| ajibawa-2023/Python-Code-Large/train/row_99188 | 7 | 32 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99188:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.5312, 0.1562, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Utility module to import a JSON module\n\nHides all the messy details of exactly where\nwe get a simplejson module from.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99188:Assign_L21_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6562, 0.0312, 0, 0.66, 0.5, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'jcgregorio@google.com (Joe Gregorio)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L24_C0", "label": "try", "type": "try", "loc": [24, 32], "level": 0, "parent": null, "vector": [7, 0, 0.875, 0.2812, 0, 0.66, 1.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try: # pragma: no cover\n import simplejson\nexcept ImportError: # pragma: no cover\n try:\n # Try to import from django, should work on App Engine\n from django.utils import simplejson\n except ImportError:\n # Should work for Python2.6 and higher."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99188:Import_L25_C2", "label": "simplejson import simplejson", "type": "import", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L24_C0", "vector": [1, 1, 0.7812, 0.0312, 1, 0.48, 0.0, 386, 0, 1, 0, 0, 386, 0, 0], "semantic": {"name": "simplejson", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L27_C2", "label": "try", "type": "try", "loc": [27, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L24_C0", "vector": [7, 1, 0.9219, 0.1875, 1, 0.48, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # Try to import from django, should work on App Engine\n from django.utils import simplejson\n except ImportError:\n # Should work for Python2.6 and higher.\n import json as simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99188:ImportFrom_L29_C4", "label": "from django.utils import simplejson", "type": "import", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L27_C2", "vector": [1, 2, 0.9062, 0.0312, 2, 0.82, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils import simplejson"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99188:Import_L32_C4", "label": "json import simplejson", "type": "import", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L27_C2", "vector": [1, 2, 1.0, 0.0312, 2, 0.82, 0.0, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["simplejson"], "rhs_call_name": "", "annotation": ""}, "snippet": " import json as simplejson"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99188:Import_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L27_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99188:ImportFrom_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99188:Try_L27_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99188:Import_L32_C4"}] |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<partial>[:\^]-?[0-9]+))?(=(?P<default>.*))?$", re.UNICODE)
def _tostring(varname, value, explode, operator, safe=""):
if type(value) == type([]):
if explode == "+":
return ",".join([varname + "." + urllib.quote(x, safe) for x in value])
else:
return ",".join([urllib.quote(x, safe) for x in value])
if type(value) == type({}):
keys = value.keys()
keys.sort()
if explode == "+":
return ",".join([varname + "." + urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys])
else:
return ",".join([urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys])
else:
return urllib.quote(value, safe)
def _tostring_path(varname, value, explode, operator, safe=""):
joiner = operator
if type(value) == type([]):
if explode == "+":
return joiner.join([varname + "." + urllib.quote(x, safe) for x in value])
elif explode == "*":
return joiner.join([urllib.quote(x, safe) for x in value])
else:
return ",".join([urllib.quote(x, safe) for x in value])
elif type(value) == type({}):
keys = value.keys()
keys.sort()
if explode == "+":
return joiner.join([varname + "." + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])
elif explode == "*":
return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])
else:
return ",".join([urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys])
else:
if value:
return urllib.quote(value, safe)
else:
return ""
def _tostring_query(varname, value, explode, operator, safe=""):
joiner = operator
varprefix = ""
if operator == "?":
joiner = "&"
varprefix = varname + "="
if type(value) == type([]):
if 0 == len(value):
return ""
if explode == "+":
return joiner.join([varname + "=" + urllib.quote(x, safe) for x in value])
elif explode == "*":
return joiner.join([urllib.quote(x, safe) for x in value])
else:
return varprefix + ",".join([urllib.quote(x, safe) for x in value])
elif type(value) == type({}):
if 0 == len(value):
return ""
keys = value.keys()
keys.sort()
if explode == "+":
return joiner.join([varname + "." + urllib.quote(key, safe) + "=" + urllib.quote(value[key], safe) for key in keys])
elif explode == "*":
return joiner.join([urllib.quote(key, safe) + "=" + urllib.quote(value[key], safe) for key in keys])
else:
return varprefix + ",".join([urllib.quote(key, safe) + "," + urllib.quote(value[key], safe) for key in keys])
else:
if value:
return varname + "=" + urllib.quote(value, safe)
else:
return varname
TOSTRING = {
"" : _tostring,
"+": _tostring,
";": _tostring_query,
"?": _tostring_query,
"/": _tostring_path,
".": _tostring_path,
}
def expand(template, vars):
def _sub(match):
groupdict = match.groupdict()
operator = groupdict.get('operator')
if operator is None:
operator = ''
varlist = groupdict.get('varlist')
safe = "@"
if operator == '+':
safe = RESERVED
varspecs = varlist.split(",")
varnames = []
defaults = {}
for varspec in varspecs:
m = VAR.search(varspec)
groupdict = m.groupdict()
varname = groupdict.get('varname')
explode = groupdict.get('explode')
partial = groupdict.get('partial')
default = groupdict.get('default')
if default:
defaults[varname] = default
varnames.append((varname, explode, partial))
retval = []
joiner = operator
prefix = operator
if operator == "+":
prefix = ""
joiner = ","
if operator == "?":
joiner = "&"
if operator == "":
joiner = ","
for varname, explode, partial in varnames:
if varname in vars:
value = vars[varname]
#if not value and (type(value) == type({}) or type(value) == type([])) and varname in defaults:
if not value and value != "" and varname in defaults:
value = defaults[varname]
elif varname in defaults:
value = defaults[varname]
else:
continue
retval.append(TOSTRING[operator](varname, value, explode, operator, safe=safe))
if "".join(retval):
return prefix + joiner.join(retval)
else:
return ""
return TEMPLATE.sub(_sub, template)
| ajibawa-2023/Python-Code-Large/train/row_99189 | 112 | 147 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Import_L3_C0", "label": "re import re", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0068, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Import_L4_C0", "label": "urllib import urllib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0272, 0.0068, 0, 0.66, 0.0833, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L6_C0", "label": "RESERVED =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0408, 0.0068, 0, 0.66, 0.1667, 137, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "RESERVED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RESERVED = \":/?#[]@!$&'()*+,;=\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L7_C0", "label": "OPERATOR =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0476, 0.0068, 0, 0.66, 0.25, 758, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OPERATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OPERATOR = \"+./;?|!@\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L8_C0", "label": "EXPLODE =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0544, 0.0068, 0, 0.66, 0.3333, 695, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EXPLODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXPLODE = \"*+\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L9_C0", "label": "MODIFIER =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0612, 0.0068, 0, 0.66, 0.4167, 533, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MODIFIER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MODIFIER = \":^\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L10_C0", "label": "TEMPLATE = compile()", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.068, 0.0068, 0, 0.66, 0.5, 762, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "TEMPLATE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "TEMPLATE = re.compile(r\"{(?P<operator>[\\+\\./;\\?|!@])?(?P<varlist>[^}]+)}\", re.UNICODE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L11_C0", "label": "VAR = compile()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.0748, 0.0068, 0, 0.66, 0.5833, 829, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "VAR", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "VAR = re.compile(r\"^(?P<varname>[^=\\+\\*:\\^]+)((?P<explode>[\\+\\*])|(?P<partial>[:\\^]-?[0-9]+))?(=(?P<default>.*))?$\", re.UNICODE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L13_C0", "label": "_tostring", "type": "function", "loc": [13, 27], "level": 0, "parent": null, "vector": [2, 0, 0.1361, 0.102, 0, 0.66, 0.6667, 60, 0, 5, 1, 0, 0, 0, 17], "semantic": {"name": "_tostring", "arg_names": ["varname", "value", "explode", "operator", "safe"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _tostring(varname, value, explode, operator, safe=\"\"):\n if type(value) == type([]):\n if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])\n if type(value) == type({}):\n keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L14_C2", "label": "if", "type": "if", "loc": [14, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L13_C0", "vector": [4, 1, 0.1088, 0.034, 1, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L15_C4", "label": "if", "type": "if", "loc": [15, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L14_C2", "vector": [4, 2, 0.1122, 0.0272, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L16_C6", "label": "return", "type": "return", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L15_C4", "vector": [13, 3, 0.1088, 0.0068, 3, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([varname + \".\" + urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L18_C6", "label": "return", "type": "return", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L15_C4", "vector": [13, 3, 0.1224, 0.0068, 3, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "label": "if", "type": "if", "loc": [19, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L13_C0", "vector": [4, 1, 0.1565, 0.0612, 1, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type({}):\n keys = value.keys()\n keys.sort()\n if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L20_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "vector": [14, 2, 0.1361, 0.0068, 2, 0.89, 0.0, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L21_C4", "label": "sort()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "vector": [8, 2, 0.1429, 0.0068, 2, 0.89, 0.3333, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L22_C4", "label": "if", "type": "if", "loc": [22, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "vector": [4, 2, 0.1599, 0.0272, 2, 0.89, 0.6667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return \",\".join([varname + \".\" + urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L23_C6", "label": "return", "type": "return", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L22_C4", "vector": [13, 3, 0.1565, 0.0068, 3, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([varname + \".\" + urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L25_C6", "label": "return", "type": "return", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L22_C4", "vector": [13, 3, 0.1701, 0.0068, 3, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "vector": [13, 2, 0.1837, 0.0068, 2, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return urllib.quote(value, safe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L30_C0", "label": "_tostring_path", "type": "function", "loc": [30, 52], "level": 0, "parent": null, "vector": [2, 0, 0.2789, 0.1565, 0, 0.66, 0.75, 860, 0, 5, 1, 0, 0, 0, 22], "semantic": {"name": "_tostring_path", "arg_names": ["varname", "value", "explode", "operator", "safe"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _tostring_path(varname, value, explode, operator, safe=\"\"):\n joiner = operator\n if type(value) == type([]):\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L31_C2", "label": "joiner =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L30_C0", "vector": [14, 1, 0.2109, 0.0068, 1, 0.6, 0.0, 555, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L32_C2", "label": "if", "type": "if", "loc": [32, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L30_C0", "vector": [4, 1, 0.2857, 0.1429, 1, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])\n elif type(value) == type({}):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L33_C4", "label": "if", "type": "if", "loc": [33, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L32_C2", "vector": [4, 2, 0.2415, 0.0408, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L34_C6", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L33_C4", "vector": [13, 3, 0.2313, 0.0068, 3, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \".\" + urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L35_C4", "label": "if", "type": "if", "loc": [35, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L33_C4", "vector": [4, 3, 0.2483, 0.0272, 3, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L36_C6", "label": "return", "type": "return", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L35_C4", "vector": [13, 4, 0.2449, 0.0068, 4, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L38_C6", "label": "return", "type": "return", "loc": [38, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L35_C4", "vector": [13, 4, 0.2585, 0.0068, 4, 0.64, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "label": "if", "type": "if", "loc": [39, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L32_C2", "vector": [4, 2, 0.3095, 0.0952, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(value) == type({}):\n keys = value.keys()\n keys.sort()\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L40_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "vector": [14, 3, 0.2721, 0.0068, 3, 0.84, 0.0, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L41_C4", "label": "sort()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "vector": [8, 3, 0.2789, 0.0068, 3, 0.84, 0.3333, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L42_C4", "label": "if", "type": "if", "loc": [42, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "vector": [4, 3, 0.3027, 0.0408, 3, 0.84, 0.6667, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L43_C6", "label": "return", "type": "return", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L42_C4", "vector": [13, 4, 0.2925, 0.0068, 4, 0.22, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \".\" + urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L44_C4", "label": "if", "type": "if", "loc": [44, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L42_C4", "vector": [4, 4, 0.3095, 0.0272, 4, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])\n else:\n return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L45_C6", "label": "return", "type": "return", "loc": [45, 45], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L44_C4", "vector": [13, 5, 0.3061, 0.0068, 5, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(key, safe) + joiner + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L47_C6", "label": "return", "type": "return", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L44_C4", "vector": [13, 5, 0.3197, 0.0068, 5, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L49_C4", "label": "if", "type": "if", "loc": [49, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "vector": [4, 3, 0.3435, 0.0272, 3, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value:\n return urllib.quote(value, safe)\n else:\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L50_C6", "label": "return", "type": "return", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L49_C4", "vector": [13, 4, 0.3401, 0.0068, 4, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return urllib.quote(value, safe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L52_C6", "label": "return", "type": "return", "loc": [52, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L49_C4", "vector": [13, 4, 0.3537, 0.0068, 4, 0.17, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "label": "_tostring_query", "type": "function", "loc": [54, 84], "level": 0, "parent": null, "vector": [2, 0, 0.4694, 0.2109, 0, 0.66, 0.8333, 588, 0, 5, 1, 0, 0, 0, 24], "semantic": {"name": "_tostring_query", "arg_names": ["varname", "value", "explode", "operator", "safe"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _tostring_query(varname, value, explode, operator, safe=\"\"):\n joiner = operator\n varprefix = \"\"\n if operator == \"?\":\n joiner = \"&\"\n varprefix = varname + \"=\"\n if type(value) == type([]):\n if 0 == len(value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L55_C2", "label": "joiner =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "vector": [14, 1, 0.3741, 0.0068, 1, 0.15, 0.0, 555, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L56_C2", "label": "varprefix =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "vector": [14, 1, 0.381, 0.0068, 1, 0.15, 0.3333, 596, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "varprefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varprefix = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L57_C2", "label": "if", "type": "if", "loc": [57, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "vector": [4, 1, 0.3946, 0.0204, 1, 0.15, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"?\":\n joiner = \"&\"\n varprefix = varname + \"=\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L58_C4", "label": "joiner =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L57_C2", "vector": [14, 2, 0.3946, 0.0068, 2, 0.49, 0.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \"&\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L59_C4", "label": "varprefix =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L57_C2", "vector": [14, 2, 0.4014, 0.0068, 2, 0.49, 1.0, 596, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "varprefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varprefix = varname + \"=\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "label": "if", "type": "if", "loc": [60, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "vector": [4, 1, 0.4898, 0.1701, 1, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 24], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(value) == type([]):\n if 0 == len(value):\n return \"\"\n if explode == \"+\":\n return joiner.join([varname + \"=\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L61_C4", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "vector": [4, 2, 0.4184, 0.0136, 2, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 0 == len(value):\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L62_C6", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L61_C4", "vector": [13, 3, 0.4218, 0.0068, 3, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L63_C4", "label": "if", "type": "if", "loc": [63, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "vector": [4, 2, 0.4456, 0.0408, 2, 0.26, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \"=\" + urllib.quote(x, safe) for x in value])\n elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return varprefix + \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L64_C6", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L63_C4", "vector": [13, 3, 0.4354, 0.0068, 3, 0.58, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \"=\" + urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L65_C4", "label": "if", "type": "if", "loc": [65, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L63_C4", "vector": [4, 3, 0.4524, 0.0272, 3, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(x, safe) for x in value])\n else:\n return varprefix + \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L66_C6", "label": "return", "type": "return", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L65_C4", "vector": [13, 4, 0.449, 0.0068, 4, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L68_C6", "label": "return", "type": "return", "loc": [68, 68], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L65_C4", "vector": [13, 4, 0.4626, 0.0068, 4, 0.02, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varprefix + \",\".join([urllib.quote(x, safe) for x in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "label": "if", "type": "if", "loc": [69, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "vector": [4, 2, 0.5204, 0.1088, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif type(value) == type({}):\n if 0 == len(value):\n return \"\"\n keys = value.keys()\n keys.sort()\n if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L70_C4", "label": "if", "type": "if", "loc": [70, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "vector": [4, 3, 0.4796, 0.0136, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 0 == len(value):\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L71_C6", "label": "return", "type": "return", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L70_C4", "vector": [13, 4, 0.483, 0.0068, 4, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L72_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "vector": [14, 3, 0.4898, 0.0068, 3, 0.99, 0.25, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = value.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L73_C4", "label": "sort()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "vector": [8, 3, 0.4966, 0.0068, 3, 0.99, 0.5, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L74_C4", "label": "if", "type": "if", "loc": [74, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "vector": [4, 3, 0.5204, 0.0408, 3, 0.99, 0.75, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if explode == \"+\":\n return joiner.join([varname + \".\" + urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return varprefix + \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L75_C6", "label": "return", "type": "return", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L74_C4", "vector": [13, 4, 0.5102, 0.0068, 4, 0.99, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([varname + \".\" + urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L76_C4", "label": "if", "type": "if", "loc": [76, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L74_C4", "vector": [4, 4, 0.5272, 0.0272, 4, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif explode == \"*\":\n return joiner.join([urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])\n else:\n return varprefix + \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L77_C6", "label": "return", "type": "return", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L76_C4", "vector": [13, 5, 0.5238, 0.0068, 5, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return joiner.join([urllib.quote(key, safe) + \"=\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L79_C6", "label": "return", "type": "return", "loc": [79, 79], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L76_C4", "vector": [13, 5, 0.5374, 0.0068, 5, 0.54, 1.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varprefix + \",\".join([urllib.quote(key, safe) + \",\" + urllib.quote(value[key], safe) for key in keys])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L81_C4", "label": "if", "type": "if", "loc": [81, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "vector": [4, 3, 0.5612, 0.0272, 3, 0.99, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value:\n return varname + \"=\" + urllib.quote(value, safe)\n else:\n return varname "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L82_C6", "label": "return", "type": "return", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L81_C4", "vector": [13, 4, 0.5578, 0.0068, 4, 0.68, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varname + \"=\" + urllib.quote(value, safe)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L84_C6", "label": "return", "type": "return", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L81_C4", "vector": [13, 4, 0.5714, 0.0068, 4, 0.68, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return varname "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L86_C0", "label": "TOSTRING =", "type": "assigned_variable", "loc": [86, 93], "level": 0, "parent": null, "vector": [14, 0, 0.6088, 0.0544, 0, 0.66, 0.9167, 381, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "TOSTRING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TOSTRING = {\n \"\" : _tostring,\n \"+\": _tostring,\n \";\": _tostring_query,\n \"?\": _tostring_query,\n \"/\": _tostring_path,\n \".\": _tostring_path,\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L96_C0", "label": "expand", "type": "function", "loc": [96, 147], "level": 0, "parent": null, "vector": [2, 0, 0.8265, 0.3537, 0, 0.66, 1.0, 174, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "expand", "arg_names": ["template", "vars"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def expand(template, vars):\n def _sub(match):\n groupdict = match.groupdict()\n operator = groupdict.get('operator')\n if operator is None:\n operator = ''\n varlist = groupdict.get('varlist')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "label": "_sub", "type": "function", "loc": [97, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L96_C0", "vector": [2, 1, 0.8231, 0.3333, 1, 0.67, 0.0, 173, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "_sub", "arg_names": ["match"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _sub(match):\n groupdict = match.groupdict()\n operator = groupdict.get('operator')\n if operator is None:\n operator = ''\n varlist = groupdict.get('varlist')\n\n safe = \"@\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L98_C4", "label": "groupdict = groupdict()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.6667, 0.0068, 2, 0.41, 0.0, 572, 3, 0, 0, 0, 572, 10, 1], "semantic": {"name": "groupdict", "arg_names": [], "import_names": [], "rhs_call_name": "groupdict", "annotation": ""}, "snippet": " groupdict = match.groupdict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L99_C4", "label": "operator = get()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.6735, 0.0068, 2, 0.41, 0.0588, 616, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "operator", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " operator = groupdict.get('operator')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L100_C4", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [4, 2, 0.6837, 0.0136, 2, 0.41, 0.1176, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator is None:\n operator = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L101_C6", "label": "operator =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L100_C4", "vector": [14, 3, 0.6871, 0.0068, 3, 0.03, 0.0, 616, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " operator = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L102_C4", "label": "varlist = get()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.6939, 0.0068, 2, 0.41, 0.1765, 552, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "varlist", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " varlist = groupdict.get('varlist')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L104_C4", "label": "safe =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.7075, 0.0068, 2, 0.41, 0.2353, 3, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "safe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " safe = \"@\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L105_C4", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [4, 2, 0.7177, 0.0136, 2, 0.41, 0.2941, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == '+':\n safe = RESERVED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L106_C6", "label": "safe =", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L105_C4", "vector": [14, 3, 0.7211, 0.0068, 3, 0.54, 0.0, 3, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "safe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " safe = RESERVED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L107_C4", "label": "varspecs = split()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.7279, 0.0068, 2, 0.41, 0.3529, 988, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "varspecs", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " varspecs = varlist.split(\",\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L108_C4", "label": "varnames =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.7347, 0.0068, 2, 0.41, 0.4118, 728, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "varnames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " varnames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L109_C4", "label": "defaults =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.7415, 0.0068, 2, 0.41, 0.4706, 233, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "label": "for varspec", "type": "for", "loc": [110, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [6, 2, 0.7789, 0.068, 2, 0.41, 0.5294, 106, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "varspec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for varspec in varspecs:\n m = VAR.search(varspec)\n groupdict = m.groupdict()\n varname = groupdict.get('varname')\n explode = groupdict.get('explode')\n partial = groupdict.get('partial')\n default = groupdict.get('default')\n if default:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L111_C6", "label": "m = search()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [14, 3, 0.7551, 0.0068, 3, 0.37, 0.0, 711, 3, 1, 0, 0, 163, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " m = VAR.search(varspec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L112_C6", "label": "groupdict = groupdict()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [14, 3, 0.7619, 0.0068, 3, 0.37, 0.1429, 572, 3, 0, 0, 0, 572, 10, 1], "semantic": {"name": "groupdict", "arg_names": [], "import_names": [], "rhs_call_name": "groupdict", "annotation": ""}, "snippet": " groupdict = m.groupdict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L113_C6", "label": "varname = get()", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [14, 3, 0.7687, 0.0068, 3, 0.37, 0.2857, 769, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "varname", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " varname = groupdict.get('varname')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L114_C6", "label": "explode = get()", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [14, 3, 0.7755, 0.0068, 3, 0.37, 0.4286, 531, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "explode", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " explode = groupdict.get('explode')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L115_C6", "label": "partial = get()", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [14, 3, 0.7823, 0.0068, 3, 0.37, 0.5714, 365, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "partial", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " partial = groupdict.get('partial')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L116_C6", "label": "default = get()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [14, 3, 0.7891, 0.0068, 3, 0.37, 0.7143, 977, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "default", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " default = groupdict.get('default')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L117_C6", "label": "if", "type": "if", "loc": [117, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [4, 3, 0.7993, 0.0136, 3, 0.37, 0.8571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if default:\n defaults[varname] = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L118_C8", "label": "assign", "type": "assigned_variable", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L117_C6", "vector": [14, 4, 0.8027, 0.0068, 4, 0.28, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults[varname] = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L119_C6", "label": "append()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "vector": [8, 3, 0.8095, 0.0068, 3, 0.37, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " varnames.append((varname, explode, partial))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L121_C4", "label": "retval =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.8231, 0.0068, 2, 0.41, 0.5882, 991, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L122_C4", "label": "joiner =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.8299, 0.0068, 2, 0.41, 0.6471, 555, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L123_C4", "label": "prefix =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [14, 2, 0.8367, 0.0068, 2, 0.41, 0.7059, 284, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L124_C4", "label": "if", "type": "if", "loc": [124, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [4, 2, 0.8503, 0.0204, 2, 0.41, 0.7647, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"+\":\n prefix = \"\"\n joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L125_C6", "label": "prefix =", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L124_C4", "vector": [14, 3, 0.8503, 0.0068, 3, 0.8, 0.0, 284, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L126_C6", "label": "joiner =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L124_C4", "vector": [14, 3, 0.8571, 0.0068, 3, 0.8, 1.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L127_C4", "label": "if", "type": "if", "loc": [127, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [4, 2, 0.8673, 0.0136, 2, 0.41, 0.8235, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"?\":\n joiner = \"&\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L128_C6", "label": "joiner =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L127_C4", "vector": [14, 3, 0.8707, 0.0068, 3, 0.71, 0.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \"&\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L129_C4", "label": "if", "type": "if", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [4, 2, 0.881, 0.0136, 2, 0.41, 0.8824, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if operator == \"\":\n joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L130_C6", "label": "joiner =", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L129_C4", "vector": [14, 3, 0.8844, 0.0068, 3, 0.43, 0.0, 555, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joiner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joiner = \",\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L131_C4", "label": "for varname, explode, partial", "type": "for", "loc": [131, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [6, 2, 0.9252, 0.0748, 2, 0.41, 0.9412, 975, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "varname, explode, partial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for varname, explode, partial in varnames:\n if varname in vars:\n value = vars[varname]\n #if not value and (type(value) == type({}) or type(value) == type([])) and varname in defaults:\n if not value and value != \"\" and varname in defaults:\n value = defaults[varname]\n elif varname in defaults:\n value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "label": "if", "type": "if", "loc": [132, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L131_C4", "vector": [4, 3, 0.9252, 0.0612, 3, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if varname in vars:\n value = vars[varname]\n #if not value and (type(value) == type({}) or type(value) == type([])) and varname in defaults:\n if not value and value != \"\" and varname in defaults:\n value = defaults[varname]\n elif varname in defaults:\n value = defaults[varname]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L133_C8", "label": "value =", "type": "assigned_variable", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "vector": [14, 4, 0.9048, 0.0068, 4, 0.71, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = vars[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "vector": [4, 4, 0.9218, 0.0136, 4, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value and value != \"\" and varname in defaults:\n value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L136_C10", "label": "value =", "type": "assigned_variable", "loc": [136, 136], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L135_C8", "vector": [14, 5, 0.9252, 0.0068, 5, 0.15, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L137_C6", "label": "if", "type": "if", "loc": [137, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "vector": [4, 4, 0.9422, 0.0272, 4, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif varname in defaults:\n value = defaults[varname]\n else:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L138_C8", "label": "value =", "type": "assigned_variable", "loc": [138, 138], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L137_C6", "vector": [14, 5, 0.9388, 0.0068, 5, 0.69, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = defaults[varname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L141_C6", "label": "append()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L131_C4", "vector": [8, 3, 0.9592, 0.0068, 3, 0.39, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " retval.append(TOSTRING[operator](varname, value, explode, operator, safe=safe))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L142_C4", "label": "if", "type": "if", "loc": [142, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "vector": [4, 2, 0.9762, 0.0272, 2, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if \"\".join(retval):\n return prefix + joiner.join(retval)\n else:\n return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L143_C6", "label": "return", "type": "return", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L142_C4", "vector": [13, 3, 0.9728, 0.0068, 3, 0.46, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return prefix + joiner.join(retval)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L145_C6", "label": "return", "type": "return", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L142_C4", "vector": [13, 3, 0.9864, 0.0068, 3, 0.46, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L147_C2", "label": "return", "type": "return", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L96_C0", "vector": [13, 1, 1.0, 0.0068, 1, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return TEMPLATE.sub(_sub, template)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L16_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L18_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L23_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L25_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L19_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L34_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L36_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L38_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L32_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L43_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L47_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L50_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L52_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L57_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L64_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L66_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L68_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L60_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L71_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L75_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L77_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L79_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L82_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L84_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L101_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L106_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L113_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L114_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L115_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L116_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L117_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L117_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L119_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L125_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L126_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L128_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L130_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L136_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L132_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L137_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:For_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Expr_L141_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L97_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L143_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:If_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L145_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99189:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99189:Return_L147_C2"}] |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Module to enforce different constraints on flags.
A validator represents an invariant, enforced over a one or more flags.
See 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual.
"""
__author__ = 'olexiy@google.com (Olexiy Oryeshko)'
class Error(Exception):
"""Thrown If validator constraint is not satisfied."""
class Validator(object):
"""Base class for flags validators.
Users should NOT overload these classes, and use gflags.Register...
methods instead.
"""
# Used to assign each validator an unique insertion_index
validators_count = 0
def __init__(self, checker, message):
"""Constructor to create all validators.
Args:
checker: function to verify the constraint.
Input of this method varies, see SimpleValidator and
DictionaryValidator for a detailed description.
message: string, error message to be shown to the user
"""
self.checker = checker
self.message = message
Validator.validators_count += 1
# Used to assert validators in the order they were registered (CL/18694236)
self.insertion_index = Validator.validators_count
def Verify(self, flag_values):
"""Verify that constraint is satisfied.
flags library calls this method to verify Validator's constraint.
Args:
flag_values: gflags.FlagValues, containing all flags
Raises:
Error: if constraint is not satisfied.
"""
param = self._GetInputToCheckerFunction(flag_values)
if not self.checker(param):
raise Error(self.message)
def GetFlagsNames(self):
"""Return the names of the flags checked by this validator.
Returns:
[string], names of the flags
"""
raise NotImplementedError('This method should be overloaded')
def PrintFlagsWithValues(self, flag_values):
raise NotImplementedError('This method should be overloaded')
def _GetInputToCheckerFunction(self, flag_values):
"""Given flag values, construct the input to be given to checker.
Args:
flag_values: gflags.FlagValues, containing all flags.
Returns:
Return type depends on the specific validator.
"""
raise NotImplementedError('This method should be overloaded')
class SimpleValidator(Validator):
"""Validator behind RegisterValidator() method.
Validates that a single flag passes its checker function. The checker function
takes the flag value and returns True (if value looks fine) or, if flag value
is not valid, either returns False or raises an Exception."""
def __init__(self, flag_name, checker, message):
"""Constructor.
Args:
flag_name: string, name of the flag.
checker: function to verify the validator.
input - value of the corresponding flag (string, boolean, etc).
output - Boolean. Must return True if validator constraint is satisfied.
If constraint is not satisfied, it should either return False or
raise Error.
message: string, error message to be shown to the user if validator's
condition is not satisfied
"""
super(SimpleValidator, self).__init__(checker, message)
self.flag_name = flag_name
def GetFlagsNames(self):
return [self.flag_name]
def PrintFlagsWithValues(self, flag_values):
return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value)
def _GetInputToCheckerFunction(self, flag_values):
"""Given flag values, construct the input to be given to checker.
Args:
flag_values: gflags.FlagValues
Returns:
value of the corresponding flag.
"""
return flag_values[self.flag_name].value
class DictionaryValidator(Validator):
"""Validator behind RegisterDictionaryValidator method.
Validates that flag values pass their common checker function. The checker
function takes flag values and returns True (if values look fine) or,
if values are not valid, either returns False or raises an Exception.
"""
def __init__(self, flag_names, checker, message):
"""Constructor.
Args:
flag_names: [string], containing names of the flags used by checker.
checker: function to verify the validator.
input - dictionary, with keys() being flag_names, and value for each
key being the value of the corresponding flag (string, boolean, etc).
output - Boolean. Must return True if validator constraint is satisfied.
If constraint is not satisfied, it should either return False or
raise Error.
message: string, error message to be shown to the user if validator's
condition is not satisfied
"""
super(DictionaryValidator, self).__init__(checker, message)
self.flag_names = flag_names
def _GetInputToCheckerFunction(self, flag_values):
"""Given flag values, construct the input to be given to checker.
Args:
flag_values: gflags.FlagValues
Returns:
dictionary, with keys() being self.lag_names, and value for each key
being the value of the corresponding flag (string, boolean, etc).
"""
return dict([key, flag_values[key].value] for key in self.flag_names)
def PrintFlagsWithValues(self, flag_values):
prefix = 'flags '
flags_with_values = []
for key in self.flag_names:
flags_with_values.append('%s=%s' % (key, flag_values[key].value))
return prefix + ', '.join(flags_with_values)
def GetFlagsNames(self):
return self.flag_names
| ajibawa-2023/Python-Code-Large/train/row_99190 | 51 | 187 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L32_C0", "label": "expression", "type": "expression", "loc": [32, 36], "level": 0, "parent": null, "vector": [8, 0, 0.1818, 0.0267, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Module to enforce different constraints on flags.\n\nA validator represents an invariant, enforced over a one or more flags.\nSee 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L38_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.2032, 0.0053, 0, 0.66, 0.2, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'olexiy@google.com (Olexiy Oryeshko)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L41_C0", "label": "Error", "type": "class", "loc": [41, 42], "level": 0, "parent": null, "vector": [3, 0, 0.2219, 0.0107, 0, 0.66, 0.4, 529, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Error(Exception):\n \"\"\"Thrown If validator constraint is not satisfied.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L42_C2", "label": "expression", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L41_C0", "vector": [8, 1, 0.2246, 0.0053, 1, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Thrown If validator constraint is not satisfied.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "label": "Validator", "type": "class", "loc": [45, 102], "level": 0, "parent": null, "vector": [3, 0, 0.393, 0.3102, 0, 0.66, 0.6, 957, 0, 5, 0, 0, 186, 0, 6], "semantic": {"name": "Validator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Validator(object):\n \"\"\"Base class for flags validators.\n\n Users should NOT overload these classes, and use gflags.Register...\n methods instead.\n \"\"\"\n\n # Used to assign each validator an unique insertion_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L46_C2", "label": "expression", "type": "expression", "loc": [46, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [8, 1, 0.2567, 0.0267, 1, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for flags validators.\n\n Users should NOT overload these classes, and use gflags.Register...\n methods instead.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L53_C2", "label": "validators_count =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [14, 1, 0.2834, 0.0053, 1, 0.48, 0.1667, 986, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "validators_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " validators_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "label": "__init__", "type": "function", "loc": [55, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [2, 1, 0.3289, 0.0749, 1, 0.48, 0.3333, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "checker", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, checker, message):\n \"\"\"Constructor to create all validators.\n\n Args:\n checker: function to verify the constraint.\n Input of this method varies, see SimpleValidator and\n DictionaryValidator for a detailed description.\n message: string, error message to be shown to the user"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L56_C4", "label": "expression", "type": "expression", "loc": [56, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "vector": [8, 2, 0.3182, 0.0428, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor to create all validators.\n\n Args:\n checker: function to verify the constraint.\n Input of this method varies, see SimpleValidator and\n DictionaryValidator for a detailed description.\n message: string, error message to be shown to the user\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L64_C4", "label": "self.checker =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "vector": [14, 2, 0.3422, 0.0053, 2, 0.4, 0.3333, 563, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.checker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.checker = checker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L65_C4", "label": "self.message =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "vector": [14, 2, 0.3476, 0.0053, 2, 0.4, 0.6667, 709, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L68_C4", "label": "self.insertion_index =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "vector": [14, 2, 0.3636, 0.0053, 2, 0.4, 1.0, 860, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.insertion_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.insertion_index = Validator.validators_count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "label": "Verify", "type": "function", "loc": [70, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [2, 1, 0.4037, 0.0642, 1, 0.48, 0.5, 865, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "Verify", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def Verify(self, flag_values):\n \"\"\"Verify that constraint is satisfied.\n\n flags library calls this method to verify Validator's constraint.\n Args:\n flag_values: gflags.FlagValues, containing all flags\n Raises:\n Error: if constraint is not satisfied."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L71_C4", "label": "expression", "type": "expression", "loc": [71, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "vector": [8, 2, 0.3984, 0.0428, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Verify that constraint is satisfied.\n\n flags library calls this method to verify Validator's constraint.\n Args:\n flag_values: gflags.FlagValues, containing all flags\n Raises:\n Error: if constraint is not satisfied.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L79_C4", "label": "param = _GetInputToCheckerFunction()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "vector": [14, 2, 0.4225, 0.0053, 2, 0.57, 0.5, 841, 3, 1, 0, 0, 382, 10, 1], "semantic": {"name": "param", "arg_names": [], "import_names": [], "rhs_call_name": "_GetInputToCheckerFunction", "annotation": ""}, "snippet": " param = self._GetInputToCheckerFunction(flag_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:If_L80_C4", "label": "if", "type": "if", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "vector": [4, 2, 0.4305, 0.0107, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.checker(param):\n raise Error(self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L83_C2", "label": "GetFlagsNames", "type": "function", "loc": [83, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [2, 1, 0.4599, 0.0374, 1, 0.48, 0.6667, 150, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "GetFlagsNames", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetFlagsNames(self):\n \"\"\"Return the names of the flags checked by this validator.\n\n Returns:\n [string], names of the flags\n \"\"\"\n raise NotImplementedError('This method should be overloaded')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L84_C4", "label": "expression", "type": "expression", "loc": [84, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L83_C2", "vector": [8, 2, 0.4599, 0.0267, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Return the names of the flags checked by this validator.\n\n Returns:\n [string], names of the flags\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L91_C2", "label": "PrintFlagsWithValues", "type": "function", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [2, 1, 0.4893, 0.0107, 1, 0.48, 0.8333, 379, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "PrintFlagsWithValues", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def PrintFlagsWithValues(self, flag_values):\n raise NotImplementedError('This method should be overloaded')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L94_C2", "label": "_GetInputToCheckerFunction", "type": "function", "loc": [94, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "vector": [2, 1, 0.5241, 0.0481, 1, 0.48, 1.0, 382, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_GetInputToCheckerFunction", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _GetInputToCheckerFunction(self, flag_values):\n \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues, containing all flags.\n Returns:\n Return type depends on the specific validator.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L95_C4", "label": "expression", "type": "expression", "loc": [95, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L94_C2", "vector": [8, 2, 0.5241, 0.0374, 2, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues, containing all flags.\n Returns:\n Return type depends on the specific validator.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "label": "SimpleValidator", "type": "class", "loc": [105, 141], "level": 0, "parent": null, "vector": [3, 0, 0.6578, 0.1979, 0, 0.66, 0.8, 334, 0, 4, 0, 0, 957, 0, 2], "semantic": {"name": "SimpleValidator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleValidator(Validator):\n \"\"\"Validator behind RegisterValidator() method.\n\n Validates that a single flag passes its checker function. The checker function\n takes the flag value and returns True (if value looks fine) or, if flag value\n is not valid, either returns False or raises an Exception.\"\"\"\n def __init__(self, flag_name, checker, message):\n \"\"\"Constructor."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L106_C2", "label": "expression", "type": "expression", "loc": [106, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "vector": [8, 1, 0.5775, 0.0267, 1, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Validator behind RegisterValidator() method.\n\n Validates that a single flag passes its checker function. The checker function\n takes the flag value and returns True (if value looks fine) or, if flag value\n is not valid, either returns False or raises an Exception.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "label": "__init__", "type": "function", "loc": [111, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "vector": [2, 1, 0.631, 0.0802, 1, 0.58, 0.25, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "flag_name", "checker", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, flag_name, checker, message):\n \"\"\"Constructor.\n\n Args:\n flag_name: string, name of the flag.\n checker: function to verify the validator.\n input - value of the corresponding flag (string, boolean, etc).\n output - Boolean. Must return True if validator constraint is satisfied."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L112_C4", "label": "expression", "type": "expression", "loc": [112, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "vector": [8, 2, 0.6283, 0.0642, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n flag_name: string, name of the flag.\n checker: function to verify the validator.\n input - value of the corresponding flag (string, boolean, etc).\n output - Boolean. Must return True if validator constraint is satisfied.\n If constraint is not satisfied, it should either return False or"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L124_C4", "label": "__init__()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "vector": [8, 2, 0.6631, 0.0053, 2, 0.61, 0.5, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(SimpleValidator, self).__init__(checker, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L125_C4", "label": "self.flag_name =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "vector": [14, 2, 0.6684, 0.0053, 2, 0.61, 1.0, 231, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.flag_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flag_name = flag_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L127_C2", "label": "GetFlagsNames", "type": "function", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "vector": [2, 1, 0.6818, 0.0107, 1, 0.58, 0.5, 150, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "GetFlagsNames", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetFlagsNames(self):\n return [self.flag_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L128_C4", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L127_C2", "vector": [13, 2, 0.6845, 0.0053, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self.flag_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L130_C2", "label": "PrintFlagsWithValues", "type": "function", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "vector": [2, 1, 0.6979, 0.0107, 1, 0.58, 0.75, 379, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "PrintFlagsWithValues", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def PrintFlagsWithValues(self, flag_values):\n return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L131_C4", "label": "return", "type": "return", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L130_C2", "vector": [13, 2, 0.7005, 0.0053, 2, 0.23, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L133_C2", "label": "_GetInputToCheckerFunction", "type": "function", "loc": [133, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "vector": [2, 1, 0.7326, 0.0481, 1, 0.58, 1.0, 382, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_GetInputToCheckerFunction", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _GetInputToCheckerFunction(self, flag_values):\n \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n value of the corresponding flag.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L134_C4", "label": "expression", "type": "expression", "loc": [134, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L133_C2", "vector": [8, 2, 0.7326, 0.0374, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n value of the corresponding flag.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L141_C4", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L133_C2", "vector": [13, 2, 0.754, 0.0053, 2, 0.21, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return flag_values[self.flag_name].value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "label": "DictionaryValidator", "type": "class", "loc": [144, 187], "level": 0, "parent": null, "vector": [3, 0, 0.885, 0.2353, 0, 0.66, 1.0, 971, 0, 4, 0, 0, 957, 0, 5], "semantic": {"name": "DictionaryValidator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DictionaryValidator(Validator):\n \"\"\"Validator behind RegisterDictionaryValidator method.\n\n Validates that flag values pass their common checker function. The checker\n function takes flag values and returns True (if values look fine) or,\n if values are not valid, either returns False or raises an Exception.\n \"\"\"\n def __init__(self, flag_names, checker, message):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L145_C2", "label": "expression", "type": "expression", "loc": [145, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "vector": [8, 1, 0.7888, 0.0321, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Validator behind RegisterDictionaryValidator method.\n\n Validates that flag values pass their common checker function. The checker\n function takes flag values and returns True (if values look fine) or,\n if values are not valid, either returns False or raises an Exception.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "label": "__init__", "type": "function", "loc": [151, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "vector": [2, 1, 0.8476, 0.0856, 1, 0.14, 0.25, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "flag_names", "checker", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, flag_names, checker, message):\n \"\"\"Constructor.\n\n Args:\n flag_names: [string], containing names of the flags used by checker.\n checker: function to verify the validator.\n input - dictionary, with keys() being flag_names, and value for each\n key being the value of the corresponding flag (string, boolean, etc)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L152_C4", "label": "expression", "type": "expression", "loc": [152, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "vector": [8, 2, 0.8449, 0.0695, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructor.\n\n Args:\n flag_names: [string], containing names of the flags used by checker.\n checker: function to verify the validator.\n input - dictionary, with keys() being flag_names, and value for each\n key being the value of the corresponding flag (string, boolean, etc).\n output - Boolean. Must return True if validator constraint is satisfied."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L165_C4", "label": "__init__()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "vector": [8, 2, 0.8824, 0.0053, 2, 0.37, 0.5, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(DictionaryValidator, self).__init__(checker, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L166_C4", "label": "self.flag_names =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "vector": [14, 2, 0.8877, 0.0053, 2, 0.37, 1.0, 268, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.flag_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.flag_names = flag_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L168_C2", "label": "_GetInputToCheckerFunction", "type": "function", "loc": [168, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "vector": [2, 1, 0.9225, 0.0535, 1, 0.14, 0.5, 382, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_GetInputToCheckerFunction", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _GetInputToCheckerFunction(self, flag_values):\n \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n dictionary, with keys() being self.lag_names, and value for each key\n being the value of the corresponding flag (string, boolean, etc)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L169_C4", "label": "expression", "type": "expression", "loc": [169, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L168_C2", "vector": [8, 2, 0.9225, 0.0428, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Given flag values, construct the input to be given to checker.\n\n Args:\n flag_values: gflags.FlagValues\n Returns:\n dictionary, with keys() being self.lag_names, and value for each key\n being the value of the corresponding flag (string, boolean, etc).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L177_C4", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L168_C2", "vector": [13, 2, 0.9465, 0.0053, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict([key, flag_values[key].value] for key in self.flag_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "label": "PrintFlagsWithValues", "type": "function", "loc": [179, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "vector": [2, 1, 0.9706, 0.0321, 1, 0.14, 0.75, 379, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "PrintFlagsWithValues", "arg_names": ["self", "flag_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def PrintFlagsWithValues(self, flag_values):\n prefix = 'flags '\n flags_with_values = []\n for key in self.flag_names:\n flags_with_values.append('%s=%s' % (key, flag_values[key].value))\n return prefix + ', '.join(flags_with_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L180_C4", "label": "prefix =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "vector": [14, 2, 0.9626, 0.0053, 2, 0.76, 0.0, 284, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = 'flags '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L181_C4", "label": "flags_with_values =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "vector": [14, 2, 0.9679, 0.0053, 2, 0.76, 0.3333, 533, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "flags_with_values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " flags_with_values = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:For_L182_C4", "label": "for key", "type": "for", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "vector": [6, 2, 0.9759, 0.0107, 2, 0.76, 0.6667, 230, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key in self.flag_names:\n flags_with_values.append('%s=%s' % (key, flag_values[key].value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L183_C6", "label": "append()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:For_L182_C4", "vector": [8, 3, 0.9786, 0.0053, 3, 0.46, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " flags_with_values.append('%s=%s' % (key, flag_values[key].value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L184_C4", "label": "return", "type": "return", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "vector": [13, 2, 0.984, 0.0053, 2, 0.76, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return prefix + ', '.join(flags_with_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L186_C2", "label": "GetFlagsNames", "type": "function", "loc": [186, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "vector": [2, 1, 0.9973, 0.0107, 1, 0.14, 1.0, 150, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "GetFlagsNames", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def GetFlagsNames(self):\n return self.flag_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L187_C4", "label": "return", "type": "return", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L186_C2", "vector": [13, 2, 1.0, 0.0053, 2, 0.04, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.flag_names"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L94_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L111_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L127_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L127_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L130_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L130_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L133_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L133_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L145_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:For_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:For_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Expr_L183_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L179_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:ClassDef_L144_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99190:FunctionDef_L186_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99190:Return_L187_C4"}] |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of Dan Haim nor the names of his contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMANGE.
This module provides a standard socket-like interface for Python
for tunneling connections through SOCKS proxies.
"""
"""
Minor modifications made by Christopher Gilbert (http://motomastyle.com/)
for use in PyLoris (http://pyloris.sourceforge.net/)
Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)
mainly to merge bug fixes found in Sourceforge
"""
import base64
import socket
import struct
import sys
if getattr(socket, 'socket', None) is None:
raise ImportError('socket.socket missing, proxy support unusable')
PROXY_TYPE_SOCKS4 = 1
PROXY_TYPE_SOCKS5 = 2
PROXY_TYPE_HTTP = 3
PROXY_TYPE_HTTP_NO_TUNNEL = 4
_defaultproxy = None
_orgsocket = socket.socket
class ProxyError(Exception): pass
class GeneralProxyError(ProxyError): pass
class Socks5AuthError(ProxyError): pass
class Socks5Error(ProxyError): pass
class Socks4Error(ProxyError): pass
class HTTPError(ProxyError): pass
_generalerrors = ("success",
"invalid data",
"not connected",
"not available",
"bad proxy type",
"bad input")
_socks5errors = ("succeeded",
"general SOCKS server failure",
"connection not allowed by ruleset",
"Network unreachable",
"Host unreachable",
"Connection refused",
"TTL expired",
"Command not supported",
"Address type not supported",
"Unknown error")
_socks5autherrors = ("succeeded",
"authentication is required",
"all offered authentication methods were rejected",
"unknown username or invalid password",
"unknown error")
_socks4errors = ("request granted",
"request rejected or failed",
"request rejected because SOCKS server cannot connect to identd on the client",
"request rejected because the client program and identd report different user-ids",
"unknown error")
def setdefaultproxy(proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):
"""setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
Sets a default proxy which all further socksocket objects will use,
unless explicitly changed.
"""
global _defaultproxy
_defaultproxy = (proxytype, addr, port, rdns, username, password)
def wrapmodule(module):
"""wrapmodule(module)
Attempts to replace a module's socket library with a SOCKS socket. Must set
a default proxy using setdefaultproxy(...) first.
This will only work on modules that import socket directly into the namespace;
most of the Python Standard Library falls into this category.
"""
if _defaultproxy != None:
module.socket.socket = socksocket
else:
raise GeneralProxyError((4, "no proxy specified"))
class socksocket(socket.socket):
"""socksocket([family[, type[, proto]]]) -> socket object
Open a SOCKS enabled socket. The parameters are the same as
those of the standard socket init. In order for SOCKS to work,
you must specify family=AF_INET, type=SOCK_STREAM and proto=0.
"""
def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):
_orgsocket.__init__(self, family, type, proto, _sock)
if _defaultproxy != None:
self.__proxy = _defaultproxy
else:
self.__proxy = (None, None, None, None, None, None)
self.__proxysockname = None
self.__proxypeername = None
self.__httptunnel = True
def __recvall(self, count):
"""__recvall(count) -> data
Receive EXACTLY the number of bytes requested from the socket.
Blocks until the required number of bytes have been received.
"""
data = self.recv(count)
while len(data) < count:
d = self.recv(count-len(data))
if not d: raise GeneralProxyError((0, "connection closed unexpectedly"))
data = data + d
return data
def sendall(self, content, *args):
""" override socket.socket.sendall method to rewrite the header
for non-tunneling proxies if needed
"""
if not self.__httptunnel:
content = self.__rewriteproxy(content)
return super(socksocket, self).sendall(content, *args)
def __rewriteproxy(self, header):
""" rewrite HTTP request headers to support non-tunneling proxies
(i.e. those which do not support the CONNECT method).
This only works for HTTP (not HTTPS) since HTTPS requires tunneling.
"""
host, endpt = None, None
hdrs = header.split("\r\n")
for hdr in hdrs:
if hdr.lower().startswith("host:"):
host = hdr
elif hdr.lower().startswith("get") or hdr.lower().startswith("post"):
endpt = hdr
if host and endpt:
hdrs.remove(host)
hdrs.remove(endpt)
host = host.split(" ")[1]
endpt = endpt.split(" ")
if (self.__proxy[4] != None and self.__proxy[5] != None):
hdrs.insert(0, self.__getauthheader())
hdrs.insert(0, "Host: %s" % host)
hdrs.insert(0, "%s http://%s%s %s" % (endpt[0], host, endpt[1], endpt[2]))
return "\r\n".join(hdrs)
def __getauthheader(self):
auth = self.__proxy[4] + ":" + self.__proxy[5]
return "Proxy-Authorization: Basic " + base64.b64encode(auth)
def setproxy(self, proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):
"""setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
Sets the proxy to be used.
proxytype - The type of the proxy to be used. Three types
are supported: PROXY_TYPE_SOCKS4 (including socks4a),
PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP
addr - The address of the server (IP or DNS).
port - The port of the server. Defaults to 1080 for SOCKS
servers and 8080 for HTTP proxy servers.
rdns - Should DNS queries be preformed on the remote side
(rather than the local side). The default is True.
Note: This has no effect with SOCKS4 servers.
username - Username to authenticate with to the server.
The default is no authentication.
password - Password to authenticate with to the server.
Only relevant when username is also provided.
"""
self.__proxy = (proxytype, addr, port, rdns, username, password)
def __negotiatesocks5(self, destaddr, destport):
"""__negotiatesocks5(self,destaddr,destport)
Negotiates a connection through a SOCKS5 server.
"""
# First we'll send the authentication packages we support.
if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):
# The username/password details were supplied to the
# setproxy method so we support the USERNAME/PASSWORD
# authentication (in addition to the standard none).
self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02))
else:
# No username/password were entered, therefore we
# only support connections with no authentication.
self.sendall(struct.pack('BBB', 0x05, 0x01, 0x00))
# We'll receive the server's response to determine which
# method was selected
chosenauth = self.__recvall(2)
if chosenauth[0:1] != chr(0x05).encode():
self.close()
raise GeneralProxyError((1, _generalerrors[1]))
# Check the chosen authentication method
if chosenauth[1:2] == chr(0x00).encode():
# No authentication is required
pass
elif chosenauth[1:2] == chr(0x02).encode():
# Okay, we need to perform a basic username/password
# authentication.
self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])
authstat = self.__recvall(2)
if authstat[0:1] != chr(0x01).encode():
# Bad response
self.close()
raise GeneralProxyError((1, _generalerrors[1]))
if authstat[1:2] != chr(0x00).encode():
# Authentication failed
self.close()
raise Socks5AuthError((3, _socks5autherrors[3]))
# Authentication succeeded
else:
# Reaching here is always bad
self.close()
if chosenauth[1] == chr(0xFF).encode():
raise Socks5AuthError((2, _socks5autherrors[2]))
else:
raise GeneralProxyError((1, _generalerrors[1]))
# Now we can request the actual connection
req = struct.pack('BBB', 0x05, 0x01, 0x00)
# If the given destination address is an IP address, we'll
# use the IPv4 address request even if remote resolving was specified.
try:
ipaddr = socket.inet_aton(destaddr)
req = req + chr(0x01).encode() + ipaddr
except socket.error:
# Well it's not an IP number, so it's probably a DNS name.
if self.__proxy[3]:
# Resolve remotely
ipaddr = None
req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr
else:
# Resolve locally
ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))
req = req + chr(0x01).encode() + ipaddr
req = req + struct.pack(">H", destport)
self.sendall(req)
# Get the response
resp = self.__recvall(4)
if resp[0:1] != chr(0x05).encode():
self.close()
raise GeneralProxyError((1, _generalerrors[1]))
elif resp[1:2] != chr(0x00).encode():
# Connection failed
self.close()
if ord(resp[1:2])<=8:
raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))
else:
raise Socks5Error((9, _socks5errors[9]))
# Get the bound address/port
elif resp[3:4] == chr(0x01).encode():
boundaddr = self.__recvall(4)
elif resp[3:4] == chr(0x03).encode():
resp = resp + self.recv(1)
boundaddr = self.__recvall(ord(resp[4:5]))
else:
self.close()
raise GeneralProxyError((1,_generalerrors[1]))
boundport = struct.unpack(">H", self.__recvall(2))[0]
self.__proxysockname = (boundaddr, boundport)
if ipaddr != None:
self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)
else:
self.__proxypeername = (destaddr, destport)
def getproxysockname(self):
"""getsockname() -> address info
Returns the bound IP address and port number at the proxy.
"""
return self.__proxysockname
def getproxypeername(self):
"""getproxypeername() -> address info
Returns the IP and port number of the proxy.
"""
return _orgsocket.getpeername(self)
def getpeername(self):
"""getpeername() -> address info
Returns the IP address and port number of the destination
machine (note: getproxypeername returns the proxy)
"""
return self.__proxypeername
def __negotiatesocks4(self,destaddr,destport):
"""__negotiatesocks4(self,destaddr,destport)
Negotiates a connection through a SOCKS4 server.
"""
# Check if the destination address provided is an IP address
rmtrslv = False
try:
ipaddr = socket.inet_aton(destaddr)
except socket.error:
# It's a DNS name. Check where it should be resolved.
if self.__proxy[3]:
ipaddr = struct.pack("BBBB", 0x00, 0x00, 0x00, 0x01)
rmtrslv = True
else:
ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))
# Construct the request packet
req = struct.pack(">BBH", 0x04, 0x01, destport) + ipaddr
# The username parameter is considered userid for SOCKS4
if self.__proxy[4] != None:
req = req + self.__proxy[4]
req = req + chr(0x00).encode()
# DNS name if remote resolving is required
# NOTE: This is actually an extension to the SOCKS4 protocol
# called SOCKS4A and may not be supported in all cases.
if rmtrslv:
req = req + destaddr + chr(0x00).encode()
self.sendall(req)
# Get the response from the server
resp = self.__recvall(8)
if resp[0:1] != chr(0x00).encode():
# Bad data
self.close()
raise GeneralProxyError((1,_generalerrors[1]))
if resp[1:2] != chr(0x5A).encode():
# Server returned an error
self.close()
if ord(resp[1:2]) in (91, 92, 93):
self.close()
raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))
else:
raise Socks4Error((94, _socks4errors[4]))
# Get the bound address/port
self.__proxysockname = (socket.inet_ntoa(resp[4:]), struct.unpack(">H", resp[2:4])[0])
if rmtrslv != None:
self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)
else:
self.__proxypeername = (destaddr, destport)
def __negotiatehttp(self, destaddr, destport):
"""__negotiatehttp(self,destaddr,destport)
Negotiates a connection through an HTTP server.
"""
# If we need to resolve locally, we do this now
if not self.__proxy[3]:
addr = socket.gethostbyname(destaddr)
else:
addr = destaddr
headers = ["CONNECT ", addr, ":", str(destport), " HTTP/1.1\r\n"]
headers += ["Host: ", destaddr, "\r\n"]
if (self.__proxy[4] != None and self.__proxy[5] != None):
headers += [self.__getauthheader(), "\r\n"]
headers.append("\r\n")
self.sendall("".join(headers).encode())
# We read the response until we get the string "\r\n\r\n"
resp = self.recv(1)
while resp.find("\r\n\r\n".encode()) == -1:
resp = resp + self.recv(1)
# We just need the first line to check if the connection
# was successful
statusline = resp.splitlines()[0].split(" ".encode(), 2)
if statusline[0] not in ("HTTP/1.0".encode(), "HTTP/1.1".encode()):
self.close()
raise GeneralProxyError((1, _generalerrors[1]))
try:
statuscode = int(statusline[1])
except ValueError:
self.close()
raise GeneralProxyError((1, _generalerrors[1]))
if statuscode != 200:
self.close()
raise HTTPError((statuscode, statusline[2]))
self.__proxysockname = ("0.0.0.0", 0)
self.__proxypeername = (addr, destport)
def connect(self, destpair):
"""connect(self, despair)
Connects to the specified destination through a proxy.
destpar - A tuple of the IP/DNS address and the port number.
(identical to socket's connect).
To select the proxy server use setproxy().
"""
# Do a minimal input check first
if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (type(destpair[0]) != type('')) or (type(destpair[1]) != int):
raise GeneralProxyError((5, _generalerrors[5]))
if self.__proxy[0] == PROXY_TYPE_SOCKS5:
if self.__proxy[2] != None:
portnum = self.__proxy[2]
else:
portnum = 1080
_orgsocket.connect(self, (self.__proxy[1], portnum))
self.__negotiatesocks5(destpair[0], destpair[1])
elif self.__proxy[0] == PROXY_TYPE_SOCKS4:
if self.__proxy[2] != None:
portnum = self.__proxy[2]
else:
portnum = 1080
_orgsocket.connect(self,(self.__proxy[1], portnum))
self.__negotiatesocks4(destpair[0], destpair[1])
elif self.__proxy[0] == PROXY_TYPE_HTTP:
if self.__proxy[2] != None:
portnum = self.__proxy[2]
else:
portnum = 8080
_orgsocket.connect(self,(self.__proxy[1], portnum))
self.__negotiatehttp(destpair[0], destpair[1])
elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:
if self.__proxy[2] != None:
portnum = self.__proxy[2]
else:
portnum = 8080
_orgsocket.connect(self,(self.__proxy[1],portnum))
if destpair[1] == 443:
self.__negotiatehttp(destpair[0],destpair[1])
else:
self.__httptunnel = False
elif self.__proxy[0] == None:
_orgsocket.connect(self, (destpair[0], destpair[1]))
else:
raise GeneralProxyError((4, _generalerrors[4]))
| ajibawa-2023/Python-Code-Large/train/row_99191 | 213 | 438 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 31], "level": 0, "parent": null, "vector": [8, 0, 0.0365, 0.0708, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"SocksiPy - Python SOCKS module.\nVersion 1.00\n\nCopyright 2006 Dan-Haim. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright notice, this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L33_C0", "label": "expression", "type": "expression", "loc": [33, 41], "level": 0, "parent": null, "vector": [8, 0, 0.0845, 0.0205, 0, 0.66, 0.04, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\n\nMinor modifications made by Christopher Gilbert (http://motomastyle.com/)\nfor use in PyLoris (http://pyloris.sourceforge.net/)\n\nMinor modifications made by Mario Vilas (http://breakingcode.wordpress.com/)\nmainly to merge bug fixes found in Sourceforge\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Import_L43_C0", "label": "base64 import base64", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0982, 0.0023, 0, 0.66, 0.08, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Import_L44_C0", "label": "socket import socket", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1005, 0.0023, 0, 0.66, 0.12, 687, 0, 1, 0, 0, 687, 0, 0], "semantic": {"name": "socket", "arg_names": [], "import_names": ["socket"], "rhs_call_name": "", "annotation": ""}, "snippet": "import socket"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Import_L45_C0", "label": "struct import struct", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.1027, 0.0023, 0, 0.66, 0.16, 399, 0, 1, 0, 0, 399, 0, 0], "semantic": {"name": "struct", "arg_names": [], "import_names": ["struct"], "rhs_call_name": "", "annotation": ""}, "snippet": "import struct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Import_L46_C0", "label": "sys import sys", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.105, 0.0023, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L48_C0", "label": "if", "type": "if", "loc": [48, 49], "level": 0, "parent": null, "vector": [4, 0, 0.1107, 0.0046, 0, 0.66, 0.24, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if getattr(socket, 'socket', None) is None:\n raise ImportError('socket.socket missing, proxy support unusable')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L51_C0", "label": "PROXY_TYPE_SOCKS4 =", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.1164, 0.0023, 0, 0.66, 0.28, 737, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_SOCKS4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_SOCKS4 = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L52_C0", "label": "PROXY_TYPE_SOCKS5 =", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.1187, 0.0023, 0, 0.66, 0.32, 842, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_SOCKS5", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_SOCKS5 = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L53_C0", "label": "PROXY_TYPE_HTTP =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.121, 0.0023, 0, 0.66, 0.36, 9, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_HTTP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_HTTP = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L54_C0", "label": "PROXY_TYPE_HTTP_NO_TUNNEL =", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.1233, 0.0023, 0, 0.66, 0.4, 308, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROXY_TYPE_HTTP_NO_TUNNEL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROXY_TYPE_HTTP_NO_TUNNEL = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L56_C0", "label": "_defaultproxy =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.1279, 0.0023, 0, 0.66, 0.44, 940, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "_defaultproxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_defaultproxy = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L57_C0", "label": "_orgsocket =", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.1301, 0.0023, 0, 0.66, 0.48, 134, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_orgsocket", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_orgsocket = socket.socket"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L59_C0", "label": "ProxyError", "type": "class", "loc": [59, 59], "level": 0, "parent": null, "vector": [3, 0, 0.1347, 0.0023, 0, 0.66, 0.52, 576, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ProxyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ProxyError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L60_C0", "label": "GeneralProxyError", "type": "class", "loc": [60, 60], "level": 0, "parent": null, "vector": [3, 0, 0.137, 0.0023, 0, 0.66, 0.56, 185, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "GeneralProxyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class GeneralProxyError(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L61_C0", "label": "Socks5AuthError", "type": "class", "loc": [61, 61], "level": 0, "parent": null, "vector": [3, 0, 0.1393, 0.0023, 0, 0.66, 0.6, 18, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "Socks5AuthError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Socks5AuthError(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L62_C0", "label": "Socks5Error", "type": "class", "loc": [62, 62], "level": 0, "parent": null, "vector": [3, 0, 0.1416, 0.0023, 0, 0.66, 0.64, 546, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "Socks5Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Socks5Error(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L63_C0", "label": "Socks4Error", "type": "class", "loc": [63, 63], "level": 0, "parent": null, "vector": [3, 0, 0.1438, 0.0023, 0, 0.66, 0.68, 446, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "Socks4Error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Socks4Error(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L64_C0", "label": "HTTPError", "type": "class", "loc": [64, 64], "level": 0, "parent": null, "vector": [3, 0, 0.1461, 0.0023, 0, 0.66, 0.72, 880, 0, 0, 0, 0, 576, 0, 0], "semantic": {"name": "HTTPError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HTTPError(ProxyError): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L66_C0", "label": "_generalerrors =", "type": "assigned_variable", "loc": [66, 71], "level": 0, "parent": null, "vector": [14, 0, 0.1564, 0.0137, 0, 0.66, 0.76, 243, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_generalerrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_generalerrors = (\"success\",\n \"invalid data\",\n \"not connected\",\n \"not available\",\n \"bad proxy type\",\n \"bad input\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L73_C0", "label": "_socks5errors =", "type": "assigned_variable", "loc": [73, 82], "level": 0, "parent": null, "vector": [14, 0, 0.1769, 0.0228, 0, 0.66, 0.8, 9, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_socks5errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_socks5errors = (\"succeeded\",\n \"general SOCKS server failure\",\n \"connection not allowed by ruleset\",\n \"Network unreachable\",\n \"Host unreachable\",\n \"Connection refused\",\n \"TTL expired\",\n \"Command not supported\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L84_C0", "label": "_socks5autherrors =", "type": "assigned_variable", "loc": [84, 88], "level": 0, "parent": null, "vector": [14, 0, 0.1963, 0.0114, 0, 0.66, 0.84, 571, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_socks5autherrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_socks5autherrors = (\"succeeded\",\n \"authentication is required\",\n \"all offered authentication methods were rejected\",\n \"unknown username or invalid password\",\n \"unknown error\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L90_C0", "label": "_socks4errors =", "type": "assigned_variable", "loc": [90, 94], "level": 0, "parent": null, "vector": [14, 0, 0.21, 0.0114, 0, 0.66, 0.88, 965, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_socks4errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "_socks4errors = (\"request granted\",\n \"request rejected or failed\",\n \"request rejected because SOCKS server cannot connect to identd on the client\",\n \"request rejected because the client program and identd report different user-ids\",\n \"unknown error\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L96_C0", "label": "setdefaultproxy", "type": "function", "loc": [96, 102], "level": 0, "parent": null, "vector": [2, 0, 0.226, 0.016, 0, 0.66, 0.92, 203, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "setdefaultproxy", "arg_names": ["proxytype", "addr", "port", "rdns", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setdefaultproxy(proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):\n \"\"\"setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets a default proxy which all further socksocket objects will use,\n unless explicitly changed.\n \"\"\"\n global _defaultproxy\n _defaultproxy = (proxytype, addr, port, rdns, username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L97_C4", "label": "expression", "type": "expression", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L96_C0", "vector": [8, 1, 0.2249, 0.0091, 1, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"setdefaultproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets a default proxy which all further socksocket objects will use,\n unless explicitly changed.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L102_C4", "label": "_defaultproxy =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L96_C0", "vector": [14, 1, 0.2329, 0.0023, 1, 0.77, 1.0, 940, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "_defaultproxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _defaultproxy = (proxytype, addr, port, rdns, username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L104_C0", "label": "wrapmodule", "type": "function", "loc": [104, 114], "level": 0, "parent": null, "vector": [2, 0, 0.2489, 0.0251, 0, 0.66, 0.96, 174, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wrapmodule", "arg_names": ["module"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wrapmodule(module):\n \"\"\"wrapmodule(module)\n Attempts to replace a module's socket library with a SOCKS socket. Must set\n a default proxy using setdefaultproxy(...) first.\n This will only work on modules that import socket directly into the namespace;\n most of the Python Standard Library falls into this category.\n \"\"\"\n if _defaultproxy != None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L105_C4", "label": "expression", "type": "expression", "loc": [105, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L104_C0", "vector": [8, 1, 0.2454, 0.0137, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"wrapmodule(module)\n Attempts to replace a module's socket library with a SOCKS socket. Must set\n a default proxy using setdefaultproxy(...) first.\n This will only work on modules that import socket directly into the namespace;\n most of the Python Standard Library falls into this category.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L111_C4", "label": "if", "type": "if", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L104_C0", "vector": [4, 1, 0.2568, 0.0091, 1, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _defaultproxy != None:\n module.socket.socket = socksocket\n else:\n raise GeneralProxyError((4, \"no proxy specified\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L112_C8", "label": "module.socket.socket =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L111_C4", "vector": [14, 2, 0.2557, 0.0023, 2, 0.8, 0.0, 77, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "module.socket.socket", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " module.socket.socket = socksocket"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "label": "socksocket", "type": "class", "loc": [116, 438], "level": 0, "parent": null, "vector": [3, 0, 0.6324, 0.7374, 0, 0.66, 1.0, 28, 0, 13, 0, 0, 986, 0, 99], "semantic": {"name": "socksocket", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class socksocket(socket.socket):\n \"\"\"socksocket([family[, type[, proto]]]) -> socket object\n Open a SOCKS enabled socket. The parameters are the same as\n those of the standard socket init. In order for SOCKS to work,\n you must specify family=AF_INET, type=SOCK_STREAM and proto=0.\n \"\"\"\n\n def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L117_C4", "label": "expression", "type": "expression", "loc": [117, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [8, 1, 0.2717, 0.0114, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"socksocket([family[, type[, proto]]]) -> socket object\n Open a SOCKS enabled socket. The parameters are the same as\n those of the standard socket init. In order for SOCKS to work,\n you must specify family=AF_INET, type=SOCK_STREAM and proto=0.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "label": "__init__", "type": "function", "loc": [123, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.29, 0.0205, 1, 0.09, 0.0769, 555, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "family", "type", "proto", "_sock"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):\n _orgsocket.__init__(self, family, type, proto, _sock)\n if _defaultproxy != None:\n self.__proxy = _defaultproxy\n else:\n self.__proxy = (None, None, None, None, None, None)\n self.__proxysockname = None\n self.__proxypeername = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L124_C8", "label": "__init__()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "vector": [8, 2, 0.2831, 0.0023, 2, 0.06, 0.0, 555, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _orgsocket.__init__(self, family, type, proto, _sock)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L125_C8", "label": "if", "type": "if", "loc": [125, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "vector": [4, 2, 0.2888, 0.0091, 2, 0.06, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _defaultproxy != None:\n self.__proxy = _defaultproxy\n else:\n self.__proxy = (None, None, None, None, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L126_C12", "label": "self.__proxy =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L125_C8", "vector": [14, 3, 0.2877, 0.0023, 3, 0.09, 0.0, 322, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxy = _defaultproxy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L128_C12", "label": "self.__proxy =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L125_C8", "vector": [14, 3, 0.2922, 0.0023, 3, 0.09, 1.0, 322, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxy = (None, None, None, None, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L129_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "vector": [14, 2, 0.2945, 0.0023, 2, 0.06, 0.5, 335, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L130_C8", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "vector": [14, 2, 0.2968, 0.0023, 2, 0.06, 0.75, 763, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L131_C8", "label": "self.__httptunnel =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "vector": [14, 2, 0.2991, 0.0023, 2, 0.06, 1.0, 470, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.__httptunnel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__httptunnel = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "label": "__recvall", "type": "function", "loc": [133, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.3151, 0.0251, 1, 0.09, 0.1538, 782, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "__recvall", "arg_names": ["self", "count"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __recvall(self, count):\n \"\"\"__recvall(count) -> data\n Receive EXACTLY the number of bytes requested from the socket.\n Blocks until the required number of bytes have been received.\n \"\"\"\n data = self.recv(count)\n while len(data) < count:\n d = self.recv(count-len(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L134_C8", "label": "expression", "type": "expression", "loc": [134, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "vector": [8, 2, 0.3094, 0.0091, 2, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__recvall(count) -> data\n Receive EXACTLY the number of bytes requested from the socket.\n Blocks until the required number of bytes have been received.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L138_C8", "label": "data = recv()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "vector": [14, 2, 0.3151, 0.0023, 2, 0.91, 0.3333, 929, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "recv", "annotation": ""}, "snippet": " data = self.recv(count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "label": "while", "type": "while", "loc": [139, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "vector": [5, 2, 0.3208, 0.0091, 2, 0.91, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(data) < count:\n d = self.recv(count-len(data))\n if not d: raise GeneralProxyError((0, \"connection closed unexpectedly\"))\n data = data + d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L140_C12", "label": "d = recv()", "type": "assigned_variable", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "vector": [14, 3, 0.3196, 0.0023, 3, 0.89, 0.0, 355, 3, 1, 0, 0, 178, 10, 2], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "recv", "annotation": ""}, "snippet": " d = self.recv(count-len(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L141_C12", "label": "if", "type": "if", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "vector": [4, 3, 0.3219, 0.0023, 3, 0.89, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not d: raise GeneralProxyError((0, \"connection closed unexpectedly\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L142_C12", "label": "data =", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "vector": [14, 3, 0.3242, 0.0023, 3, 0.89, 1.0, 929, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = data + d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "vector": [13, 2, 0.3265, 0.0023, 2, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "label": "sendall", "type": "function", "loc": [145, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.3379, 0.016, 1, 0.09, 0.2308, 874, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "sendall", "arg_names": ["self", "content", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sendall(self, content, *args):\n \"\"\" override socket.socket.sendall method to rewrite the header \n for non-tunneling proxies if needed \n \"\"\"\n if not self.__httptunnel:\n content = self.__rewriteproxy(content)\n return super(socksocket, self).sendall(content, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L146_C8", "label": "expression", "type": "expression", "loc": [146, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "vector": [8, 2, 0.3356, 0.0068, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" override socket.socket.sendall method to rewrite the header \n for non-tunneling proxies if needed \n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "vector": [4, 2, 0.3413, 0.0046, 2, 0.12, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.__httptunnel:\n content = self.__rewriteproxy(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L150_C12", "label": "content = __rewriteproxy()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L149_C8", "vector": [14, 3, 0.3425, 0.0023, 3, 0.7, 0.0, 273, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "__rewriteproxy", "annotation": ""}, "snippet": " content = self.__rewriteproxy(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "vector": [13, 2, 0.3447, 0.0023, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(socksocket, self).sendall(content, *args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "label": "__rewriteproxy", "type": "function", "loc": [153, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.3733, 0.0502, 1, 0.09, 0.3077, 244, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "__rewriteproxy", "arg_names": ["self", "header"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rewriteproxy(self, header):\n \"\"\" rewrite HTTP request headers to support non-tunneling proxies \n (i.e. those which do not support the CONNECT method).\n This only works for HTTP (not HTTPS) since HTTPS requires tunneling.\n \"\"\"\n host, endpt = None, None\n hdrs = header.split(\"\\r\\n\")\n for hdr in hdrs:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L154_C8", "label": "expression", "type": "expression", "loc": [154, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "vector": [8, 2, 0.355, 0.0091, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" rewrite HTTP request headers to support non-tunneling proxies \n (i.e. those which do not support the CONNECT method).\n This only works for HTTP (not HTTPS) since HTTPS requires tunneling.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L158_C8", "label": "host, endpt =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "vector": [14, 2, 0.3607, 0.0023, 2, 0.28, 0.2, 281, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "host, endpt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " host, endpt = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L159_C8", "label": "hdrs = split()", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "vector": [14, 2, 0.363, 0.0023, 2, 0.28, 0.4, 36, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "hdrs", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " hdrs = header.split(\"\\r\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:For_L160_C8", "label": "for hdr", "type": "for", "loc": [160, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "vector": [6, 2, 0.3699, 0.0114, 2, 0.28, 0.6, 17, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "hdr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for hdr in hdrs:\n if hdr.lower().startswith(\"host:\"):\n host = hdr\n elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L161_C12", "label": "if", "type": "if", "loc": [161, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:For_L160_C8", "vector": [4, 3, 0.371, 0.0091, 3, 0.05, 0.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hdr.lower().startswith(\"host:\"):\n host = hdr\n elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L162_C16", "label": "host =", "type": "assigned_variable", "loc": [162, 162], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L161_C12", "vector": [14, 4, 0.3699, 0.0023, 4, 0.96, 0.0, 867, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " host = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L163_C12", "label": "if", "type": "if", "loc": [163, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L161_C12", "vector": [4, 4, 0.3733, 0.0046, 4, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hdr.lower().startswith(\"get\") or hdr.lower().startswith(\"post\"):\n endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L164_C16", "label": "endpt =", "type": "assigned_variable", "loc": [164, 164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L163_C12", "vector": [14, 5, 0.3744, 0.0023, 5, 0.9, 0.0, 391, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "endpt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " endpt = hdr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "label": "if", "type": "if", "loc": [165, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "vector": [4, 2, 0.3858, 0.0205, 2, 0.28, 0.8, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if host and endpt: \n hdrs.remove(host)\n hdrs.remove(endpt)\n host = host.split(\" \")[1]\n endpt = endpt.split(\" \")\n if (self.__proxy[4] != None and self.__proxy[5] != None):\n hdrs.insert(0, self.__getauthheader())\n hdrs.insert(0, \"Host: %s\" % host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L166_C12", "label": "remove()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [8, 3, 0.379, 0.0023, 3, 0.25, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " hdrs.remove(host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L167_C12", "label": "remove()", "type": "expression", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [8, 3, 0.3813, 0.0023, 3, 0.25, 0.1667, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " hdrs.remove(endpt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L168_C12", "label": "host =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [14, 3, 0.3836, 0.0023, 3, 0.25, 0.3333, 867, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "host", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " host = host.split(\" \")[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L169_C12", "label": "endpt = split()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [14, 3, 0.3858, 0.0023, 3, 0.25, 0.5, 391, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "endpt", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " endpt = endpt.split(\" \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L170_C12", "label": "if", "type": "if", "loc": [170, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [4, 3, 0.3893, 0.0046, 3, 0.25, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.__proxy[4] != None and self.__proxy[5] != None):\n hdrs.insert(0, self.__getauthheader())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L171_C16", "label": "insert()", "type": "expression", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L170_C12", "vector": [8, 4, 0.3904, 0.0023, 4, 0.02, 0.0, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " hdrs.insert(0, self.__getauthheader())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L172_C12", "label": "insert()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [8, 3, 0.3927, 0.0023, 3, 0.25, 0.8333, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " hdrs.insert(0, \"Host: %s\" % host)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L173_C12", "label": "insert()", "type": "expression", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "vector": [8, 3, 0.395, 0.0023, 3, 0.25, 1.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " hdrs.insert(0, \"%s http://%s%s %s\" % (endpt[0], host, endpt[1], endpt[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "vector": [13, 2, 0.3973, 0.0023, 2, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"\\r\\n\".join(hdrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L176_C4", "label": "__getauthheader", "type": "function", "loc": [176, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.4041, 0.0068, 1, 0.09, 0.3846, 626, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__getauthheader", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getauthheader(self):\n auth = self.__proxy[4] + \":\" + self.__proxy[5]\n return \"Proxy-Authorization: Basic \" + base64.b64encode(auth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L177_C8", "label": "auth =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L176_C4", "vector": [14, 2, 0.4041, 0.0023, 2, 0.22, 0.0, 280, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "auth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " auth = self.__proxy[4] + \":\" + self.__proxy[5]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L178_C8", "label": "return", "type": "return", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L176_C4", "vector": [13, 2, 0.4064, 0.0023, 2, 0.22, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"Proxy-Authorization: Basic \" + base64.b64encode(auth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L180_C4", "label": "setproxy", "type": "function", "loc": [180, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.4304, 0.0411, 1, 0.09, 0.4615, 19, 0, 7, 0, 0, 0, 0, 0], "semantic": {"name": "setproxy", "arg_names": ["self", "proxytype", "addr", "port", "rdns", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setproxy(self, proxytype=None, addr=None, port=None, rdns=True, username=None, password=None):\n \"\"\"setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets the proxy to be used.\n proxytype - The type of the proxy to be used. Three types\n are supported: PROXY_TYPE_SOCKS4 (including socks4a),\n PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP\n addr - The address of the server (IP or DNS).\n port - The port of the server. Defaults to 1080 for SOCKS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L181_C8", "label": "expression", "type": "expression", "loc": [181, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L180_C4", "vector": [8, 2, 0.4304, 0.0365, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])\n Sets the proxy to be used.\n proxytype - The type of the proxy to be used. Three types\n are supported: PROXY_TYPE_SOCKS4 (including socks4a),\n PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP\n addr - The address of the server (IP or DNS).\n port - The port of the server. Defaults to 1080 for SOCKS\n servers and 8080 for HTTP proxy servers."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L197_C8", "label": "self.__proxy =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L180_C4", "vector": [14, 2, 0.4498, 0.0023, 2, 0.24, 1.0, 322, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxy = (proxytype, addr, port, rdns, username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "label": "__negotiatesocks5", "type": "function", "loc": [199, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.5571, 0.2078, 1, 0.09, 0.5385, 924, 0, 3, 0, 0, 0, 0, 75], "semantic": {"name": "__negotiatesocks5", "arg_names": ["self", "destaddr", "destport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __negotiatesocks5(self, destaddr, destport):\n \"\"\"__negotiatesocks5(self,destaddr,destport)\n Negotiates a connection through a SOCKS5 server.\n \"\"\"\n # First we'll send the authentication packages we support.\n if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):\n # The username/password details were supplied to the\n # setproxy method so we support the USERNAME/PASSWORD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L200_C8", "label": "expression", "type": "expression", "loc": [200, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [8, 2, 0.4589, 0.0068, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__negotiatesocks5(self,destaddr,destport)\n Negotiates a connection through a SOCKS5 server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L204_C8", "label": "if", "type": "if", "loc": [204, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [4, 2, 0.4749, 0.0205, 2, 0.78, 0.0769, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.__proxy[4]!=None) and (self.__proxy[5]!=None):\n # The username/password details were supplied to the\n # setproxy method so we support the USERNAME/PASSWORD\n # authentication (in addition to the standard none).\n self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02))\n else:\n # No username/password were entered, therefore we\n # only support connections with no authentication."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L208_C12", "label": "sendall()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L204_C8", "vector": [8, 3, 0.4749, 0.0023, 3, 0.08, 0.0, 874, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(struct.pack('BBBB', 0x05, 0x02, 0x00, 0x02))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L212_C12", "label": "sendall()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L204_C8", "vector": [8, 3, 0.484, 0.0023, 3, 0.08, 1.0, 874, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(struct.pack('BBB', 0x05, 0x01, 0x00))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L215_C8", "label": "chosenauth = __recvall()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [14, 2, 0.4909, 0.0023, 2, 0.78, 0.1538, 509, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "chosenauth", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " chosenauth = self.__recvall(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L216_C8", "label": "if", "type": "if", "loc": [216, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [4, 2, 0.4954, 0.0068, 2, 0.78, 0.2308, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chosenauth[0:1] != chr(0x05).encode():\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L217_C12", "label": "close()", "type": "expression", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L216_C8", "vector": [8, 3, 0.4954, 0.0023, 3, 0.23, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L220_C8", "label": "if", "type": "if", "loc": [220, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [4, 2, 0.5285, 0.0548, 2, 0.78, 0.3077, 0, 0, 0, 0, 0, 0, 0, 25], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chosenauth[1:2] == chr(0x00).encode():\n # No authentication is required\n pass\n elif chosenauth[1:2] == chr(0x02).encode():\n # Okay, we need to perform a basic username/password\n # authentication.\n self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])\n authstat = self.__recvall(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "label": "if", "type": "if", "loc": [223, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L220_C8", "vector": [4, 3, 0.532, 0.0479, 3, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif chosenauth[1:2] == chr(0x02).encode():\n # Okay, we need to perform a basic username/password\n # authentication.\n self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])\n authstat = self.__recvall(2)\n if authstat[0:1] != chr(0x01).encode():\n # Bad response\n self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L226_C12", "label": "sendall()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "vector": [8, 4, 0.516, 0.0023, 4, 0.05, 0.0, 874, 3, 1, 0, 0, 0, 0, 7], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(chr(0x01).encode() + chr(len(self.__proxy[4])) + self.__proxy[4] + chr(len(self.__proxy[5])) + self.__proxy[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L227_C12", "label": "authstat = __recvall()", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "vector": [14, 4, 0.5183, 0.0023, 4, 0.05, 0.2, 759, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "authstat", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " authstat = self.__recvall(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L228_C12", "label": "if", "type": "if", "loc": [228, 231], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "vector": [4, 4, 0.524, 0.0091, 4, 0.05, 0.4, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if authstat[0:1] != chr(0x01).encode():\n # Bad response\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L230_C16", "label": "close()", "type": "expression", "loc": [230, 230], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L228_C12", "vector": [8, 5, 0.5251, 0.0023, 5, 0.0, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L232_C12", "label": "if", "type": "if", "loc": [232, 235], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "vector": [4, 4, 0.5331, 0.0091, 4, 0.05, 0.6, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if authstat[1:2] != chr(0x00).encode():\n # Authentication failed\n self.close()\n raise Socks5AuthError((3, _socks5autherrors[3]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L234_C16", "label": "close()", "type": "expression", "loc": [234, 234], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L232_C12", "vector": [8, 5, 0.5342, 0.0023, 5, 0.45, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L239_C12", "label": "close()", "type": "expression", "loc": [239, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "vector": [8, 4, 0.5457, 0.0023, 4, 0.05, 0.8, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L240_C12", "label": "if", "type": "if", "loc": [240, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "vector": [4, 4, 0.5514, 0.0091, 4, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chosenauth[1] == chr(0xFF).encode():\n raise Socks5AuthError((2, _socks5autherrors[2]))\n else:\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L245_C8", "label": "req = pack()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [14, 2, 0.5594, 0.0023, 2, 0.78, 0.3846, 233, 3, 4, 0, 0, 742, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " req = struct.pack('BBB', 0x05, 0x01, 0x00)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "label": "try", "type": "try", "loc": [248, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [7, 2, 0.5799, 0.0297, 2, 0.78, 0.4615, 0, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ipaddr = socket.inet_aton(destaddr)\n req = req + chr(0x01).encode() + ipaddr\n except socket.error:\n # Well it's not an IP number, so it's probably a DNS name.\n if self.__proxy[3]:\n # Resolve remotely\n ipaddr = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L249_C12", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "vector": [14, 3, 0.5685, 0.0023, 3, 0.07, 0.0, 522, 3, 1, 0, 0, 53, 10, 1], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L250_C12", "label": "req =", "type": "assigned_variable", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "vector": [14, 3, 0.5708, 0.0023, 3, 0.07, 1.0, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x01).encode() + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "label": "if", "type": "if", "loc": [253, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "vector": [4, 3, 0.5856, 0.0183, 3, 0.07, 0.0, 0, 6, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[3]:\n # Resolve remotely\n ipaddr = None\n req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr\n else:\n # Resolve locally\n ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))\n req = req + chr(0x01).encode() + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L255_C16", "label": "ipaddr =", "type": "assigned_variable", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "vector": [14, 4, 0.5822, 0.0023, 4, 0.56, 0.0, 522, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ipaddr = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L256_C16", "label": "req =", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "vector": [14, 4, 0.5845, 0.0023, 4, 0.56, 0.3333, 233, 4, 0, 0, 0, 0, 0, 5], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L259_C16", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "vector": [14, 4, 0.5913, 0.0023, 4, 0.56, 0.6667, 522, 3, 1, 0, 0, 53, 10, 2], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L260_C16", "label": "req =", "type": "assigned_variable", "loc": [260, 260], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "vector": [14, 4, 0.5936, 0.0023, 4, 0.56, 1.0, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x01).encode() + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L261_C8", "label": "req =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [14, 2, 0.5959, 0.0023, 2, 0.78, 0.5385, 233, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + struct.pack(\">H\", destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L262_C8", "label": "sendall()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [8, 2, 0.5982, 0.0023, 2, 0.78, 0.6154, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L264_C8", "label": "resp = __recvall()", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [14, 2, 0.6027, 0.0023, 2, 0.78, 0.6923, 48, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " resp = self.__recvall(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L265_C8", "label": "if", "type": "if", "loc": [265, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [4, 2, 0.6256, 0.0434, 2, 0.78, 0.7692, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp[0:1] != chr(0x05).encode():\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))\n elif resp[1:2] != chr(0x00).encode():\n # Connection failed\n self.close()\n if ord(resp[1:2])<=8:\n raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L266_C12", "label": "close()", "type": "expression", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L265_C8", "vector": [8, 3, 0.6073, 0.0023, 3, 0.3, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "label": "if", "type": "if", "loc": [268, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L265_C8", "vector": [4, 3, 0.629, 0.0365, 3, 0.3, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif resp[1:2] != chr(0x00).encode():\n # Connection failed\n self.close()\n if ord(resp[1:2])<=8:\n raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))\n else:\n raise Socks5Error((9, _socks5errors[9]))\n # Get the bound address/port"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L270_C12", "label": "close()", "type": "expression", "loc": [270, 270], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "vector": [8, 4, 0.6164, 0.0023, 4, 0.2, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L271_C12", "label": "if", "type": "if", "loc": [271, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "vector": [4, 4, 0.6221, 0.0091, 4, 0.2, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ord(resp[1:2])<=8:\n raise Socks5Error((ord(resp[1:2]), _socks5errors[ord(resp[1:2])]))\n else:\n raise Socks5Error((9, _socks5errors[9]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L276_C8", "label": "if", "type": "if", "loc": [276, 283], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "vector": [4, 4, 0.6381, 0.0183, 4, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif resp[3:4] == chr(0x01).encode():\n boundaddr = self.__recvall(4)\n elif resp[3:4] == chr(0x03).encode():\n resp = resp + self.recv(1)\n boundaddr = self.__recvall(ord(resp[4:5]))\n else:\n self.close()\n raise GeneralProxyError((1,_generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L277_C12", "label": "boundaddr = __recvall()", "type": "assigned_variable", "loc": [277, 277], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L276_C8", "vector": [14, 5, 0.6324, 0.0023, 5, 0.9, 0.0, 523, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "boundaddr", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " boundaddr = self.__recvall(4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "label": "if", "type": "if", "loc": [278, 283], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L276_C8", "vector": [4, 5, 0.6404, 0.0137, 5, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif resp[3:4] == chr(0x03).encode():\n resp = resp + self.recv(1)\n boundaddr = self.__recvall(ord(resp[4:5]))\n else:\n self.close()\n raise GeneralProxyError((1,_generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L279_C12", "label": "resp =", "type": "assigned_variable", "loc": [279, 279], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "vector": [14, 6, 0.637, 0.0023, 6, 0.58, 0.0, 48, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp = resp + self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L280_C12", "label": "boundaddr = __recvall()", "type": "assigned_variable", "loc": [280, 280], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "vector": [14, 6, 0.6393, 0.0023, 6, 0.58, 0.5, 523, 3, 1, 0, 0, 782, 10, 2], "semantic": {"name": "boundaddr", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " boundaddr = self.__recvall(ord(resp[4:5]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L282_C12", "label": "close()", "type": "expression", "loc": [282, 282], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "vector": [8, 6, 0.6438, 0.0023, 6, 0.58, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L284_C8", "label": "boundport =", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [14, 2, 0.6484, 0.0023, 2, 0.78, 0.8462, 379, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "boundport", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " boundport = struct.unpack(\">H\", self.__recvall(2))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L285_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [14, 2, 0.6507, 0.0023, 2, 0.78, 0.9231, 335, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = (boundaddr, boundport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L286_C8", "label": "if", "type": "if", "loc": [286, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "vector": [4, 2, 0.6564, 0.0091, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ipaddr != None:\n self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)\n else:\n self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L287_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L286_C8", "vector": [14, 3, 0.6553, 0.0023, 3, 0.47, 0.0, 763, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L289_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L286_C8", "vector": [14, 3, 0.6598, 0.0023, 3, 0.47, 1.0, 763, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L291_C4", "label": "getproxysockname", "type": "function", "loc": [291, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.6689, 0.0114, 1, 0.09, 0.6154, 977, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getproxysockname", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getproxysockname(self):\n \"\"\"getsockname() -> address info\n Returns the bound IP address and port number at the proxy.\n \"\"\"\n return self.__proxysockname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L292_C8", "label": "expression", "type": "expression", "loc": [292, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L291_C4", "vector": [8, 2, 0.6689, 0.0068, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"getsockname() -> address info\n Returns the bound IP address and port number at the proxy.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L295_C8", "label": "return", "type": "return", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L291_C4", "vector": [13, 2, 0.6735, 0.0023, 2, 0.72, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.__proxysockname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L297_C4", "label": "getproxypeername", "type": "function", "loc": [297, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.6826, 0.0114, 1, 0.09, 0.6923, 476, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "getproxypeername", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getproxypeername(self):\n \"\"\"getproxypeername() -> address info\n Returns the IP and port number of the proxy.\n \"\"\"\n return _orgsocket.getpeername(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L298_C8", "label": "expression", "type": "expression", "loc": [298, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L297_C4", "vector": [8, 2, 0.6826, 0.0068, 2, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"getproxypeername() -> address info\n Returns the IP and port number of the proxy.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L301_C8", "label": "return", "type": "return", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L297_C4", "vector": [13, 2, 0.6872, 0.0023, 2, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _orgsocket.getpeername(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L303_C4", "label": "getpeername", "type": "function", "loc": [303, 308], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.6975, 0.0137, 1, 0.09, 0.7692, 468, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getpeername", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getpeername(self):\n \"\"\"getpeername() -> address info\n Returns the IP address and port number of the destination\n machine (note: getproxypeername returns the proxy)\n \"\"\"\n return self.__proxypeername"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L304_C8", "label": "expression", "type": "expression", "loc": [304, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L303_C4", "vector": [8, 2, 0.6975, 0.0091, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"getpeername() -> address info\n Returns the IP address and port number of the destination\n machine (note: getproxypeername returns the proxy)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L308_C8", "label": "return", "type": "return", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L303_C4", "vector": [13, 2, 0.7032, 0.0023, 2, 0.81, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.__proxypeername"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "label": "__negotiatesocks4", "type": "function", "loc": [310, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.7603, 0.1073, 1, 0.09, 0.8462, 972, 0, 3, 0, 0, 0, 0, 27], "semantic": {"name": "__negotiatesocks4", "arg_names": ["self", "destaddr", "destport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __negotiatesocks4(self,destaddr,destport):\n \"\"\"__negotiatesocks4(self,destaddr,destport)\n Negotiates a connection through a SOCKS4 server.\n \"\"\"\n # Check if the destination address provided is an IP address\n rmtrslv = False\n try:\n ipaddr = socket.inet_aton(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L311_C8", "label": "expression", "type": "expression", "loc": [311, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [8, 2, 0.7123, 0.0068, 2, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__negotiatesocks4(self,destaddr,destport)\n Negotiates a connection through a SOCKS4 server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L315_C8", "label": "rmtrslv =", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [14, 2, 0.7192, 0.0023, 2, 0.45, 0.0833, 127, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "rmtrslv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmtrslv = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L316_C8", "label": "try", "type": "try", "loc": [316, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [7, 2, 0.7306, 0.0205, 2, 0.45, 0.1667, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n ipaddr = socket.inet_aton(destaddr)\n except socket.error:\n # It's a DNS name. Check where it should be resolved.\n if self.__proxy[3]:\n ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)\n rmtrslv = True\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L317_C12", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L316_C8", "vector": [14, 3, 0.7237, 0.0023, 3, 0.56, 0.0, 522, 3, 1, 0, 0, 53, 10, 1], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "label": "if", "type": "if", "loc": [320, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L316_C8", "vector": [4, 3, 0.7352, 0.0114, 3, 0.56, 0.0, 0, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[3]:\n ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)\n rmtrslv = True\n else:\n ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L321_C16", "label": "ipaddr = pack()", "type": "assigned_variable", "loc": [321, 321], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "vector": [14, 4, 0.7329, 0.0023, 4, 0.26, 0.0, 522, 3, 5, 0, 0, 742, 10, 1], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " ipaddr = struct.pack(\"BBBB\", 0x00, 0x00, 0x00, 0x01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L322_C16", "label": "rmtrslv =", "type": "assigned_variable", "loc": [322, 322], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "vector": [14, 4, 0.7352, 0.0023, 4, 0.26, 0.5, 127, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "rmtrslv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmtrslv = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L324_C16", "label": "ipaddr = inet_aton()", "type": "assigned_variable", "loc": [324, 324], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "vector": [14, 4, 0.7397, 0.0023, 4, 0.26, 1.0, 522, 3, 1, 0, 0, 53, 10, 2], "semantic": {"name": "ipaddr", "arg_names": [], "import_names": [], "rhs_call_name": "inet_aton", "annotation": ""}, "snippet": " ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L326_C8", "label": "req =", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [14, 2, 0.7443, 0.0023, 2, 0.45, 0.25, 233, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = struct.pack(\">BBH\", 0x04, 0x01, destport) + ipaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L328_C8", "label": "if", "type": "if", "loc": [328, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [4, 2, 0.75, 0.0046, 2, 0.45, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[4] != None:\n req = req + self.__proxy[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L329_C12", "label": "req =", "type": "assigned_variable", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L328_C8", "vector": [14, 3, 0.7511, 0.0023, 3, 0.49, 0.0, 233, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + self.__proxy[4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L330_C8", "label": "req =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [14, 2, 0.7534, 0.0023, 2, 0.45, 0.4167, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + chr(0x00).encode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L334_C8", "label": "if", "type": "if", "loc": [334, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [4, 2, 0.7637, 0.0046, 2, 0.45, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rmtrslv:\n req = req + destaddr + chr(0x00).encode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L335_C12", "label": "req =", "type": "assigned_variable", "loc": [335, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L334_C8", "vector": [14, 3, 0.7648, 0.0023, 3, 0.69, 0.0, 233, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req = req + destaddr + chr(0x00).encode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L336_C8", "label": "sendall()", "type": "expression", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [8, 2, 0.7671, 0.0023, 2, 0.45, 0.5833, 874, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L338_C8", "label": "resp = __recvall()", "type": "assigned_variable", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [14, 2, 0.7717, 0.0023, 2, 0.45, 0.6667, 48, 3, 1, 0, 0, 782, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "__recvall", "annotation": ""}, "snippet": " resp = self.__recvall(8)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L339_C8", "label": "if", "type": "if", "loc": [339, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [4, 2, 0.7774, 0.0091, 2, 0.45, 0.75, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp[0:1] != chr(0x00).encode():\n # Bad data\n self.close()\n raise GeneralProxyError((1,_generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L341_C12", "label": "close()", "type": "expression", "loc": [341, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L339_C8", "vector": [8, 3, 0.7785, 0.0023, 3, 0.06, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L343_C8", "label": "if", "type": "if", "loc": [343, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [4, 2, 0.7911, 0.0183, 2, 0.45, 0.8333, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resp[1:2] != chr(0x5A).encode():\n # Server returned an error\n self.close()\n if ord(resp[1:2]) in (91, 92, 93):\n self.close()\n raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))\n else:\n raise Socks4Error((94, _socks4errors[4]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L345_C12", "label": "close()", "type": "expression", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L343_C8", "vector": [8, 3, 0.7877, 0.0023, 3, 0.85, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L346_C12", "label": "if", "type": "if", "loc": [346, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L343_C8", "vector": [4, 3, 0.7945, 0.0114, 3, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ord(resp[1:2]) in (91, 92, 93):\n self.close()\n raise Socks4Error((ord(resp[1:2]), _socks4errors[ord(resp[1:2]) - 90]))\n else:\n raise Socks4Error((94, _socks4errors[4]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L347_C16", "label": "close()", "type": "expression", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L346_C12", "vector": [8, 4, 0.7922, 0.0023, 4, 0.8, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L352_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [14, 2, 0.8037, 0.0023, 2, 0.45, 0.9167, 335, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = (socket.inet_ntoa(resp[4:]), struct.unpack(\">H\", resp[2:4])[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L353_C8", "label": "if", "type": "if", "loc": [353, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "vector": [4, 2, 0.8094, 0.0091, 2, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rmtrslv != None:\n self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)\n else:\n self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L354_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [354, 354], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L353_C8", "vector": [14, 3, 0.8082, 0.0023, 3, 0.84, 0.0, 763, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (socket.inet_ntoa(ipaddr), destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L356_C12", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L353_C8", "vector": [14, 3, 0.8128, 0.0023, 3, 0.84, 1.0, 763, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (destaddr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "label": "__negotiatehttp", "type": "function", "loc": [358, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.8562, 0.0799, 1, 0.09, 0.9231, 893, 0, 3, 0, 0, 0, 0, 23], "semantic": {"name": "__negotiatehttp", "arg_names": ["self", "destaddr", "destport"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __negotiatehttp(self, destaddr, destport):\n \"\"\"__negotiatehttp(self,destaddr,destport)\n Negotiates a connection through an HTTP server.\n \"\"\"\n # If we need to resolve locally, we do this now\n if not self.__proxy[3]:\n addr = socket.gethostbyname(destaddr)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L359_C8", "label": "expression", "type": "expression", "loc": [359, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [8, 2, 0.8219, 0.0068, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"__negotiatehttp(self,destaddr,destport)\n Negotiates a connection through an HTTP server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L363_C8", "label": "if", "type": "if", "loc": [363, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [4, 2, 0.8322, 0.0091, 2, 0.61, 0.0769, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.__proxy[3]:\n addr = socket.gethostbyname(destaddr)\n else:\n addr = destaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L364_C12", "label": "addr = gethostbyname()", "type": "assigned_variable", "loc": [364, 364], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L363_C8", "vector": [14, 3, 0.8311, 0.0023, 3, 0.1, 0.0, 526, 3, 1, 0, 0, 61, 10, 1], "semantic": {"name": "addr", "arg_names": [], "import_names": [], "rhs_call_name": "gethostbyname", "annotation": ""}, "snippet": " addr = socket.gethostbyname(destaddr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L366_C12", "label": "addr =", "type": "assigned_variable", "loc": [366, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L363_C8", "vector": [14, 3, 0.8356, 0.0023, 3, 0.1, 1.0, 526, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "addr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addr = destaddr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L367_C8", "label": "headers =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [14, 2, 0.8379, 0.0023, 2, 0.61, 0.1538, 950, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = [\"CONNECT \", addr, \":\", str(destport), \" HTTP/1.1\\r\\n\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L369_C8", "label": "if", "type": "if", "loc": [369, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [4, 2, 0.8436, 0.0046, 2, 0.61, 0.2308, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.__proxy[4] != None and self.__proxy[5] != None):\n headers += [self.__getauthheader(), \"\\r\\n\"]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L371_C8", "label": "append()", "type": "expression", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [8, 2, 0.847, 0.0023, 2, 0.61, 0.3077, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " headers.append(\"\\r\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L372_C8", "label": "sendall()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [8, 2, 0.8493, 0.0023, 2, 0.61, 0.3846, 874, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "sendall", "arg_names": [], "import_names": [], "rhs_call_name": "sendall", "annotation": ""}, "snippet": " self.sendall(\"\".join(headers).encode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L374_C8", "label": "resp = recv()", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [14, 2, 0.8539, 0.0023, 2, 0.61, 0.4615, 48, 3, 1, 0, 0, 178, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "recv", "annotation": ""}, "snippet": " resp = self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L375_C8", "label": "while", "type": "while", "loc": [375, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [5, 2, 0.8573, 0.0046, 2, 0.61, 0.5385, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while resp.find(\"\\r\\n\\r\\n\".encode()) == -1:\n resp = resp + self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L376_C12", "label": "resp =", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L375_C8", "vector": [14, 3, 0.8584, 0.0023, 3, 0.19, 0.0, 48, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resp = resp + self.recv(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L379_C8", "label": "statusline = split()", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [14, 2, 0.8653, 0.0023, 2, 0.61, 0.6154, 680, 3, 2, 0, 0, 908, 10, 3], "semantic": {"name": "statusline", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " statusline = resp.splitlines()[0].split(\" \".encode(), 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L380_C8", "label": "if", "type": "if", "loc": [380, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [4, 2, 0.8699, 0.0068, 2, 0.61, 0.6923, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if statusline[0] not in (\"HTTP/1.0\".encode(), \"HTTP/1.1\".encode()):\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L381_C12", "label": "close()", "type": "expression", "loc": [381, 381], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L380_C8", "vector": [8, 3, 0.8699, 0.0023, 3, 0.86, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L383_C8", "label": "try", "type": "try", "loc": [383, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [7, 2, 0.879, 0.0114, 2, 0.61, 0.7692, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n statuscode = int(statusline[1])\n except ValueError:\n self.close()\n raise GeneralProxyError((1, _generalerrors[1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L384_C12", "label": "statuscode = int()", "type": "assigned_variable", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L383_C8", "vector": [14, 3, 0.8767, 0.0023, 3, 0.3, 0.0, 958, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "statuscode", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " statuscode = int(statusline[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L386_C12", "label": "close()", "type": "expression", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L383_C8", "vector": [8, 3, 0.8813, 0.0023, 3, 0.3, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L388_C8", "label": "if", "type": "if", "loc": [388, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [4, 2, 0.8881, 0.0068, 2, 0.61, 0.8462, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if statuscode != 200:\n self.close()\n raise HTTPError((statuscode, statusline[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L389_C12", "label": "close()", "type": "expression", "loc": [389, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L388_C8", "vector": [8, 3, 0.8881, 0.0023, 3, 0.92, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L391_C8", "label": "self.__proxysockname =", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [14, 2, 0.8927, 0.0023, 2, 0.61, 0.9231, 335, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxysockname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxysockname = (\"0.0.0.0\", 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L392_C8", "label": "self.__proxypeername =", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "vector": [14, 2, 0.895, 0.0023, 2, 0.61, 1.0, 763, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.__proxypeername", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__proxypeername = (addr, destport)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "label": "connect", "type": "function", "loc": [394, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "vector": [2, 1, 0.9498, 0.1027, 1, 0.09, 1.0, 242, 0, 2, 0, 0, 0, 0, 16], "semantic": {"name": "connect", "arg_names": ["self", "destpair"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def connect(self, destpair):\n \"\"\"connect(self, despair)\n Connects to the specified destination through a proxy.\n destpar - A tuple of the IP/DNS address and the port number.\n (identical to socket's connect).\n To select the proxy server use setproxy().\n \"\"\"\n # Do a minimal input check first"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L395_C8", "label": "expression", "type": "expression", "loc": [395, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "vector": [8, 2, 0.9075, 0.0137, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"connect(self, despair)\n Connects to the specified destination through a proxy.\n destpar - A tuple of the IP/DNS address and the port number.\n (identical to socket's connect).\n To select the proxy server use setproxy().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L402_C8", "label": "if", "type": "if", "loc": [402, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "vector": [4, 2, 0.9189, 0.0046, 2, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (type(destpair[0]) != type('')) or (type(destpair[1]) != int):\n raise GeneralProxyError((5, _generalerrors[5]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "label": "if", "type": "if", "loc": [404, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "vector": [4, 2, 0.9612, 0.0799, 2, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[0] == PROXY_TYPE_SOCKS5:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080\n _orgsocket.connect(self, (self.__proxy[1], portnum))\n self.__negotiatesocks5(destpair[0], destpair[1])\n elif self.__proxy[0] == PROXY_TYPE_SOCKS4:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L405_C12", "label": "if", "type": "if", "loc": [405, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "vector": [4, 3, 0.9281, 0.0091, 3, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L406_C16", "label": "portnum =", "type": "assigned_variable", "loc": [406, 406], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L405_C12", "vector": [14, 4, 0.9269, 0.0023, 4, 0.22, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L408_C16", "label": "portnum =", "type": "assigned_variable", "loc": [408, 408], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L405_C12", "vector": [14, 4, 0.9315, 0.0023, 4, 0.22, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L409_C12", "label": "connect()", "type": "expression", "loc": [409, 409], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "vector": [8, 3, 0.9338, 0.0023, 3, 0.31, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self, (self.__proxy[1], portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L410_C12", "label": "__negotiatesocks5()", "type": "expression", "loc": [410, 410], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "vector": [8, 3, 0.9361, 0.0023, 3, 0.31, 0.6667, 924, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatesocks5", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatesocks5", "annotation": ""}, "snippet": " self.__negotiatesocks5(destpair[0], destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "label": "if", "type": "if", "loc": [411, 438], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "vector": [4, 3, 0.9692, 0.0639, 3, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == PROXY_TYPE_SOCKS4:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080\n _orgsocket.connect(self,(self.__proxy[1], portnum))\n self.__negotiatesocks4(destpair[0], destpair[1])\n elif self.__proxy[0] == PROXY_TYPE_HTTP:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L412_C12", "label": "if", "type": "if", "loc": [412, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "vector": [4, 4, 0.9441, 0.0091, 4, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L413_C16", "label": "portnum =", "type": "assigned_variable", "loc": [413, 413], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L412_C12", "vector": [14, 5, 0.9429, 0.0023, 5, 0.87, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L415_C16", "label": "portnum =", "type": "assigned_variable", "loc": [415, 415], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L412_C12", "vector": [14, 5, 0.9475, 0.0023, 5, 0.87, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 1080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L416_C12", "label": "connect()", "type": "expression", "loc": [416, 416], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "vector": [8, 4, 0.9498, 0.0023, 4, 0.43, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self,(self.__proxy[1], portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L417_C12", "label": "__negotiatesocks4()", "type": "expression", "loc": [417, 417], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "vector": [8, 4, 0.9521, 0.0023, 4, 0.43, 0.6667, 972, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatesocks4", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatesocks4", "annotation": ""}, "snippet": " self.__negotiatesocks4(destpair[0], destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "label": "if", "type": "if", "loc": [418, 438], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "vector": [4, 4, 0.9772, 0.0479, 4, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == PROXY_TYPE_HTTP:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080\n _orgsocket.connect(self,(self.__proxy[1], portnum))\n self.__negotiatehttp(destpair[0], destpair[1])\n elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L419_C12", "label": "if", "type": "if", "loc": [419, 422], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "vector": [4, 5, 0.96, 0.0091, 5, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L420_C16", "label": "portnum =", "type": "assigned_variable", "loc": [420, 420], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L419_C12", "vector": [14, 6, 0.9589, 0.0023, 6, 0.31, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L422_C16", "label": "portnum =", "type": "assigned_variable", "loc": [422, 422], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L419_C12", "vector": [14, 6, 0.9635, 0.0023, 6, 0.31, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L423_C12", "label": "connect()", "type": "expression", "loc": [423, 423], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "vector": [8, 5, 0.9658, 0.0023, 5, 0.19, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self,(self.__proxy[1], portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L424_C12", "label": "__negotiatehttp()", "type": "expression", "loc": [424, 424], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "vector": [8, 5, 0.968, 0.0023, 5, 0.19, 0.6667, 893, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatehttp", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatehttp", "annotation": ""}, "snippet": " self.__negotiatehttp(destpair[0], destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "label": "if", "type": "if", "loc": [425, 438], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "vector": [4, 5, 0.9852, 0.032, 5, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == PROXY_TYPE_HTTP_NO_TUNNEL:\n if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080\n _orgsocket.connect(self,(self.__proxy[1],portnum))\n if destpair[1] == 443:\n self.__negotiatehttp(destpair[0],destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L426_C12", "label": "if", "type": "if", "loc": [426, 429], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "vector": [4, 6, 0.976, 0.0091, 6, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__proxy[2] != None:\n portnum = self.__proxy[2]\n else:\n portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L427_C16", "label": "portnum =", "type": "assigned_variable", "loc": [427, 427], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L426_C12", "vector": [14, 7, 0.9749, 0.0023, 7, 0.94, 0.0, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = self.__proxy[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L429_C16", "label": "portnum =", "type": "assigned_variable", "loc": [429, 429], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L426_C12", "vector": [14, 7, 0.9795, 0.0023, 7, 0.94, 1.0, 733, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "portnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " portnum = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L430_C12", "label": "connect()", "type": "expression", "loc": [430, 430], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "vector": [8, 6, 0.9817, 0.0023, 6, 0.23, 0.3333, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self,(self.__proxy[1],portnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L431_C12", "label": "if", "type": "if", "loc": [431, 434], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "vector": [4, 6, 0.9874, 0.0091, 6, 0.23, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if destpair[1] == 443:\n self.__negotiatehttp(destpair[0],destpair[1])\n else:\n self.__httptunnel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L432_C16", "label": "__negotiatehttp()", "type": "expression", "loc": [432, 432], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L431_C12", "vector": [8, 7, 0.9863, 0.0023, 7, 0.79, 0.0, 893, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__negotiatehttp", "arg_names": [], "import_names": [], "rhs_call_name": "__negotiatehttp", "annotation": ""}, "snippet": " self.__negotiatehttp(destpair[0],destpair[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L434_C16", "label": "self.__httptunnel =", "type": "assigned_variable", "loc": [434, 434], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L431_C12", "vector": [14, 7, 0.9909, 0.0023, 7, 0.79, 1.0, 470, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.__httptunnel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__httptunnel = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L435_C8", "label": "if", "type": "if", "loc": [435, 438], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "vector": [4, 6, 0.9966, 0.0091, 6, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.__proxy[0] == None:\n _orgsocket.connect(self, (destpair[0], destpair[1]))\n else:\n raise GeneralProxyError((4, _generalerrors[4]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L436_C12", "label": "connect()", "type": "expression", "loc": [436, 436], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L435_C8", "vector": [8, 7, 0.9954, 0.0023, 7, 0.59, 0.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " _orgsocket.connect(self, (destpair[0], destpair[1]))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:For_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:For_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L163_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L170_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L171_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L165_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L208_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L216_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L230_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L232_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L234_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L256_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L253_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L260_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L270_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L291_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L291_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Return_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L321_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L322_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L324_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L334_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L339_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L341_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L343_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L343_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L346_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L346_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L347_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L354_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L353_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L363_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L364_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L363_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L369_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:While_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L380_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:Try_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L388_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L358_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L405_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L406_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L405_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L408_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L409_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L404_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L413_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L415_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L417_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L419_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L420_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L419_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L422_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L423_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L424_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L426_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L427_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L426_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L429_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L430_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L431_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L432_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L431_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Assign_L434_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L425_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99191:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99191:Expr_L436_C12"}] |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characters we need to enocde and escape are defined in the spec:
#
# iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD
# ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF
# / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD
# / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD
# / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD
# / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD
# / %xD0000-DFFFD / %xE1000-EFFFD
escape_range = [
(0xA0, 0xD7FF ),
(0xE000, 0xF8FF ),
(0xF900, 0xFDCF ),
(0xFDF0, 0xFFEF),
(0x10000, 0x1FFFD ),
(0x20000, 0x2FFFD ),
(0x30000, 0x3FFFD),
(0x40000, 0x4FFFD ),
(0x50000, 0x5FFFD ),
(0x60000, 0x6FFFD),
(0x70000, 0x7FFFD ),
(0x80000, 0x8FFFD ),
(0x90000, 0x9FFFD),
(0xA0000, 0xAFFFD ),
(0xB0000, 0xBFFFD ),
(0xC0000, 0xCFFFD),
(0xD0000, 0xDFFFD ),
(0xE1000, 0xEFFFD),
(0xF0000, 0xFFFFD ),
(0x100000, 0x10FFFD)
]
def encode(c):
retval = c
i = ord(c)
for low, high in escape_range:
if i < low:
break
if i >= low and i <= high:
retval = "".join(["%%%2X" % ord(o) for o in c.encode('utf-8')])
break
return retval
def iri2uri(uri):
"""Convert an IRI to a URI. Note that IRIs must be
passed in a unicode strings. That is, do not utf-8 encode
the IRI before passing it into the function."""
if isinstance(uri ,unicode):
(scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)
authority = authority.encode('idna')
# For each character in 'ucschar' or 'iprivate'
# 1. encode as utf-8
# 2. then %-encode each octet of that utf-8
uri = urlparse.urlunsplit((scheme, authority, path, query, fragment))
uri = "".join([encode(c) for c in uri])
return uri
if __name__ == "__main__":
import unittest
class Test(unittest.TestCase):
def test_uris(self):
"""Test that URIs are invariant under the transformation."""
invariant = [
u"ftp://ftp.is.co.za/rfc/rfc1808.txt",
u"http://www.ietf.org/rfc/rfc2396.txt",
u"ldap://[2001:db8::7]/c=GB?objectClass?one",
u"mailto:John.Doe@example.com",
u"news:comp.infosystems.www.servers.unix",
u"tel:+1-816-555-1212",
u"telnet://192.0.2.16:80/",
u"urn:oasis:names:specification:docbook:dtd:xml:4.1.2" ]
for uri in invariant:
self.assertEqual(uri, iri2uri(uri))
def test_iri(self):
""" Test that the right type of escaping is done for each part of the URI."""
self.assertEqual("http://xn--o3h.com/%E2%98%84", iri2uri(u"http://\N{COMET}.com/\N{COMET}"))
self.assertEqual("http://bitworking.org/?fred=%E2%98%84", iri2uri(u"http://bitworking.org/?fred=\N{COMET}"))
self.assertEqual("http://bitworking.org/#%E2%98%84", iri2uri(u"http://bitworking.org/#\N{COMET}"))
self.assertEqual("#%E2%98%84", iri2uri(u"#\N{COMET}"))
self.assertEqual("/fred?bar=%E2%98%9A#%E2%98%84", iri2uri(u"/fred?bar=\N{BLACK LEFT POINTING INDEX}#\N{COMET}"))
self.assertEqual("/fred?bar=%E2%98%9A#%E2%98%84", iri2uri(iri2uri(u"/fred?bar=\N{BLACK LEFT POINTING INDEX}#\N{COMET}")))
self.assertNotEqual("/fred?bar=%E2%98%9A#%E2%98%84", iri2uri(u"/fred?bar=\N{BLACK LEFT POINTING INDEX}#\N{COMET}".encode('utf-8')))
unittest.main()
| ajibawa-2023/Python-Code-Large/train/row_99192 | 43 | 110 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0318, 0.0545, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\niri2uri\n\nConverts an IRI to a URI.\n\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L7_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0636, 0.0091, 0, 0.66, 0.0909, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"Joe Gregorio (joe@bitworking.org)\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L8_C0", "label": "__copyright__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0727, 0.0091, 0, 0.66, 0.1818, 200, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__copyright__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__copyright__ = \"Copyright 2006, Joe Gregorio\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L9_C0", "label": "__contributors__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0818, 0.0091, 0, 0.66, 0.2727, 292, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__contributors__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__contributors__ = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L10_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0909, 0.0091, 0, 0.66, 0.3636, 162, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__version__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__version__ = \"1.0.0\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L11_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.1, 0.0091, 0, 0.66, 0.4545, 11, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__license__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__license__ = \"MIT\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L12_C0", "label": "__history__ =", "type": "assigned_variable", "loc": [12, 13], "level": 0, "parent": null, "vector": [14, 0, 0.1136, 0.0182, 0, 0.66, 0.5455, 473, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__history__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__history__ = \"\"\"\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Import_L15_C0", "label": "urlparse import urlparse", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1364, 0.0091, 0, 0.66, 0.6364, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urlparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L30_C0", "label": "escape_range =", "type": "assigned_variable", "loc": [30, 51], "level": 0, "parent": null, "vector": [14, 0, 0.3682, 0.2, 0, 0.66, 0.7273, 996, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "escape_range", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "escape_range = [\n (0xA0, 0xD7FF ),\n (0xE000, 0xF8FF ),\n (0xF900, 0xFDCF ),\n (0xFDF0, 0xFFEF),\n (0x10000, 0x1FFFD ),\n (0x20000, 0x2FFFD ),\n (0x30000, 0x3FFFD),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "label": "encode", "type": "function", "loc": [53, 62], "level": 0, "parent": null, "vector": [2, 0, 0.5227, 0.0909, 0, 0.66, 0.8182, 623, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "encode", "arg_names": ["c"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def encode(c):\n retval = c\n i = ord(c)\n for low, high in escape_range:\n if i < low:\n break\n if i >= low and i <= high:\n retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L54_C4", "label": "retval =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "vector": [14, 1, 0.4909, 0.0091, 1, 0.03, 0.0, 991, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval = c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L55_C4", "label": "i = ord()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "vector": [14, 1, 0.5, 0.0091, 1, 0.03, 0.3333, 826, 3, 1, 0, 0, 171, 10, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "ord", "annotation": ""}, "snippet": " i = ord(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L56_C4", "label": "for low, high", "type": "for", "loc": [56, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "vector": [6, 1, 0.5318, 0.0545, 1, 0.03, 0.6667, 628, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "low, high", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for low, high in escape_range:\n if i < low:\n break\n if i >= low and i <= high:\n retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L56_C4", "vector": [4, 2, 0.5227, 0.0182, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i < low:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L59_C8", "label": "if", "type": "if", "loc": [59, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L56_C4", "vector": [4, 2, 0.5455, 0.0273, 2, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i >= low and i <= high:\n retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L60_C12", "label": "retval = join()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L59_C8", "vector": [14, 3, 0.5455, 0.0091, 3, 0.77, 0.0, 991, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " retval = \"\".join([\"%%%2X\" % ord(o) for o in c.encode('utf-8')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Return_L62_C4", "label": "return", "type": "return", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "vector": [13, 1, 0.5636, 0.0091, 1, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "label": "iri2uri", "type": "function", "loc": [65, 77], "level": 0, "parent": null, "vector": [2, 0, 0.6455, 0.1182, 0, 0.66, 0.9091, 588, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "iri2uri", "arg_names": ["uri"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def iri2uri(uri):\n \"\"\"Convert an IRI to a URI. Note that IRIs must be \n passed in a unicode strings. That is, do not utf-8 encode\n the IRI before passing it into the function.\"\"\" \n if isinstance(uri ,unicode):\n (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)\n authority = authority.encode('idna')\n # For each character in 'ucschar' or 'iprivate'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L66_C4", "label": "expression", "type": "expression", "loc": [66, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "vector": [8, 1, 0.6091, 0.0273, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Convert an IRI to a URI. Note that IRIs must be \n passed in a unicode strings. That is, do not utf-8 encode\n the IRI before passing it into the function.\"\"\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "label": "if", "type": "if", "loc": [69, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "vector": [4, 1, 0.6591, 0.0727, 1, 0.67, 0.5, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(uri ,unicode):\n (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)\n authority = authority.encode('idna')\n # For each character in 'ucschar' or 'iprivate'\n # 1. encode as utf-8\n # 2. then %-encode each octet of that utf-8 \n uri = urlparse.urlunsplit((scheme, authority, path, query, fragment))\n uri = \"\".join([encode(c) for c in uri])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L70_C8", "label": "scheme, authority, path, query, fragment = urlsplit()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "vector": [14, 2, 0.6364, 0.0091, 2, 0.53, 0.0, 171, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "scheme, authority, path, query, fragment", "arg_names": [], "import_names": [], "rhs_call_name": "urlsplit", "annotation": ""}, "snippet": " (scheme, authority, path, query, fragment) = urlparse.urlsplit(uri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L71_C8", "label": "authority = encode()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "vector": [14, 2, 0.6455, 0.0091, 2, 0.53, 0.3333, 372, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "authority", "arg_names": [], "import_names": [], "rhs_call_name": "encode", "annotation": ""}, "snippet": " authority = authority.encode('idna')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L75_C8", "label": "uri = urlunsplit()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "vector": [14, 2, 0.6818, 0.0091, 2, 0.53, 0.6667, 600, 3, 1, 0, 0, 302, 10, 1], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "urlunsplit", "annotation": ""}, "snippet": " uri = urlparse.urlunsplit((scheme, authority, path, query, fragment))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L76_C8", "label": "uri = join()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "vector": [14, 2, 0.6909, 0.0091, 2, 0.53, 1.0, 600, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " uri = \"\".join([encode(c) for c in uri])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "vector": [13, 1, 0.7, 0.0091, 1, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return uri"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "label": "if", "type": "if", "loc": [79, 108], "level": 0, "parent": null, "vector": [4, 0, 0.85, 0.2727, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n import unittest\n\n class Test(unittest.TestCase):\n\n def test_uris(self):\n \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n invariant = [ "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Import_L80_C4", "label": "unittest import unittest", "type": "import", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "vector": [1, 1, 0.7273, 0.0091, 1, 0.44, 0.0, 88, 0, 1, 0, 0, 88, 0, 0], "semantic": {"name": "unittest", "arg_names": [], "import_names": ["unittest"], "rhs_call_name": "", "annotation": ""}, "snippet": " import unittest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:ClassDef_L82_C4", "label": "Test", "type": "class", "loc": [82, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "vector": [3, 1, 0.8545, 0.2273, 1, 0.44, 0.5, 786, 0, 2, 0, 0, 878, 0, 18], "semantic": {"name": "Test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Test(unittest.TestCase):\n\n def test_uris(self):\n \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n invariant = [ \n u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n u\"http://www.ietf.org/rfc/rfc2396.txt\",\n u\"ldap://[2001:db8::7]/c=GB?objectClass?one\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "label": "test_uris", "type": "function", "loc": [84, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:ClassDef_L82_C4", "vector": [2, 2, 0.8182, 0.1182, 2, 0.72, 0.0, 521, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "test_uris", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_uris(self):\n \"\"\"Test that URIs are invariant under the transformation.\"\"\"\n invariant = [ \n u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n u\"http://www.ietf.org/rfc/rfc2396.txt\",\n u\"ldap://[2001:db8::7]/c=GB?objectClass?one\",\n u\"mailto:John.Doe@example.com\",\n u\"news:comp.infosystems.www.servers.unix\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L85_C12", "label": "expression", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "vector": [8, 3, 0.7727, 0.0091, 3, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Test that URIs are invariant under the transformation.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L86_C12", "label": "invariant =", "type": "assigned_variable", "loc": [86, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "vector": [14, 3, 0.8182, 0.0818, 3, 0.29, 0.5, 348, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "invariant", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invariant = [ \n u\"ftp://ftp.is.co.za/rfc/rfc1808.txt\",\n u\"http://www.ietf.org/rfc/rfc2396.txt\",\n u\"ldap://[2001:db8::7]/c=GB?objectClass?one\",\n u\"mailto:John.Doe@example.com\",\n u\"news:comp.infosystems.www.servers.unix\",\n u\"tel:+1-816-555-1212\",\n u\"telnet://192.0.2.16:80/\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L95_C12", "label": "for uri", "type": "for", "loc": [95, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "vector": [6, 3, 0.8682, 0.0182, 3, 0.29, 1.0, 600, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "uri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for uri in invariant:\n self.assertEqual(uri, iri2uri(uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L96_C16", "label": "assertEqual()", "type": "expression", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L95_C12", "vector": [8, 4, 0.8727, 0.0091, 4, 0.93, 0.0, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(uri, iri2uri(uri))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "label": "test_iri", "type": "function", "loc": [98, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:ClassDef_L82_C4", "vector": [2, 2, 0.9273, 0.0818, 2, 0.72, 1.0, 2, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "test_iri", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_iri(self):\n \"\"\" Test that the right type of escaping is done for each part of the URI.\"\"\"\n self.assertEqual(\"http://xn--o3h.com/%E2%98%84\", iri2uri(u\"http://\\N{COMET}.com/\\N{COMET}\"))\n self.assertEqual(\"http://bitworking.org/?fred=%E2%98%84\", iri2uri(u\"http://bitworking.org/?fred=\\N{COMET}\"))\n self.assertEqual(\"http://bitworking.org/#%E2%98%84\", iri2uri(u\"http://bitworking.org/#\\N{COMET}\"))\n self.assertEqual(\"#%E2%98%84\", iri2uri(u\"#\\N{COMET}\"))\n self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\"))\n self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\")))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L99_C12", "label": "expression", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9, 0.0091, 3, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" Test that the right type of escaping is done for each part of the URI.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L100_C12", "label": "assertEqual()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9091, 0.0091, 3, 0.56, 0.1429, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"http://xn--o3h.com/%E2%98%84\", iri2uri(u\"http://\\N{COMET}.com/\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L101_C12", "label": "assertEqual()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9182, 0.0091, 3, 0.56, 0.2857, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"http://bitworking.org/?fred=%E2%98%84\", iri2uri(u\"http://bitworking.org/?fred=\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L102_C12", "label": "assertEqual()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9273, 0.0091, 3, 0.56, 0.4286, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"http://bitworking.org/#%E2%98%84\", iri2uri(u\"http://bitworking.org/#\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L103_C12", "label": "assertEqual()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9364, 0.0091, 3, 0.56, 0.5714, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"#%E2%98%84\", iri2uri(u\"#\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L104_C12", "label": "assertEqual()", "type": "expression", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9455, 0.0091, 3, 0.56, 0.7143, 299, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L105_C12", "label": "assertEqual()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9545, 0.0091, 3, 0.56, 0.8571, 299, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "assertEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertEqual", "annotation": ""}, "snippet": " self.assertEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\")))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L106_C12", "label": "assertNotEqual()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "vector": [8, 3, 0.9636, 0.0091, 3, 0.56, 1.0, 120, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "assertNotEqual", "arg_names": [], "import_names": [], "rhs_call_name": "assertNotEqual", "annotation": ""}, "snippet": " self.assertNotEqual(\"/fred?bar=%E2%98%9A#%E2%98%84\", iri2uri(u\"/fred?bar=\\N{BLACK LEFT POINTING INDEX}#\\N{COMET}\".encode('utf-8')))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L108_C4", "label": "main()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "vector": [8, 1, 0.9818, 0.0091, 1, 0.44, 1.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " unittest.main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Return_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Import_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:ClassDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:ClassDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:For_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:ClassDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99192:If_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99192:Expr_L108_C4"}] |
#!/usr/bin/python
import os
import sys
import threading
from jobutil import *
__author__="qingkaishi"
__date__ ="$Apr 21, 2014 9:45:11 AM$"
alljobs = []
alljobslock = threading.Lock()
def parse_job_files(group):
jobs = []
for item in group:
if item[0].endswith('.json'):
job = ApsaraJob.parse(item[0], item[1])
else:
job = ApsaraJob.parse(item[1], item[0])
jobs.append(job)
alljobslock.acquire()
for item in jobs:
alljobs.append(item)
alljobslock.release()
#################################################################
def cpu_count():
''' Returns the number of CPUs in the system
'''
num = 2
if sys.platform == 'win32':
# fetch the cpu count for windows systems
try:
num = int(os.environ['NUMBER_OF_PROCESSORS'])
except (ValueError, KeyError):
pass
elif sys.platform == 'darwin':
# fetch teh cpu count for MacOS X systems
try:
num = int(os.popen('sysctl -n hw.ncpu').read())
except ValueError:
pass
else:
# an finally fetch the cpu count for Unix-like systems
try:
num = os.sysconf('SC_NPROCESSORS_ONLN')
except (ValueError, OSError, AttributeError):
pass
return num
#################################################################
alljobfiles = []
def get_all_job_files(arg, dirname, names):
jobfiles = []
for filePath in names:
file = os.path.join(dirname, filePath);
if(os.path.isfile(file)):
if(file.endswith(".json")):
jobfiles.append(file)
if(file.endswith(".jobstatus")):
jobfiles.append(file)
if len(jobfiles) == 2:
alljobfiles.append(jobfiles);
if __name__ == "__main__":
if os.path.exists(sys.argv[1]) is True:
os.path.walk(sys.argv[1], get_all_job_files, ())
group = []
allgroups = []
for item in alljobfiles:
group.append(item)
if len(group) == 100:
allgroups.append(group)
allgroups.append(group)
cpus = cpu_count()
for ag in allgroups:
threadlist = []
tempthread = threading.Thread(target=parse_job_files, args=(ag, ))
threadlist.append(tempthread)
if len(threadlist) == cpus:
for at in threadlist:
at.start()
for at in threadlist:
at.join();
for at in threadlist:
at.start()
for at in threadlist:
at.join();
| ajibawa-2023/Python-Code-Large/train/row_99196 | 67 | 99 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0101, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0101, 0, 0.66, 0.0833, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Import_L4_C0", "label": "threading import threading", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0404, 0.0101, 0, 0.66, 0.1667, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:ImportFrom_L5_C0", "label": "from jobutil import *", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0505, 0.0101, 0, 0.66, 0.25, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "jobutil", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from jobutil import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L7_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0707, 0.0101, 0, 0.66, 0.3333, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__=\"qingkaishi\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L8_C0", "label": "__date__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0808, 0.0101, 0, 0.66, 0.4167, 763, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__date__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__date__ =\"$Apr 21, 2014 9:45:11 AM$\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L10_C0", "label": "alljobs =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.101, 0.0101, 0, 0.66, 0.5, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "alljobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "alljobs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L11_C0", "label": "alljobslock = Lock()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.0101, 0, 0.66, 0.5833, 758, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "alljobslock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": "alljobslock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "label": "parse_job_files", "type": "function", "loc": [13, 25], "level": 0, "parent": null, "vector": [2, 0, 0.1919, 0.1313, 0, 0.66, 0.6667, 420, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "parse_job_files", "arg_names": ["group"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_job_files(group):\n jobs = []\n for item in group:\n if item[0].endswith('.json'):\n job = ApsaraJob.parse(item[0], item[1])\n else:\n job = ApsaraJob.parse(item[1], item[0])\n jobs.append(job)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L14_C4", "label": "jobs =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "vector": [14, 1, 0.1414, 0.0101, 1, 0.7, 0.0, 755, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jobs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L15_C4", "label": "for item", "type": "for", "loc": [15, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "vector": [6, 1, 0.1768, 0.0606, 1, 0.7, 0.25, 434, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in group:\n if item[0].endswith('.json'):\n job = ApsaraJob.parse(item[0], item[1])\n else:\n job = ApsaraJob.parse(item[1], item[0])\n jobs.append(job)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L16_C8", "label": "if", "type": "if", "loc": [16, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L15_C4", "vector": [4, 2, 0.1768, 0.0404, 2, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item[0].endswith('.json'):\n job = ApsaraJob.parse(item[0], item[1])\n else:\n job = ApsaraJob.parse(item[1], item[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L17_C12", "label": "job = parse()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L16_C8", "vector": [14, 3, 0.1717, 0.0101, 3, 0.81, 0.0, 831, 3, 2, 0, 0, 678, 10, 1], "semantic": {"name": "job", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " job = ApsaraJob.parse(item[0], item[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L19_C12", "label": "job = parse()", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L16_C8", "vector": [14, 3, 0.1919, 0.0101, 3, 0.81, 1.0, 831, 3, 2, 0, 0, 678, 10, 1], "semantic": {"name": "job", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " job = ApsaraJob.parse(item[1], item[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L20_C8", "label": "append()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L15_C4", "vector": [8, 2, 0.202, 0.0101, 2, 0.35, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobs.append(job)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L22_C4", "label": "acquire()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "vector": [8, 1, 0.2222, 0.0101, 1, 0.7, 0.5, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " alljobslock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L23_C4", "label": "for item", "type": "for", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "vector": [6, 1, 0.2374, 0.0202, 1, 0.7, 0.75, 434, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in jobs:\n alljobs.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L24_C8", "label": "append()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L23_C4", "vector": [8, 2, 0.2424, 0.0101, 2, 0.38, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " alljobs.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L25_C4", "label": "release()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "vector": [8, 1, 0.2525, 0.0101, 1, 0.7, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " alljobslock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "label": "cpu_count", "type": "function", "loc": [29, 52], "level": 0, "parent": null, "vector": [2, 0, 0.4091, 0.2424, 0, 0.66, 0.75, 240, 0, 0, 1, 0, 0, 0, 5], "semantic": {"name": "cpu_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cpu_count():\n ''' Returns the number of CPUs in the system\n '''\n num = 2\n if sys.platform == 'win32':\n # fetch the cpu count for windows systems\n try:\n num = int(os.environ['NUMBER_OF_PROCESSORS'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "vector": [8, 1, 0.3081, 0.0202, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' Returns the number of CPUs in the system\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L32_C4", "label": "num =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "vector": [14, 1, 0.3232, 0.0101, 1, 0.67, 0.3333, 328, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L33_C4", "label": "if", "type": "if", "loc": [33, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "vector": [4, 1, 0.4192, 0.1818, 1, 0.67, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform == 'win32':\n # fetch the cpu count for windows systems\n try:\n num = int(os.environ['NUMBER_OF_PROCESSORS'])\n except (ValueError, KeyError):\n pass\n elif sys.platform == 'darwin':\n # fetch teh cpu count for MacOS X systems"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L35_C8", "label": "try", "type": "try", "loc": [35, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L33_C4", "vector": [7, 2, 0.3687, 0.0404, 2, 0.96, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n num = int(os.environ['NUMBER_OF_PROCESSORS'])\n except (ValueError, KeyError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L36_C12", "label": "num = int()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L35_C8", "vector": [14, 3, 0.3636, 0.0101, 3, 0.85, 0.0, 328, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " num = int(os.environ['NUMBER_OF_PROCESSORS'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L39_C4", "label": "if", "type": "if", "loc": [39, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L33_C4", "vector": [4, 2, 0.4495, 0.1212, 2, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif sys.platform == 'darwin':\n # fetch teh cpu count for MacOS X systems\n try:\n num = int(os.popen('sysctl -n hw.ncpu').read())\n except ValueError:\n pass\n else:\n # an finally fetch the cpu count for Unix-like systems"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L41_C8", "label": "try", "type": "try", "loc": [41, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L39_C4", "vector": [7, 3, 0.4293, 0.0404, 3, 0.76, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n num = int(os.popen('sysctl -n hw.ncpu').read())\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L42_C12", "label": "num = int()", "type": "assigned_variable", "loc": [42, 42], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L41_C8", "vector": [14, 4, 0.4242, 0.0101, 4, 0.18, 0.0, 328, 3, 1, 0, 0, 901, 10, 3], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " num = int(os.popen('sysctl -n hw.ncpu').read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L47_C8", "label": "try", "type": "try", "loc": [47, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L39_C4", "vector": [7, 3, 0.4899, 0.0404, 3, 0.76, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n num = os.sysconf('SC_NPROCESSORS_ONLN')\n except (ValueError, OSError, AttributeError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L48_C12", "label": "num = sysconf()", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L47_C8", "vector": [14, 4, 0.4848, 0.0101, 4, 0.62, 0.0, 328, 3, 1, 0, 0, 0, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "sysconf", "annotation": ""}, "snippet": " num = os.sysconf('SC_NPROCESSORS_ONLN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "vector": [13, 1, 0.5253, 0.0101, 1, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L56_C0", "label": "alljobfiles =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.5657, 0.0101, 0, 0.66, 0.8333, 22, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "alljobfiles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "alljobfiles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "label": "get_all_job_files", "type": "function", "loc": [58, 69], "level": 0, "parent": null, "vector": [2, 0, 0.6414, 0.1212, 0, 0.66, 0.9167, 511, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "get_all_job_files", "arg_names": ["arg", "dirname", "names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_all_job_files(arg, dirname, names):\n jobfiles = []\n for filePath in names:\n file = os.path.join(dirname, filePath);\n if(os.path.isfile(file)):\n if(file.endswith(\".json\")):\n jobfiles.append(file)\n if(file.endswith(\".jobstatus\")):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L59_C4", "label": "jobfiles =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "vector": [14, 1, 0.596, 0.0101, 1, 0.91, 0.0, 728, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jobfiles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jobfiles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L60_C4", "label": "for filePath", "type": "for", "loc": [60, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "vector": [6, 1, 0.6364, 0.0707, 1, 0.91, 0.5, 172, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "filePath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filePath in names:\n file = os.path.join(dirname, filePath);\n if(os.path.isfile(file)):\n if(file.endswith(\".json\")):\n jobfiles.append(file)\n if(file.endswith(\".jobstatus\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L61_C8", "label": "file = join()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L60_C4", "vector": [14, 2, 0.6162, 0.0101, 2, 0.8, 0.0, 107, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " file = os.path.join(dirname, filePath);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L62_C8", "label": "if", "type": "if", "loc": [62, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L60_C4", "vector": [4, 2, 0.6465, 0.0505, 2, 0.8, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(os.path.isfile(file)):\n if(file.endswith(\".json\")):\n jobfiles.append(file)\n if(file.endswith(\".jobstatus\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L63_C12", "label": "if", "type": "if", "loc": [63, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L62_C8", "vector": [4, 3, 0.6414, 0.0202, 3, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(file.endswith(\".json\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L64_C16", "label": "append()", "type": "expression", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L63_C12", "vector": [8, 4, 0.6465, 0.0101, 4, 0.47, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L65_C12", "label": "if", "type": "if", "loc": [65, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L62_C8", "vector": [4, 3, 0.6616, 0.0202, 3, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(file.endswith(\".jobstatus\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L66_C16", "label": "append()", "type": "expression", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L65_C12", "vector": [8, 4, 0.6667, 0.0101, 4, 0.02, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L68_C4", "label": "if", "type": "if", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "vector": [4, 1, 0.6919, 0.0202, 1, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(jobfiles) == 2:\n alljobfiles.append(jobfiles);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L69_C8", "label": "append()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L68_C4", "vector": [8, 2, 0.697, 0.0101, 2, 0.18, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " alljobfiles.append(jobfiles);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "label": "if", "type": "if", "loc": [71, 98], "level": 0, "parent": null, "vector": [4, 0, 0.8535, 0.2828, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n if os.path.exists(sys.argv[1]) is True:\n os.path.walk(sys.argv[1], get_all_job_files, ())\n \n group = []\n allgroups = []\n for item in alljobfiles:\n group.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L72_C4", "label": "if", "type": "if", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [4, 1, 0.7323, 0.0202, 1, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(sys.argv[1]) is True:\n os.path.walk(sys.argv[1], get_all_job_files, ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L73_C8", "label": "walk()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L72_C4", "vector": [8, 2, 0.7374, 0.0101, 2, 0.99, 0.0, 511, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "walk", "arg_names": [], "import_names": [], "rhs_call_name": "walk", "annotation": ""}, "snippet": " os.path.walk(sys.argv[1], get_all_job_files, ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L75_C4", "label": "group =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [14, 1, 0.7576, 0.0101, 1, 0.5, 0.125, 43, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " group = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L76_C4", "label": "allgroups =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [14, 1, 0.7677, 0.0101, 1, 0.5, 0.25, 555, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "allgroups", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allgroups = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L77_C4", "label": "for item", "type": "for", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [6, 1, 0.7929, 0.0404, 1, 0.5, 0.375, 434, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in alljobfiles:\n group.append(item)\n if len(group) == 100:\n allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L78_C8", "label": "append()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L77_C4", "vector": [8, 2, 0.7879, 0.0101, 2, 0.27, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " group.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L77_C4", "vector": [4, 2, 0.803, 0.0202, 2, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(group) == 100:\n allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L80_C12", "label": "append()", "type": "expression", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L79_C8", "vector": [8, 3, 0.8081, 0.0101, 3, 0.17, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L81_C4", "label": "append()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [8, 1, 0.8182, 0.0101, 1, 0.5, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L83_C4", "label": "cpus = cpu_count()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [14, 1, 0.8384, 0.0101, 1, 0.5, 0.625, 547, 3, 0, 0, 0, 240, 10, 1], "semantic": {"name": "cpus", "arg_names": [], "import_names": [], "rhs_call_name": "cpu_count", "annotation": ""}, "snippet": " cpus = cpu_count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "label": "for ag", "type": "for", "loc": [84, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [6, 1, 0.8939, 0.101, 1, 0.5, 0.75, 36, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "ag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ag in allgroups:\n threadlist = []\n tempthread = threading.Thread(target=parse_job_files, args=(ag, ))\n threadlist.append(tempthread)\n \n if len(threadlist) == cpus:\n for at in threadlist:\n at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L85_C8", "label": "threadlist =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "vector": [14, 2, 0.8586, 0.0101, 2, 0.89, 0.0, 169, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "threadlist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " threadlist = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L86_C8", "label": "tempthread = Thread()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "vector": [14, 2, 0.8687, 0.0101, 2, 0.89, 0.3333, 465, 3, 2, 0, 0, 134, 10, 1], "semantic": {"name": "tempthread", "arg_names": [], "import_names": [], "rhs_call_name": "Thread", "annotation": ""}, "snippet": " tempthread = threading.Thread(target=parse_job_files, args=(ag, ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L87_C8", "label": "append()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "vector": [8, 2, 0.8788, 0.0101, 2, 0.89, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " threadlist.append(tempthread)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L89_C8", "label": "if", "type": "if", "loc": [89, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "vector": [4, 2, 0.9192, 0.0505, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(threadlist) == cpus:\n for at in threadlist:\n at.start()\n for at in threadlist:\n at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L90_C12", "label": "for at", "type": "for", "loc": [90, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L89_C8", "vector": [6, 3, 0.9141, 0.0202, 3, 0.74, 0.0, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L91_C16", "label": "start()", "type": "expression", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L90_C12", "vector": [8, 4, 0.9192, 0.0101, 4, 0.58, 0.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L92_C12", "label": "for at", "type": "for", "loc": [92, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L89_C8", "vector": [6, 3, 0.9343, 0.0202, 3, 0.74, 1.0, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L93_C16", "label": "join()", "type": "expression", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L92_C12", "vector": [8, 4, 0.9394, 0.0101, 4, 0.47, 0.0, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L95_C4", "label": "for at", "type": "for", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [6, 1, 0.9646, 0.0202, 1, 0.5, 0.875, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L96_C8", "label": "start()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L95_C4", "vector": [8, 2, 0.9697, 0.0101, 2, 0.51, 0.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L97_C4", "label": "for at", "type": "for", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "vector": [6, 1, 0.9848, 0.0202, 1, 0.5, 1.0, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L98_C8", "label": "join()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L97_C4", "vector": [8, 2, 0.9899, 0.0101, 2, 0.39, 0.0, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " at.join();"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:Try_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99196:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99196:Expr_L98_C8"}] |
#!/usr/bin/python
import os
import sys
import threading
from jobutil import *
__author__="qingkaishi"
__date__ ="$Apr 21, 2014 9:45:11 AM$"
alljobs = []
alljobslock = threading.Lock()
def parse_job_files(group):
jobs = []
for item in group:
if item[0].endswith('.json'):
job = ApsaraJob.parse(item[0], item[1])
else:
job = ApsaraJob.parse(item[1], item[0])
jobs.append(job)
alljobslock.acquire()
for item in jobs:
alljobs.append(item)
alljobslock.release()
#################################################################
def cpu_count():
''' Returns the number of CPUs in the system
'''
num = 2
if sys.platform == 'win32':
# fetch the cpu count for windows systems
try:
num = int(os.environ['NUMBER_OF_PROCESSORS'])
except (ValueError, KeyError):
pass
elif sys.platform == 'darwin':
# fetch teh cpu count for MacOS X systems
try:
num = int(os.popen('sysctl -n hw.ncpu').read())
except ValueError:
pass
else:
# an finally fetch the cpu count for Unix-like systems
try:
num = os.sysconf('SC_NPROCESSORS_ONLN')
except (ValueError, OSError, AttributeError):
pass
return num
#################################################################
alljobfiles = []
def get_all_job_files(arg, dirname, names):
jobfiles = []
for filePath in names:
file = os.path.join(dirname, filePath);
if(os.path.isfile(file)):
if(file.endswith(".json")):
jobfiles.append(file)
if(file.endswith(".jobstatus")):
jobfiles.append(file)
if len(jobfiles) == 2:
alljobfiles.append(jobfiles);
if __name__ == "__main__":
if os.path.exists(sys.argv[1]) is True:
os.path.walk(sys.argv[1], get_all_job_files, ())
group = []
allgroups = []
for item in alljobfiles:
group.append(item)
if len(group) == 100:
allgroups.append(group)
allgroups.append(group)
cpus = cpu_count()
for ag in allgroups:
threadlist = []
tempthread = threading.Thread(target=parse_job_files, args=(ag, ))
threadlist.append(tempthread)
if len(threadlist) == cpus:
for at in threadlist:
at.start()
for at in threadlist:
at.join();
for at in threadlist:
at.start()
for at in threadlist:
at.join();
| ajibawa-2023/Python-Code-Large/train/row_99198 | 67 | 99 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.0101, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0101, 0, 0.66, 0.0833, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Import_L4_C0", "label": "threading import threading", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0404, 0.0101, 0, 0.66, 0.1667, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["threading"], "rhs_call_name": "", "annotation": ""}, "snippet": "import threading"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:ImportFrom_L5_C0", "label": "from jobutil import *", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0505, 0.0101, 0, 0.66, 0.25, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "jobutil", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from jobutil import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L7_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0707, 0.0101, 0, 0.66, 0.3333, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__=\"qingkaishi\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L8_C0", "label": "__date__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0808, 0.0101, 0, 0.66, 0.4167, 763, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__date__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__date__ =\"$Apr 21, 2014 9:45:11 AM$\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L10_C0", "label": "alljobs =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.101, 0.0101, 0, 0.66, 0.5, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "alljobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "alljobs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L11_C0", "label": "alljobslock = Lock()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.1111, 0.0101, 0, 0.66, 0.5833, 758, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "alljobslock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": "alljobslock = threading.Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "label": "parse_job_files", "type": "function", "loc": [13, 25], "level": 0, "parent": null, "vector": [2, 0, 0.1919, 0.1313, 0, 0.66, 0.6667, 420, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "parse_job_files", "arg_names": ["group"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_job_files(group):\n jobs = []\n for item in group:\n if item[0].endswith('.json'):\n job = ApsaraJob.parse(item[0], item[1])\n else:\n job = ApsaraJob.parse(item[1], item[0])\n jobs.append(job)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L14_C4", "label": "jobs =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "vector": [14, 1, 0.1414, 0.0101, 1, 0.14, 0.0, 755, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jobs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jobs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L15_C4", "label": "for item", "type": "for", "loc": [15, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "vector": [6, 1, 0.1768, 0.0606, 1, 0.14, 0.25, 434, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in group:\n if item[0].endswith('.json'):\n job = ApsaraJob.parse(item[0], item[1])\n else:\n job = ApsaraJob.parse(item[1], item[0])\n jobs.append(job)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L16_C8", "label": "if", "type": "if", "loc": [16, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L15_C4", "vector": [4, 2, 0.1768, 0.0404, 2, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item[0].endswith('.json'):\n job = ApsaraJob.parse(item[0], item[1])\n else:\n job = ApsaraJob.parse(item[1], item[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L17_C12", "label": "job = parse()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L16_C8", "vector": [14, 3, 0.1717, 0.0101, 3, 0.72, 0.0, 831, 3, 2, 0, 0, 678, 10, 1], "semantic": {"name": "job", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " job = ApsaraJob.parse(item[0], item[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L19_C12", "label": "job = parse()", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L16_C8", "vector": [14, 3, 0.1919, 0.0101, 3, 0.72, 1.0, 831, 3, 2, 0, 0, 678, 10, 1], "semantic": {"name": "job", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " job = ApsaraJob.parse(item[1], item[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L20_C8", "label": "append()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L15_C4", "vector": [8, 2, 0.202, 0.0101, 2, 0.73, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobs.append(job)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L22_C4", "label": "acquire()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "vector": [8, 1, 0.2222, 0.0101, 1, 0.14, 0.5, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " alljobslock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L23_C4", "label": "for item", "type": "for", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "vector": [6, 1, 0.2374, 0.0202, 1, 0.14, 0.75, 434, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in jobs:\n alljobs.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L24_C8", "label": "append()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L23_C4", "vector": [8, 2, 0.2424, 0.0101, 2, 0.3, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " alljobs.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L25_C4", "label": "release()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "vector": [8, 1, 0.2525, 0.0101, 1, 0.14, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " alljobslock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "label": "cpu_count", "type": "function", "loc": [29, 52], "level": 0, "parent": null, "vector": [2, 0, 0.4091, 0.2424, 0, 0.66, 0.75, 240, 0, 0, 1, 0, 0, 0, 5], "semantic": {"name": "cpu_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cpu_count():\n ''' Returns the number of CPUs in the system\n '''\n num = 2\n if sys.platform == 'win32':\n # fetch the cpu count for windows systems\n try:\n num = int(os.environ['NUMBER_OF_PROCESSORS'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "vector": [8, 1, 0.3081, 0.0202, 1, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' Returns the number of CPUs in the system\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L32_C4", "label": "num =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "vector": [14, 1, 0.3232, 0.0101, 1, 0.51, 0.3333, 328, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L33_C4", "label": "if", "type": "if", "loc": [33, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "vector": [4, 1, 0.4192, 0.1818, 1, 0.51, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.platform == 'win32':\n # fetch the cpu count for windows systems\n try:\n num = int(os.environ['NUMBER_OF_PROCESSORS'])\n except (ValueError, KeyError):\n pass\n elif sys.platform == 'darwin':\n # fetch teh cpu count for MacOS X systems"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L35_C8", "label": "try", "type": "try", "loc": [35, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L33_C4", "vector": [7, 2, 0.3687, 0.0404, 2, 0.26, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n num = int(os.environ['NUMBER_OF_PROCESSORS'])\n except (ValueError, KeyError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L36_C12", "label": "num = int()", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L35_C8", "vector": [14, 3, 0.3636, 0.0101, 3, 0.27, 0.0, 328, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " num = int(os.environ['NUMBER_OF_PROCESSORS'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L39_C4", "label": "if", "type": "if", "loc": [39, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L33_C4", "vector": [4, 2, 0.4495, 0.1212, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif sys.platform == 'darwin':\n # fetch teh cpu count for MacOS X systems\n try:\n num = int(os.popen('sysctl -n hw.ncpu').read())\n except ValueError:\n pass\n else:\n # an finally fetch the cpu count for Unix-like systems"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L41_C8", "label": "try", "type": "try", "loc": [41, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L39_C4", "vector": [7, 3, 0.4293, 0.0404, 3, 0.54, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n num = int(os.popen('sysctl -n hw.ncpu').read())\n except ValueError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L42_C12", "label": "num = int()", "type": "assigned_variable", "loc": [42, 42], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L41_C8", "vector": [14, 4, 0.4242, 0.0101, 4, 0.17, 0.0, 328, 3, 1, 0, 0, 901, 10, 3], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " num = int(os.popen('sysctl -n hw.ncpu').read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L47_C8", "label": "try", "type": "try", "loc": [47, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L39_C4", "vector": [7, 3, 0.4899, 0.0404, 3, 0.54, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n num = os.sysconf('SC_NPROCESSORS_ONLN')\n except (ValueError, OSError, AttributeError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L48_C12", "label": "num = sysconf()", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L47_C8", "vector": [14, 4, 0.4848, 0.0101, 4, 0.27, 0.0, 328, 3, 1, 0, 0, 0, 10, 1], "semantic": {"name": "num", "arg_names": [], "import_names": [], "rhs_call_name": "sysconf", "annotation": ""}, "snippet": " num = os.sysconf('SC_NPROCESSORS_ONLN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "vector": [13, 1, 0.5253, 0.0101, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L56_C0", "label": "alljobfiles =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.5657, 0.0101, 0, 0.66, 0.8333, 22, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "alljobfiles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "alljobfiles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "label": "get_all_job_files", "type": "function", "loc": [58, 69], "level": 0, "parent": null, "vector": [2, 0, 0.6414, 0.1212, 0, 0.66, 0.9167, 511, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "get_all_job_files", "arg_names": ["arg", "dirname", "names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_all_job_files(arg, dirname, names):\n jobfiles = []\n for filePath in names:\n file = os.path.join(dirname, filePath);\n if(os.path.isfile(file)):\n if(file.endswith(\".json\")):\n jobfiles.append(file)\n if(file.endswith(\".jobstatus\")):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L59_C4", "label": "jobfiles =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "vector": [14, 1, 0.596, 0.0101, 1, 0.33, 0.0, 728, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jobfiles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jobfiles = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L60_C4", "label": "for filePath", "type": "for", "loc": [60, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "vector": [6, 1, 0.6364, 0.0707, 1, 0.33, 0.5, 172, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "filePath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filePath in names:\n file = os.path.join(dirname, filePath);\n if(os.path.isfile(file)):\n if(file.endswith(\".json\")):\n jobfiles.append(file)\n if(file.endswith(\".jobstatus\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L61_C8", "label": "file = join()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L60_C4", "vector": [14, 2, 0.6162, 0.0101, 2, 0.96, 0.0, 107, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " file = os.path.join(dirname, filePath);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L62_C8", "label": "if", "type": "if", "loc": [62, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L60_C4", "vector": [4, 2, 0.6465, 0.0505, 2, 0.96, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(os.path.isfile(file)):\n if(file.endswith(\".json\")):\n jobfiles.append(file)\n if(file.endswith(\".jobstatus\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L63_C12", "label": "if", "type": "if", "loc": [63, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L62_C8", "vector": [4, 3, 0.6414, 0.0202, 3, 0.0, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(file.endswith(\".json\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L64_C16", "label": "append()", "type": "expression", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L63_C12", "vector": [8, 4, 0.6465, 0.0101, 4, 0.14, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L65_C12", "label": "if", "type": "if", "loc": [65, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L62_C8", "vector": [4, 3, 0.6616, 0.0202, 3, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if(file.endswith(\".jobstatus\")):\n jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L66_C16", "label": "append()", "type": "expression", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L65_C12", "vector": [8, 4, 0.6667, 0.0101, 4, 0.49, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jobfiles.append(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L68_C4", "label": "if", "type": "if", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "vector": [4, 1, 0.6919, 0.0202, 1, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(jobfiles) == 2:\n alljobfiles.append(jobfiles);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L69_C8", "label": "append()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L68_C4", "vector": [8, 2, 0.697, 0.0101, 2, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " alljobfiles.append(jobfiles);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "label": "if", "type": "if", "loc": [71, 98], "level": 0, "parent": null, "vector": [4, 0, 0.8535, 0.2828, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n if os.path.exists(sys.argv[1]) is True:\n os.path.walk(sys.argv[1], get_all_job_files, ())\n \n group = []\n allgroups = []\n for item in alljobfiles:\n group.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L72_C4", "label": "if", "type": "if", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [4, 1, 0.7323, 0.0202, 1, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(sys.argv[1]) is True:\n os.path.walk(sys.argv[1], get_all_job_files, ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L73_C8", "label": "walk()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L72_C4", "vector": [8, 2, 0.7374, 0.0101, 2, 0.91, 0.0, 511, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "walk", "arg_names": [], "import_names": [], "rhs_call_name": "walk", "annotation": ""}, "snippet": " os.path.walk(sys.argv[1], get_all_job_files, ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L75_C4", "label": "group =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [14, 1, 0.7576, 0.0101, 1, 0.21, 0.125, 43, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " group = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L76_C4", "label": "allgroups =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [14, 1, 0.7677, 0.0101, 1, 0.21, 0.25, 555, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "allgroups", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allgroups = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L77_C4", "label": "for item", "type": "for", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [6, 1, 0.7929, 0.0404, 1, 0.21, 0.375, 434, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in alljobfiles:\n group.append(item)\n if len(group) == 100:\n allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L78_C8", "label": "append()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L77_C4", "vector": [8, 2, 0.7879, 0.0101, 2, 0.54, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " group.append(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L77_C4", "vector": [4, 2, 0.803, 0.0202, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(group) == 100:\n allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L80_C12", "label": "append()", "type": "expression", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L79_C8", "vector": [8, 3, 0.8081, 0.0101, 3, 0.22, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L81_C4", "label": "append()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [8, 1, 0.8182, 0.0101, 1, 0.21, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " allgroups.append(group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L83_C4", "label": "cpus = cpu_count()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [14, 1, 0.8384, 0.0101, 1, 0.21, 0.625, 547, 3, 0, 0, 0, 240, 10, 1], "semantic": {"name": "cpus", "arg_names": [], "import_names": [], "rhs_call_name": "cpu_count", "annotation": ""}, "snippet": " cpus = cpu_count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "label": "for ag", "type": "for", "loc": [84, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [6, 1, 0.8939, 0.101, 1, 0.21, 0.75, 36, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "ag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ag in allgroups:\n threadlist = []\n tempthread = threading.Thread(target=parse_job_files, args=(ag, ))\n threadlist.append(tempthread)\n \n if len(threadlist) == cpus:\n for at in threadlist:\n at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L85_C8", "label": "threadlist =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "vector": [14, 2, 0.8586, 0.0101, 2, 0.95, 0.0, 169, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "threadlist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " threadlist = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L86_C8", "label": "tempthread = Thread()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "vector": [14, 2, 0.8687, 0.0101, 2, 0.95, 0.3333, 465, 3, 2, 0, 0, 134, 10, 1], "semantic": {"name": "tempthread", "arg_names": [], "import_names": [], "rhs_call_name": "Thread", "annotation": ""}, "snippet": " tempthread = threading.Thread(target=parse_job_files, args=(ag, ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L87_C8", "label": "append()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "vector": [8, 2, 0.8788, 0.0101, 2, 0.95, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " threadlist.append(tempthread)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L89_C8", "label": "if", "type": "if", "loc": [89, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "vector": [4, 2, 0.9192, 0.0505, 2, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(threadlist) == cpus:\n for at in threadlist:\n at.start()\n for at in threadlist:\n at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L90_C12", "label": "for at", "type": "for", "loc": [90, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L89_C8", "vector": [6, 3, 0.9141, 0.0202, 3, 0.94, 0.0, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L91_C16", "label": "start()", "type": "expression", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L90_C12", "vector": [8, 4, 0.9192, 0.0101, 4, 0.97, 0.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L92_C12", "label": "for at", "type": "for", "loc": [92, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L89_C8", "vector": [6, 3, 0.9343, 0.0202, 3, 0.94, 1.0, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L93_C16", "label": "join()", "type": "expression", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L92_C12", "vector": [8, 4, 0.9394, 0.0101, 4, 0.37, 0.0, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L95_C4", "label": "for at", "type": "for", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [6, 1, 0.9646, 0.0202, 1, 0.21, 0.875, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L96_C8", "label": "start()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L95_C4", "vector": [8, 2, 0.9697, 0.0101, 2, 0.87, 0.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " at.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L97_C4", "label": "for at", "type": "for", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "vector": [6, 1, 0.9848, 0.0202, 1, 0.21, 1.0, 296, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "at", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for at in threadlist:\n at.join();"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L98_C8", "label": "join()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L97_C4", "vector": [8, 2, 0.9899, 0.0101, 2, 0.52, 0.0, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " at.join();"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:Try_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L65_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L92_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:If_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99198:For_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99198:Expr_L98_C8"}] |
#!/usr/bin/python
import cairo, gobject, gtk, gtk.gdk, gtk.glade, os, pygtk, re, sys, thread
BRUSHES_ZOOM = 0.5
DOWN_KEY = 65364
INITIAL_ZOOM = 0.5
LEFT_KEY = 65361
LEVEL_WIDTH = 100
LEVEL_HEIGHT = 100
MAX_ZOOM = 4
MIN_ZOOM = 0.25
RIGHT_KEY = 65363
SCROLL_STEP = 64
SETTINGS_DIR = os.getenv("HOME") + '/.abb_editor'
LAST_BRUSH_PATH = SETTINGS_DIR + '/last_brush.txt'
LAST_LEVEL_PATH = SETTINGS_DIR + '/last_level.txt'
TILE_SIZE = 64
UP_KEY = 65362
ZOOM_STEP = 0.25
class TriggerEditorWindow:
def __init__(self, parent_window, triggers_array, trigger_index):
self._parent_window = parent_window
self._triggers_array = triggers_array
self._trigger_index = trigger_index
self._gladefile = (
os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))
self._tree = gtk.glade.XML(self._gladefile)
# Set up the initial trigger text.
self._entry = self._tree.get_widget('entry')
trigger_text = self._triggers_array[self._trigger_index]
if trigger_text:
self._entry.set_text(trigger_text)
# Connect window signals.
self._window = self._tree.get_widget('window')
signals = { 'on_entry_changed' : self.EntryChangedEvent,
'on_entry_focus_out_event' : self.LoseFocusEvent,
'on_window_key_press_event' : self.KeyPressEvent }
self._tree.signal_autoconnect(signals)
def DestroyWindow(self):
self._window.destroy()
self._parent_window.queue_draw()
def EntryChangedEvent(self, widget):
trigger_text = widget.get_text()
if trigger_text == '':
trigger_text = None
self._triggers_array[self._trigger_index] = trigger_text
def LoseFocusEvent(self, widget, event):
self.DestroyWindow()
def KeyPressEvent(self, widget, event):
if event.keyval == 65293 or event.keyval == 65307: # Escape or enter key.
self.DestroyWindow()
class EditorWindow:
def __init__(self):
self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')
self.tree = gtk.glade.XML(self.gladefile)
# Connect window signals.
self.window = self.tree.get_widget('window')
if (self.window):
self.window.connect("destroy", gtk.main_quit)
self.brushes_widget = self.tree.get_widget('brushes')
self.tiles_widget = self.tree.get_widget('tiles')
signals = { 'on_brushes_expose_event' : self.BrushesExposeEvent,
'on_tiles_expose_event' : self.TilesExposeEvent,
'on_quit_menuitem_activate' : gtk.main_quit,
'on_menuitem_new_activate' : self.NewMenu,
'on_menuitem_loadlevel_activate' : self.LoadLevelMenu,
'on_menuitem_loadbrushes_activate' : self.LoadBrushesMenu,
'on_menuitem_save_activate' : self.SaveLevelMenu,
'on_menuitem_savelevel_activate' : self.SaveLevelAsMenu,
'on_brushes_button_press_event' : self.BrushesClickEvent,
'on_tiles_button_press_event' : self.TilesClickEvent,
'on_tiles_scroll_event' : self.TilesScrollEvent,
'on_window_key_press_event' : self.TilesKeyEvent }
self.tree.signal_autoconnect(signals)
# Initialize misc editor state and clear the document.
self._brushes_surface = None
self._selected_brush = 0
self.NewMenu(None)
# Load last opened files if any such records exist.
if os.path.exists(LAST_BRUSH_PATH):
file_path = open(LAST_BRUSH_PATH).readlines()[0].strip()
if os.path.exists(file_path):
self.LoadBrushesFromFile(file_path)
if os.path.exists(LAST_LEVEL_PATH):
file_path = open(LAST_LEVEL_PATH).readlines()[0].strip()
if os.path.exists(file_path):
self.LoadLevelFromFile(file_path)
def WorldToWindow(self, world_x, world_y):
window_x = world_x * self._view_zoom - self._view_x
window_y = world_y * self._view_zoom - self._view_y
return window_x, window_y
def WindowToWorld(self, window_x, window_y):
world_x = (window_x + self._view_x) / self._view_zoom
world_y = (window_y + self._view_y) / self._view_zoom
return world_x, world_y
def WorldToTileIndex(self, world_x, world_y):
if (world_x < 0 or world_x >= TILE_SIZE * LEVEL_WIDTH or
world_y < 0 or world_y >= TILE_SIZE * LEVEL_HEIGHT):
return -1
return LEVEL_HEIGHT * int(world_x / TILE_SIZE) + int(world_y / TILE_SIZE)
def NewMenu(self, widget):
self._view_x = 0
self._view_y = 0
self._view_zoom = INITIAL_ZOOM
self._tiles = [0] * LEVEL_WIDTH * LEVEL_HEIGHT
self._triggers = [None] * LEVEL_WIDTH * LEVEL_HEIGHT
self._current_file = None
self.SetCleanWindowTitle()
self.window.queue_draw()
def LoadLevelFromFile(self, file_path):
assert file_path
assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)
open(LAST_LEVEL_PATH, 'w').write(file_path)
self._current_file = file_path
self.SetCleanWindowTitle()
level_lines = open(file_path).readlines()
raw_tiles = level_lines[0].strip()
for tile in xrange(LEVEL_WIDTH * LEVEL_HEIGHT):
self._tiles[tile] = ord(raw_tiles[tile]) - ord('a')
self._triggers = []
for n in xrange(0, LEVEL_WIDTH * LEVEL_HEIGHT):
self._triggers.append(None)
trigger_re = re.compile('(\\d+),(\\d+),"([^"]+)"')
for raw_trigger in level_lines[1:]:
match = trigger_re.match(raw_trigger.strip())
assert match
x = int(match.group(1))
y = int(match.group(2))
trigger = match.group(3)
trigger_index = LEVEL_HEIGHT * x + y
self._triggers[trigger_index] = trigger
self.window.queue_draw()
def LoadLevelMenu(self, widget):
file_path = self.ChooseOpenFile()
if file_path:
self.LoadLevelFromFile(file_path)
def LoadBrushesFromFile(self, file_path):
assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)
open(LAST_BRUSH_PATH, 'w').write(file_path)
self._brushes_surface = cairo.ImageSurface.create_from_png(file_path)
self.window.queue_draw()
def LoadBrushesMenu(self, widget):
file_path = self.ChooseOpenFile()
if file_path:
self.LoadBrushesFromFile(file_path)
def SetDirtyWindowTitle(self):
if self._current_file:
window_title = self.window.get_title()
if window_title[0] != '*':
self.window.set_title('*' + self._current_file)
else:
self.window.set_title('*(Unsaved Level)')
def SetCleanWindowTitle(self):
if self._current_file:
self.window.set_title(self._current_file)
else:
self.window.set_title('(Unsaved Level)')
def SaveLevelToFile(self, file_path):
assert file_path
self._current_file = file_path
self.SetCleanWindowTitle()
level_string = map(lambda tile : '%c' % (tile + ord('a')), self._tiles)
level_file = open(file_path, 'w')
level_file.write(''.join(level_string))
for x in xrange(0, LEVEL_WIDTH):
for y in xrange(0, LEVEL_HEIGHT):
index = LEVEL_HEIGHT * x + y
trigger_string = self._triggers[index];
if trigger_string:
level_file.write('\n%d,%d,"%s"' % (x, y, trigger_string))
def SaveLevelMenu(self, widget):
if self._current_file:
self.SaveLevelToFile(self._current_file)
else:
self.SaveLevelAsMenu(widget)
def SaveLevelAsMenu(self, widget):
file_path = self.ChooseSaveFile()
if file_path:
assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)
open(LAST_LEVEL_PATH, 'w').write(file_path)
self.SaveLevelToFile(file_path)
def BrushesClickEvent(self, widget, event):
self._selected_brush = int(event.y / BRUSHES_ZOOM / TILE_SIZE)
self.window.queue_draw()
def BrushesExposeEvent(self, widget, event):
# Documentation for drawing using Cairo was found on:
# http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm
# Cairo within Python documentation was found on:
# http://www.cairographics.org/pycairo
if self._brushes_surface:
cairo_context = widget.window.cairo_create()
cairo_context.rectangle(
event.area.x, event.area.y, event.area.width, event.area.height)
cairo_context.clip()
cairo_context.scale(BRUSHES_ZOOM, BRUSHES_ZOOM)
cairo_context.set_source_surface(self._brushes_surface, 0, 0)
cairo_context.paint()
cairo_context.rectangle(
0, TILE_SIZE * self._selected_brush, TILE_SIZE, TILE_SIZE)
cairo_context.set_line_width(6)
cairo_context.set_source_rgba(1, 0, 0, 1)
cairo_context.stroke()
return False
def TilesClickEvent(self, widget, event):
if not self._brushes_surface:
return
world_x, world_y = self.WindowToWorld(event.x, event.y)
tile_index = self.WorldToTileIndex(world_x, world_y)
if tile_index == -1:
return # Map tile out of bounds.
if event.button == 1: # Left click.
self._tiles[tile_index] = self._selected_brush
self._triggers[tile_index] = None
self.window.queue_draw()
self.SetDirtyWindowTitle()
elif event.button == 3: # Right click.
trigger_editor_window = (
TriggerEditorWindow(self.window, self._triggers, tile_index))
self.window.queue_draw()
self.SetDirtyWindowTitle()
def TilesKeyEvent(self, widget, event):
if event.keyval == LEFT_KEY:
self._view_x -= SCROLL_STEP * self._view_zoom
elif event.keyval == RIGHT_KEY:
self._view_x += SCROLL_STEP * self._view_zoom
elif event.keyval == UP_KEY:
self._view_y -= SCROLL_STEP * self._view_zoom
elif event.keyval == DOWN_KEY:
self._view_y += SCROLL_STEP * self._view_zoom
self.window.queue_draw()
def TilesScrollEvent(self, widget, event):
old_world_x, old_world_y = self.WindowToWorld(event.x, event.y)
if event.direction == 0:
self._view_zoom += ZOOM_STEP
elif event.direction == 1:
self._view_zoom -= ZOOM_STEP
self._view_zoom = max(self._view_zoom, MIN_ZOOM)
self._view_zoom = min(self._view_zoom, MAX_ZOOM)
# Zoom around the mouse pointer.
new_world_x, new_world_y = self.WindowToWorld(event.x, event.y)
self._view_x += (old_world_x - new_world_x) * self._view_zoom
self._view_y += (old_world_y - new_world_y) * self._view_zoom
self.window.queue_draw()
def TilesExposeEvent(self, widget, event):
# See comment in BrushesExposeEvent for Cairo documentation.
if self._brushes_surface:
cairo_context = widget.window.cairo_create()
brushes_pattern = cairo.SurfacePattern(self._brushes_surface)
brushes_pattern.set_filter(cairo.FILTER_FAST)
zoomed_tile_size = TILE_SIZE * self._view_zoom
x = 0
y = 0
while x <= event.area.width + zoomed_tile_size:
while y <= event.area.height + zoomed_tile_size:
world_x, world_y = self.WindowToWorld(x, y)
tile_index = self.WorldToTileIndex(world_x, world_y)
if tile_index == -1:
y += zoomed_tile_size
continue # Map tile out of bounds.
tile_x = TILE_SIZE * int(world_x / TILE_SIZE)
tile_y = TILE_SIZE * int(world_y / TILE_SIZE)
window_x, window_y = self.WorldToWindow(tile_x, tile_y)
cairo_context.identity_matrix()
cairo_context.reset_clip()
cairo_context.rectangle(
window_x, window_y, zoomed_tile_size, zoomed_tile_size)
cairo_context.set_source_rgba(0, 0, 0, 1)
cairo_context.fill()
tile_id = self._tiles[tile_index]
trigger = self._triggers[tile_index]
if tile_id != 0:
cairo_context.save()
cairo_context.rectangle(
window_x, window_y, zoomed_tile_size, zoomed_tile_size)
cairo_context.clip()
cairo_context.translate(window_x, window_y);
cairo_context.scale(self._view_zoom, self._view_zoom)
cairo_context.translate(0, -TILE_SIZE * tile_id)
cairo_context.set_source(brushes_pattern)
cairo_context.paint()
cairo_context.restore()
if trigger != None:
half_tile_size = TILE_SIZE / 2
cairo_context.save()
cairo_context.translate(window_x, window_y)
cairo_context.scale(self._view_zoom, self._view_zoom)
cairo_context.translate(half_tile_size, half_tile_size)
cairo_context.arc(
0.0, 0.0, half_tile_size - 10, 0.0, 2.0 * 3.1415926)
cairo_context.set_source_rgba(1, 1, 0.5, 0.7)
cairo_context.set_line_width(3)
cairo_context.stroke()
cairo_context.restore()
y += zoomed_tile_size
x += zoomed_tile_size
y = 0
else:
cairo_context = widget.window.cairo_create()
cairo_context.select_font_face("Sans")
cairo_context.set_font_size(18)
cairo_context.move_to(event.area.width / 2, event.area.height / 2)
cairo_context.show_text("No tile set loaded.")
return False
def ChooseOpenFile(self):
chooser = gtk.FileChooserDialog(
title = None,action=gtk.FILE_CHOOSER_ACTION_OPEN,
buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,
gtk.RESPONSE_OK))
response = chooser.run()
result = None
if response == gtk.RESPONSE_OK:
result = chooser.get_filename()
chooser.destroy()
return result
def ChooseSaveFile(self):
chooser = gtk.FileChooserDialog(
title = None,action=gtk.FILE_CHOOSER_ACTION_SAVE,
buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,
gtk.RESPONSE_OK))
response = chooser.run()
result = None
if response == gtk.RESPONSE_OK:
result = chooser.get_filename()
chooser.destroy()
return result
if __name__ == "__main__":
gobject.threads_init()
editor_window = EditorWindow()
gtk.main()
| ajibawa-2023/Python-Code-Large/train/row_99199 | 267 | 377 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Import_L3_C0", "label": "cairo import cairo, gobject, gtk\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.008, 0.0027, 0, 0.66, 0.0, 747, 0, 10, 0, 0, 747, 0, 0], "semantic": {"name": "cairo", "arg_names": [], "import_names": ["cairo", "gobject", "gtk", "gtk.gdk", "gtk.glade", "os", "pygtk", "re", "sys", "thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cairo, gobject, gtk, gtk.gdk, gtk.glade, os, pygtk, re, sys, thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L6_C0", "label": "BRUSHES_ZOOM =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0159, 0.0027, 0, 0.66, 0.0526, 826, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "BRUSHES_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BRUSHES_ZOOM = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L7_C0", "label": "DOWN_KEY =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0186, 0.0027, 0, 0.66, 0.1053, 313, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "DOWN_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DOWN_KEY = 65364"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L8_C0", "label": "INITIAL_ZOOM =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0212, 0.0027, 0, 0.66, 0.1579, 242, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "INITIAL_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INITIAL_ZOOM = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L9_C0", "label": "LEFT_KEY =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0239, 0.0027, 0, 0.66, 0.2105, 505, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LEFT_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEFT_KEY = 65361"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L10_C0", "label": "LEVEL_WIDTH =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0265, 0.0027, 0, 0.66, 0.2632, 116, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LEVEL_WIDTH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEVEL_WIDTH = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L11_C0", "label": "LEVEL_HEIGHT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.0292, 0.0027, 0, 0.66, 0.3158, 950, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LEVEL_HEIGHT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEVEL_HEIGHT = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L12_C0", "label": "MAX_ZOOM =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0318, 0.0027, 0, 0.66, 0.3684, 834, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MAX_ZOOM = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L13_C0", "label": "MIN_ZOOM =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0345, 0.0027, 0, 0.66, 0.4211, 236, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "MIN_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MIN_ZOOM = 0.25"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L14_C0", "label": "RIGHT_KEY =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.0371, 0.0027, 0, 0.66, 0.4737, 954, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "RIGHT_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RIGHT_KEY = 65363"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L15_C0", "label": "SCROLL_STEP =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.0398, 0.0027, 0, 0.66, 0.5263, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SCROLL_STEP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCROLL_STEP = 64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L16_C0", "label": "SETTINGS_DIR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.0424, 0.0027, 0, 0.66, 0.5789, 250, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SETTINGS_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SETTINGS_DIR = os.getenv(\"HOME\") + '/.abb_editor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L17_C0", "label": "LAST_BRUSH_PATH =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0451, 0.0027, 0, 0.66, 0.6316, 465, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "LAST_BRUSH_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LAST_BRUSH_PATH = SETTINGS_DIR + '/last_brush.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L18_C0", "label": "LAST_LEVEL_PATH =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.0477, 0.0027, 0, 0.66, 0.6842, 178, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "LAST_LEVEL_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LAST_LEVEL_PATH = SETTINGS_DIR + '/last_level.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L19_C0", "label": "TILE_SIZE =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.0504, 0.0027, 0, 0.66, 0.7368, 381, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TILE_SIZE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TILE_SIZE = 64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L20_C0", "label": "UP_KEY =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0531, 0.0027, 0, 0.66, 0.7895, 378, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "UP_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "UP_KEY = 65362"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L21_C0", "label": "ZOOM_STEP =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.0557, 0.0027, 0, 0.66, 0.8421, 21, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ZOOM_STEP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ZOOM_STEP = 0.25"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "label": "TriggerEditorWindow", "type": "class", "loc": [24, 61], "level": 0, "parent": null, "vector": [3, 0, 0.1127, 0.1008, 0, 0.66, 0.8947, 566, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "TriggerEditorWindow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TriggerEditorWindow:\n def __init__(self, parent_window, triggers_array, trigger_index):\n self._parent_window = parent_window\n self._triggers_array = triggers_array\n self._trigger_index = trigger_index\n self._gladefile = (\n os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))\n self._tree = gtk.glade.XML(self._gladefile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "label": "__init__", "type": "function", "loc": [25, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "vector": [2, 1, 0.0915, 0.0531, 1, 0.15, 0.0, 555, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "parent_window", "triggers_array", "trigger_index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent_window, triggers_array, trigger_index):\n self._parent_window = parent_window\n self._triggers_array = triggers_array\n self._trigger_index = trigger_index\n self._gladefile = (\n os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))\n self._tree = gtk.glade.XML(self._gladefile)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L26_C4", "label": "self._parent_window =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.069, 0.0027, 2, 0.6, 0.0, 873, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._parent_window", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._parent_window = parent_window"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L27_C4", "label": "self._triggers_array =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.0716, 0.0027, 2, 0.6, 0.1, 75, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._triggers_array", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers_array = triggers_array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L28_C4", "label": "self._trigger_index =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.0743, 0.0027, 2, 0.6, 0.2, 439, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._trigger_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._trigger_index = trigger_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L29_C4", "label": "self._gladefile = join()", "type": "assigned_variable", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.0782, 0.0053, 2, 0.6, 0.3, 772, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self._gladefile", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self._gladefile = (\n os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L31_C4", "label": "self._tree = XML()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.0822, 0.0027, 2, 0.6, 0.4, 582, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "self._tree", "arg_names": [], "import_names": [], "rhs_call_name": "XML", "annotation": ""}, "snippet": " self._tree = gtk.glade.XML(self._gladefile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L34_C4", "label": "self._entry = get_widget()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.0902, 0.0027, 2, 0.6, 0.5, 285, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self._entry", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self._entry = self._tree.get_widget('entry')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L35_C4", "label": "trigger_text =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.0928, 0.0027, 2, 0.6, 0.6, 102, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_text = self._triggers_array[self._trigger_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L36_C4", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [4, 2, 0.0968, 0.0053, 2, 0.6, 0.7, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger_text:\n self._entry.set_text(trigger_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L37_C6", "label": "set_text()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L36_C4", "vector": [8, 3, 0.0981, 0.0027, 3, 0.61, 0.0, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self._entry.set_text(trigger_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L40_C4", "label": "self._window = get_widget()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.1061, 0.0027, 2, 0.6, 0.8, 509, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self._window", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self._window = self._tree.get_widget('window')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L41_C4", "label": "signals =", "type": "assigned_variable", "loc": [41, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [14, 2, 0.1114, 0.008, 2, 0.6, 0.9, 415, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signals = { 'on_entry_changed' : self.EntryChangedEvent,\n 'on_entry_focus_out_event' : self.LoseFocusEvent,\n 'on_window_key_press_event' : self.KeyPressEvent }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L44_C4", "label": "signal_autoconnect()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "vector": [8, 2, 0.1167, 0.0027, 2, 0.6, 1.0, 665, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "signal_autoconnect", "arg_names": [], "import_names": [], "rhs_call_name": "signal_autoconnect", "annotation": ""}, "snippet": " self._tree.signal_autoconnect(signals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L46_C2", "label": "DestroyWindow", "type": "function", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "vector": [2, 1, 0.1247, 0.008, 1, 0.15, 0.25, 578, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "DestroyWindow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def DestroyWindow(self):\n self._window.destroy()\n self._parent_window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L47_C4", "label": "destroy()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L46_C2", "vector": [8, 2, 0.1247, 0.0027, 2, 0.12, 0.0, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " self._window.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L48_C4", "label": "queue_draw()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L46_C2", "vector": [8, 2, 0.1273, 0.0027, 2, 0.12, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self._parent_window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "label": "EntryChangedEvent", "type": "function", "loc": [50, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "vector": [2, 1, 0.1379, 0.0133, 1, 0.15, 0.5, 69, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "EntryChangedEvent", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def EntryChangedEvent(self, widget):\n trigger_text = widget.get_text()\n if trigger_text == '':\n trigger_text = None\n self._triggers_array[self._trigger_index] = trigger_text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L51_C4", "label": "trigger_text = get_text()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "vector": [14, 2, 0.1353, 0.0027, 2, 0.87, 0.0, 102, 3, 0, 0, 0, 530, 10, 1], "semantic": {"name": "trigger_text", "arg_names": [], "import_names": [], "rhs_call_name": "get_text", "annotation": ""}, "snippet": " trigger_text = widget.get_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L52_C4", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "vector": [4, 2, 0.1393, 0.0053, 2, 0.87, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger_text == '':\n trigger_text = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L53_C6", "label": "trigger_text =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L52_C4", "vector": [14, 3, 0.1406, 0.0027, 3, 0.62, 0.0, 102, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "trigger_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_text = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L54_C4", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "vector": [14, 2, 0.1432, 0.0027, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers_array[self._trigger_index] = trigger_text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L56_C2", "label": "LoseFocusEvent", "type": "function", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "vector": [2, 1, 0.1499, 0.0053, 1, 0.15, 0.75, 318, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "LoseFocusEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoseFocusEvent(self, widget, event):\n self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L57_C4", "label": "DestroyWindow()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L56_C2", "vector": [8, 2, 0.1512, 0.0027, 2, 0.98, 0.0, 578, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "DestroyWindow", "arg_names": [], "import_names": [], "rhs_call_name": "DestroyWindow", "annotation": ""}, "snippet": " self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L59_C2", "label": "KeyPressEvent", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "vector": [2, 1, 0.1592, 0.008, 1, 0.15, 1.0, 64, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "KeyPressEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def KeyPressEvent(self, widget, event):\n if event.keyval == 65293 or event.keyval == 65307: # Escape or enter key.\n self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L60_C4", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L59_C2", "vector": [4, 2, 0.1605, 0.0053, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.keyval == 65293 or event.keyval == 65307: # Escape or enter key.\n self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L61_C6", "label": "DestroyWindow()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L60_C4", "vector": [8, 3, 0.1618, 0.0027, 3, 0.07, 0.0, 578, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "DestroyWindow", "arg_names": [], "import_names": [], "rhs_call_name": "DestroyWindow", "annotation": ""}, "snippet": " self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "label": "EditorWindow", "type": "class", "loc": [64, 371], "level": 0, "parent": null, "vector": [3, 0, 0.5769, 0.817, 0, 0.66, 0.9474, 713, 0, 22, 0, 0, 0, 0, 99], "semantic": {"name": "EditorWindow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EditorWindow:\n def __init__(self):\n self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')\n self.tree = gtk.glade.XML(self.gladefile)\n\n # Connect window signals.\n self.window = self.tree.get_widget('window')\n if (self.window):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "label": "__init__", "type": "function", "loc": [65, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.2228, 0.1034, 1, 0.92, 0.0, 555, 0, 1, 0, 0, 0, 0, 21], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')\n self.tree = gtk.glade.XML(self.gladefile)\n\n # Connect window signals.\n self.window = self.tree.get_widget('window')\n if (self.window):\n self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L66_C4", "label": "self.gladefile = join()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.1751, 0.0027, 2, 0.0, 0.0, 605, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self.gladefile", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L67_C4", "label": "self.tree = XML()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.1777, 0.0027, 2, 0.0, 0.0833, 180, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "self.tree", "arg_names": [], "import_names": [], "rhs_call_name": "XML", "annotation": ""}, "snippet": " self.tree = gtk.glade.XML(self.gladefile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L70_C4", "label": "self.window = get_widget()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.1857, 0.0027, 2, 0.0, 0.1667, 313, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.window", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.window = self.tree.get_widget('window')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L71_C4", "label": "if", "type": "if", "loc": [71, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [4, 2, 0.1897, 0.0053, 2, 0.0, 0.25, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.window):\n self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L72_C6", "label": "connect()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L71_C4", "vector": [8, 3, 0.191, 0.0027, 3, 0.5, 0.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L73_C4", "label": "self.brushes_widget = get_widget()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.1936, 0.0027, 2, 0.0, 0.3333, 658, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.brushes_widget", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.brushes_widget = self.tree.get_widget('brushes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L74_C4", "label": "self.tiles_widget = get_widget()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.1963, 0.0027, 2, 0.0, 0.4167, 684, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.tiles_widget", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.tiles_widget = self.tree.get_widget('tiles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L76_C4", "label": "signals =", "type": "assigned_variable", "loc": [76, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.2162, 0.0318, 2, 0.0, 0.5, 415, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signals = { 'on_brushes_expose_event' : self.BrushesExposeEvent,\n 'on_tiles_expose_event' : self.TilesExposeEvent,\n 'on_quit_menuitem_activate' : gtk.main_quit,\n 'on_menuitem_new_activate' : self.NewMenu,\n 'on_menuitem_loadlevel_activate' : self.LoadLevelMenu,\n 'on_menuitem_loadbrushes_activate' : self.LoadBrushesMenu,\n 'on_menuitem_save_activate' : self.SaveLevelMenu,\n 'on_menuitem_savelevel_activate' : self.SaveLevelAsMenu,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L88_C4", "label": "signal_autoconnect()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [8, 2, 0.2334, 0.0027, 2, 0.0, 0.5833, 665, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "signal_autoconnect", "arg_names": [], "import_names": [], "rhs_call_name": "signal_autoconnect", "annotation": ""}, "snippet": " self.tree.signal_autoconnect(signals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L91_C4", "label": "self._brushes_surface =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.2414, 0.0027, 2, 0.0, 0.6667, 171, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._brushes_surface", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._brushes_surface = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L92_C4", "label": "self._selected_brush =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [14, 2, 0.244, 0.0027, 2, 0.0, 0.75, 939, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._selected_brush", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._selected_brush = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L93_C4", "label": "NewMenu()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [8, 2, 0.2467, 0.0027, 2, 0.0, 0.8333, 966, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "NewMenu", "arg_names": [], "import_names": [], "rhs_call_name": "NewMenu", "annotation": ""}, "snippet": " self.NewMenu(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L96_C4", "label": "if", "type": "if", "loc": [96, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [4, 2, 0.2586, 0.0106, 2, 0.0, 0.9167, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(LAST_BRUSH_PATH):\n file_path = open(LAST_BRUSH_PATH).readlines()[0].strip()\n if os.path.exists(file_path):\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L97_C6", "label": "file_path = strip()", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L96_C4", "vector": [14, 3, 0.2573, 0.0027, 3, 0.66, 0.0, 397, 3, 0, 0, 0, 973, 10, 3], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " file_path = open(LAST_BRUSH_PATH).readlines()[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L98_C6", "label": "if", "type": "if", "loc": [98, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L96_C4", "vector": [4, 3, 0.2613, 0.0053, 3, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(file_path):\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L99_C8", "label": "LoadBrushesFromFile()", "type": "expression", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L98_C6", "vector": [8, 4, 0.2626, 0.0027, 4, 0.03, 0.0, 493, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadBrushesFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadBrushesFromFile", "annotation": ""}, "snippet": " self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L100_C4", "label": "if", "type": "if", "loc": [100, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "vector": [4, 2, 0.2692, 0.0106, 2, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(LAST_LEVEL_PATH):\n file_path = open(LAST_LEVEL_PATH).readlines()[0].strip()\n if os.path.exists(file_path):\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L101_C6", "label": "file_path = strip()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L100_C4", "vector": [14, 3, 0.2679, 0.0027, 3, 0.38, 0.0, 397, 3, 0, 0, 0, 973, 10, 3], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " file_path = open(LAST_LEVEL_PATH).readlines()[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L102_C6", "label": "if", "type": "if", "loc": [102, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L100_C4", "vector": [4, 3, 0.2719, 0.0053, 3, 0.38, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(file_path):\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L103_C8", "label": "LoadLevelFromFile()", "type": "expression", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L102_C6", "vector": [8, 4, 0.2732, 0.0027, 4, 0.22, 0.0, 618, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadLevelFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadLevelFromFile", "annotation": ""}, "snippet": " self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "label": "WorldToWindow", "type": "function", "loc": [105, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.2825, 0.0106, 1, 0.92, 0.0476, 128, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "WorldToWindow", "arg_names": ["self", "world_x", "world_y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def WorldToWindow(self, world_x, world_y):\n window_x = world_x * self._view_zoom - self._view_x\n window_y = world_y * self._view_zoom - self._view_y\n return window_x, window_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L106_C4", "label": "window_x =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "vector": [14, 2, 0.2812, 0.0027, 2, 0.59, 0.0, 201, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "window_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_x = world_x * self._view_zoom - self._view_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L107_C4", "label": "window_y =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "vector": [14, 2, 0.2838, 0.0027, 2, 0.59, 0.5, 263, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "window_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_y = world_y * self._view_zoom - self._view_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L108_C4", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "vector": [13, 2, 0.2865, 0.0027, 2, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return window_x, window_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "label": "WindowToWorld", "type": "function", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.2958, 0.0106, 1, 0.92, 0.0952, 372, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "WindowToWorld", "arg_names": ["self", "window_x", "window_y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def WindowToWorld(self, window_x, window_y):\n world_x = (window_x + self._view_x) / self._view_zoom\n world_y = (window_y + self._view_y) / self._view_zoom\n return world_x, world_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L111_C4", "label": "world_x =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "vector": [14, 2, 0.2944, 0.0027, 2, 0.99, 0.0, 24, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "world_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " world_x = (window_x + self._view_x) / self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L112_C4", "label": "world_y =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "vector": [14, 2, 0.2971, 0.0027, 2, 0.99, 0.5, 192, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "world_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " world_y = (window_y + self._view_y) / self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L113_C4", "label": "return", "type": "return", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "vector": [13, 2, 0.2997, 0.0027, 2, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return world_x, world_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L115_C2", "label": "WorldToTileIndex", "type": "function", "loc": [115, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.3103, 0.0133, 1, 0.92, 0.1429, 436, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "WorldToTileIndex", "arg_names": ["self", "world_x", "world_y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def WorldToTileIndex(self, world_x, world_y):\n if (world_x < 0 or world_x >= TILE_SIZE * LEVEL_WIDTH or\n world_y < 0 or world_y >= TILE_SIZE * LEVEL_HEIGHT):\n return -1\n return LEVEL_HEIGHT * int(world_x / TILE_SIZE) + int(world_y / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L116_C4", "label": "if", "type": "if", "loc": [116, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L115_C2", "vector": [4, 2, 0.3103, 0.008, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (world_x < 0 or world_x >= TILE_SIZE * LEVEL_WIDTH or\n world_y < 0 or world_y >= TILE_SIZE * LEVEL_HEIGHT):\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L118_C6", "label": "return", "type": "return", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L116_C4", "vector": [13, 3, 0.313, 0.0027, 3, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L119_C4", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L115_C2", "vector": [13, 2, 0.3156, 0.0027, 2, 0.33, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return LEVEL_HEIGHT * int(world_x / TILE_SIZE) + int(world_y / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "label": "NewMenu", "type": "function", "loc": [121, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.3316, 0.0239, 1, 0.92, 0.1905, 966, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "NewMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def NewMenu(self, widget):\n self._view_x = 0\n self._view_y = 0\n self._view_zoom = INITIAL_ZOOM\n self._tiles = [0] * LEVEL_WIDTH * LEVEL_HEIGHT\n self._triggers = [None] * LEVEL_WIDTH * LEVEL_HEIGHT\n self._current_file = None\n self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L122_C4", "label": "self._view_x =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [14, 2, 0.3236, 0.0027, 2, 0.81, 0.0, 49, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._view_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._view_x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L123_C4", "label": "self._view_y =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [14, 2, 0.3263, 0.0027, 2, 0.81, 0.1429, 742, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._view_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._view_y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L124_C4", "label": "self._view_zoom =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [14, 2, 0.3289, 0.0027, 2, 0.81, 0.2857, 361, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._view_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._view_zoom = INITIAL_ZOOM"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L125_C4", "label": "self._tiles =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [14, 2, 0.3316, 0.0027, 2, 0.81, 0.4286, 394, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._tiles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tiles = [0] * LEVEL_WIDTH * LEVEL_HEIGHT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L126_C4", "label": "self._triggers =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [14, 2, 0.3342, 0.0027, 2, 0.81, 0.5714, 297, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._triggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers = [None] * LEVEL_WIDTH * LEVEL_HEIGHT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L127_C4", "label": "self._current_file =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [14, 2, 0.3369, 0.0027, 2, 0.81, 0.7143, 11, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._current_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_file = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L128_C4", "label": "SetCleanWindowTitle()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [8, 2, 0.3395, 0.0027, 2, 0.81, 0.8571, 341, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetCleanWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetCleanWindowTitle", "annotation": ""}, "snippet": " self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L129_C4", "label": "queue_draw()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "vector": [8, 2, 0.3422, 0.0027, 2, 0.81, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "label": "LoadLevelFromFile", "type": "function", "loc": [131, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.3793, 0.0663, 1, 0.92, 0.2381, 618, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "LoadLevelFromFile", "arg_names": ["self", "file_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadLevelFromFile(self, file_path):\n assert file_path\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_LEVEL_PATH, 'w').write(file_path)\n\n self._current_file = file_path\n self.SetCleanWindowTitle()\n level_lines = open(file_path).readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L134_C4", "label": "write()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [8, 2, 0.3554, 0.0027, 2, 0.16, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(LAST_LEVEL_PATH, 'w').write(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L136_C4", "label": "self._current_file =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [14, 2, 0.3607, 0.0027, 2, 0.16, 0.1, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_file = file_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L137_C4", "label": "SetCleanWindowTitle()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [8, 2, 0.3634, 0.0027, 2, 0.16, 0.2, 341, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetCleanWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetCleanWindowTitle", "annotation": ""}, "snippet": " self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L138_C4", "label": "level_lines = readlines()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [14, 2, 0.366, 0.0027, 2, 0.16, 0.3, 35, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "level_lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": " level_lines = open(file_path).readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L139_C4", "label": "raw_tiles = strip()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [14, 2, 0.3687, 0.0027, 2, 0.16, 0.4, 616, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "raw_tiles", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " raw_tiles = level_lines[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L140_C4", "label": "for tile", "type": "for", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [6, 2, 0.3727, 0.0053, 2, 0.16, 0.5, 319, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tile in xrange(LEVEL_WIDTH * LEVEL_HEIGHT):\n self._tiles[tile] = ord(raw_tiles[tile]) - ord('a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L141_C6", "label": "assign", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L140_C4", "vector": [14, 3, 0.374, 0.0027, 3, 0.06, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tiles[tile] = ord(raw_tiles[tile]) - ord('a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L142_C4", "label": "self._triggers =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [14, 2, 0.3767, 0.0027, 2, 0.16, 0.6, 297, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._triggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L143_C4", "label": "for n", "type": "for", "loc": [143, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [6, 2, 0.3806, 0.0053, 2, 0.16, 0.7, 773, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in xrange(0, LEVEL_WIDTH * LEVEL_HEIGHT):\n self._triggers.append(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L144_C6", "label": "append()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L143_C4", "vector": [8, 3, 0.382, 0.0027, 3, 0.9, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._triggers.append(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L145_C4", "label": "trigger_re = compile()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [14, 2, 0.3846, 0.0027, 2, 0.16, 0.8, 228, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "trigger_re", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " trigger_re = re.compile('(\\\\d+),(\\\\d+),\"([^\"]+)\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "label": "for raw_trigger", "type": "for", "loc": [146, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [6, 2, 0.3966, 0.0212, 2, 0.16, 0.9, 365, 6, 0, 0, 0, 0, 0, 7], "semantic": {"name": "raw_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for raw_trigger in level_lines[1:]:\n match = trigger_re.match(raw_trigger.strip())\n assert match\n x = int(match.group(1))\n y = int(match.group(2))\n trigger = match.group(3)\n trigger_index = LEVEL_HEIGHT * x + y\n self._triggers[trigger_index] = trigger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L147_C6", "label": "match = match()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "vector": [14, 3, 0.3899, 0.0027, 3, 0.27, 0.0, 36, 3, 1, 0, 0, 36, 10, 2], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " match = trigger_re.match(raw_trigger.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L149_C6", "label": "x = int()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "vector": [14, 3, 0.3952, 0.0027, 3, 0.27, 0.2, 190, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " x = int(match.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L150_C6", "label": "y = int()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "vector": [14, 3, 0.3979, 0.0027, 3, 0.27, 0.4, 304, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " y = int(match.group(2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L151_C6", "label": "trigger = group()", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "vector": [14, 3, 0.4005, 0.0027, 3, 0.27, 0.6, 426, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "trigger", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " trigger = match.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L152_C6", "label": "trigger_index =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "vector": [14, 3, 0.4032, 0.0027, 3, 0.27, 0.8, 465, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_index = LEVEL_HEIGHT * x + y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L153_C6", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "vector": [14, 3, 0.4058, 0.0027, 3, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers[trigger_index] = trigger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L155_C4", "label": "queue_draw()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "vector": [8, 2, 0.4111, 0.0027, 2, 0.16, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L157_C2", "label": "LoadLevelMenu", "type": "function", "loc": [157, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.4204, 0.0106, 1, 0.92, 0.2857, 614, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "LoadLevelMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadLevelMenu(self, widget):\n file_path = self.ChooseOpenFile()\n if file_path:\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L158_C4", "label": "file_path = ChooseOpenFile()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L157_C2", "vector": [14, 2, 0.4191, 0.0027, 2, 0.75, 0.0, 397, 3, 0, 0, 0, 836, 10, 1], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "ChooseOpenFile", "annotation": ""}, "snippet": " file_path = self.ChooseOpenFile()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L159_C4", "label": "if", "type": "if", "loc": [159, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L157_C2", "vector": [4, 2, 0.4231, 0.0053, 2, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_path:\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L160_C6", "label": "LoadLevelFromFile()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L159_C4", "vector": [8, 3, 0.4244, 0.0027, 3, 0.61, 0.0, 618, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadLevelFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadLevelFromFile", "annotation": ""}, "snippet": " self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "label": "LoadBrushesFromFile", "type": "function", "loc": [162, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.435, 0.0133, 1, 0.92, 0.3333, 493, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "LoadBrushesFromFile", "arg_names": ["self", "file_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadBrushesFromFile(self, file_path):\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_BRUSH_PATH, 'w').write(file_path)\n self._brushes_surface = cairo.ImageSurface.create_from_png(file_path)\n self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L164_C4", "label": "write()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "vector": [8, 2, 0.435, 0.0027, 2, 0.89, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(LAST_BRUSH_PATH, 'w').write(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L165_C4", "label": "self._brushes_surface = create_from_png()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "vector": [14, 2, 0.4377, 0.0027, 2, 0.89, 0.5, 171, 3, 1, 0, 0, 509, 10, 1], "semantic": {"name": "self._brushes_surface", "arg_names": [], "import_names": [], "rhs_call_name": "create_from_png", "annotation": ""}, "snippet": " self._brushes_surface = cairo.ImageSurface.create_from_png(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L166_C4", "label": "queue_draw()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "vector": [8, 2, 0.4403, 0.0027, 2, 0.89, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L168_C2", "label": "LoadBrushesMenu", "type": "function", "loc": [168, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.4496, 0.0106, 1, 0.92, 0.381, 503, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "LoadBrushesMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadBrushesMenu(self, widget):\n file_path = self.ChooseOpenFile()\n if file_path:\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L169_C4", "label": "file_path = ChooseOpenFile()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L168_C2", "vector": [14, 2, 0.4483, 0.0027, 2, 0.31, 0.0, 397, 3, 0, 0, 0, 836, 10, 1], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "ChooseOpenFile", "annotation": ""}, "snippet": " file_path = self.ChooseOpenFile()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L170_C4", "label": "if", "type": "if", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L168_C2", "vector": [4, 2, 0.4523, 0.0053, 2, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_path:\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L171_C6", "label": "LoadBrushesFromFile()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L170_C4", "vector": [8, 3, 0.4536, 0.0027, 3, 0.14, 0.0, 493, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadBrushesFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadBrushesFromFile", "annotation": ""}, "snippet": " self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L173_C2", "label": "SetDirtyWindowTitle", "type": "function", "loc": [173, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.4668, 0.0186, 1, 0.92, 0.4286, 598, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "SetDirtyWindowTitle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SetDirtyWindowTitle(self):\n if self._current_file:\n window_title = self.window.get_title()\n if window_title[0] != '*':\n self.window.set_title('*' + self._current_file)\n else:\n self.window.set_title('*(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "label": "if", "type": "if", "loc": [174, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L173_C2", "vector": [4, 2, 0.4682, 0.0159, 2, 0.18, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_file:\n window_title = self.window.get_title()\n if window_title[0] != '*':\n self.window.set_title('*' + self._current_file)\n else:\n self.window.set_title('*(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L175_C6", "label": "window_title = get_title()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "vector": [14, 3, 0.4642, 0.0027, 3, 0.48, 0.0, 614, 3, 0, 0, 0, 470, 10, 1], "semantic": {"name": "window_title", "arg_names": [], "import_names": [], "rhs_call_name": "get_title", "annotation": ""}, "snippet": " window_title = self.window.get_title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L176_C6", "label": "if", "type": "if", "loc": [176, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "vector": [4, 3, 0.4682, 0.0053, 3, 0.48, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if window_title[0] != '*':\n self.window.set_title('*' + self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L177_C8", "label": "set_title()", "type": "expression", "loc": [177, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L176_C6", "vector": [8, 4, 0.4695, 0.0027, 4, 0.92, 0.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title('*' + self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L179_C6", "label": "set_title()", "type": "expression", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "vector": [8, 3, 0.4748, 0.0027, 3, 0.48, 1.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title('*(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L181_C2", "label": "SetCleanWindowTitle", "type": "function", "loc": [181, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.4854, 0.0133, 1, 0.92, 0.4762, 341, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "SetCleanWindowTitle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SetCleanWindowTitle(self):\n if self._current_file:\n self.window.set_title(self._current_file)\n else:\n self.window.set_title('(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L182_C4", "label": "if", "type": "if", "loc": [182, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L181_C2", "vector": [4, 2, 0.4867, 0.0106, 2, 0.21, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_file:\n self.window.set_title(self._current_file)\n else:\n self.window.set_title('(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L183_C6", "label": "set_title()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L182_C4", "vector": [8, 3, 0.4854, 0.0027, 3, 0.92, 0.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title(self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L185_C6", "label": "set_title()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L182_C4", "vector": [8, 3, 0.4907, 0.0027, 3, 0.92, 1.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title('(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "label": "SaveLevelToFile", "type": "function", "loc": [187, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.5119, 0.0345, 1, 0.92, 0.5238, 147, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "SaveLevelToFile", "arg_names": ["self", "file_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SaveLevelToFile(self, file_path):\n assert file_path\n self._current_file = file_path\n self.SetCleanWindowTitle()\n level_string = map(lambda tile : '%c' % (tile + ord('a')), self._tiles)\n level_file = open(file_path, 'w')\n level_file.write(''.join(level_string))\n for x in xrange(0, LEVEL_WIDTH):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L189_C4", "label": "self._current_file =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "vector": [14, 2, 0.5013, 0.0027, 2, 0.74, 0.0, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_file = file_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L190_C4", "label": "SetCleanWindowTitle()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "vector": [8, 2, 0.504, 0.0027, 2, 0.74, 0.2, 341, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetCleanWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetCleanWindowTitle", "annotation": ""}, "snippet": " self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L191_C4", "label": "level_string = map()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "vector": [14, 2, 0.5066, 0.0027, 2, 0.74, 0.4, 487, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "level_string", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " level_string = map(lambda tile : '%c' % (tile + ord('a')), self._tiles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L192_C4", "label": "level_file = open()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "vector": [14, 2, 0.5093, 0.0027, 2, 0.74, 0.6, 970, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "level_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " level_file = open(file_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L193_C4", "label": "write()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "vector": [8, 2, 0.5119, 0.0027, 2, 0.74, 0.8, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " level_file.write(''.join(level_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L194_C4", "label": "for x", "type": "for", "loc": [194, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "vector": [6, 2, 0.5212, 0.0159, 2, 0.74, 1.0, 190, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in xrange(0, LEVEL_WIDTH):\n for y in xrange(0, LEVEL_HEIGHT):\n index = LEVEL_HEIGHT * x + y\n trigger_string = self._triggers[index];\n if trigger_string:\n level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "label": "for y", "type": "for", "loc": [195, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L194_C4", "vector": [6, 3, 0.5225, 0.0133, 3, 0.91, 0.0, 304, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in xrange(0, LEVEL_HEIGHT):\n index = LEVEL_HEIGHT * x + y\n trigger_string = self._triggers[index];\n if trigger_string:\n level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L196_C8", "label": "index =", "type": "assigned_variable", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "vector": [14, 4, 0.5199, 0.0027, 4, 0.26, 0.0, 780, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index = LEVEL_HEIGHT * x + y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L197_C8", "label": "trigger_string =", "type": "assigned_variable", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "vector": [14, 4, 0.5225, 0.0027, 4, 0.26, 0.5, 605, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_string = self._triggers[index];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L198_C8", "label": "if", "type": "if", "loc": [198, 199], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "vector": [4, 4, 0.5265, 0.0053, 4, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger_string:\n level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L199_C10", "label": "write()", "type": "expression", "loc": [199, 199], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L198_C8", "vector": [8, 5, 0.5279, 0.0027, 5, 0.31, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L201_C2", "label": "SaveLevelMenu", "type": "function", "loc": [201, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.5385, 0.0133, 1, 0.92, 0.5714, 157, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "SaveLevelMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SaveLevelMenu(self, widget):\n if self._current_file:\n self.SaveLevelToFile(self._current_file)\n else:\n self.SaveLevelAsMenu(widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L202_C4", "label": "if", "type": "if", "loc": [202, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L201_C2", "vector": [4, 2, 0.5398, 0.0106, 2, 0.97, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_file:\n self.SaveLevelToFile(self._current_file)\n else:\n self.SaveLevelAsMenu(widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L203_C6", "label": "SaveLevelToFile()", "type": "expression", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L202_C4", "vector": [8, 3, 0.5385, 0.0027, 3, 0.26, 0.0, 147, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SaveLevelToFile", "arg_names": [], "import_names": [], "rhs_call_name": "SaveLevelToFile", "annotation": ""}, "snippet": " self.SaveLevelToFile(self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L205_C6", "label": "SaveLevelAsMenu()", "type": "expression", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L202_C4", "vector": [8, 3, 0.5438, 0.0027, 3, 0.26, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SaveLevelAsMenu", "arg_names": [], "import_names": [], "rhs_call_name": "SaveLevelAsMenu", "annotation": ""}, "snippet": " self.SaveLevelAsMenu(widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L207_C2", "label": "SaveLevelAsMenu", "type": "function", "loc": [207, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.5557, 0.0159, 1, 0.92, 0.619, 128, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "SaveLevelAsMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SaveLevelAsMenu(self, widget):\n file_path = self.ChooseSaveFile()\n if file_path:\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_LEVEL_PATH, 'w').write(file_path)\n self.SaveLevelToFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L208_C4", "label": "file_path = ChooseSaveFile()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L207_C2", "vector": [14, 2, 0.5517, 0.0027, 2, 0.8, 0.0, 397, 3, 0, 0, 0, 861, 10, 1], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "ChooseSaveFile", "annotation": ""}, "snippet": " file_path = self.ChooseSaveFile()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L209_C4", "label": "if", "type": "if", "loc": [209, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L207_C2", "vector": [4, 2, 0.5584, 0.0106, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_path:\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_LEVEL_PATH, 'w').write(file_path)\n self.SaveLevelToFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L211_C6", "label": "write()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L209_C4", "vector": [8, 3, 0.5597, 0.0027, 3, 0.34, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(LAST_LEVEL_PATH, 'w').write(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L212_C6", "label": "SaveLevelToFile()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L209_C4", "vector": [8, 3, 0.5623, 0.0027, 3, 0.34, 1.0, 147, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SaveLevelToFile", "arg_names": [], "import_names": [], "rhs_call_name": "SaveLevelToFile", "annotation": ""}, "snippet": " self.SaveLevelToFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L214_C2", "label": "BrushesClickEvent", "type": "function", "loc": [214, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.5703, 0.008, 1, 0.92, 0.6667, 25, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "BrushesClickEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def BrushesClickEvent(self, widget, event):\n self._selected_brush = int(event.y / BRUSHES_ZOOM / TILE_SIZE)\n self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L215_C4", "label": "self._selected_brush = int()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L214_C2", "vector": [14, 2, 0.5703, 0.0027, 2, 0.03, 0.0, 939, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self._selected_brush", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self._selected_brush = int(event.y / BRUSHES_ZOOM / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L216_C4", "label": "queue_draw()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L214_C2", "vector": [8, 2, 0.5729, 0.0027, 2, 0.03, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L218_C2", "label": "BrushesExposeEvent", "type": "function", "loc": [218, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.6034, 0.0531, 1, 0.92, 0.7143, 735, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "BrushesExposeEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def BrushesExposeEvent(self, widget, event):\n # Documentation for drawing using Cairo was found on:\n # http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm\n # Cairo within Python documentation was found on:\n # http://www.cairographics.org/pycairo\n if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n cairo_context.rectangle("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "label": "if", "type": "if", "loc": [223, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L218_C2", "vector": [4, 2, 0.6088, 0.0371, 2, 0.29, 0.0, 0, 7, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n cairo_context.rectangle(\n event.area.x, event.area.y, event.area.width, event.area.height)\n cairo_context.clip()\n cairo_context.scale(BRUSHES_ZOOM, BRUSHES_ZOOM)\n cairo_context.set_source_surface(self._brushes_surface, 0, 0)\n cairo_context.paint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L224_C6", "label": "cairo_context = cairo_create()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [14, 3, 0.5942, 0.0027, 3, 0.56, 0.0, 845, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "cairo_context", "arg_names": [], "import_names": [], "rhs_call_name": "cairo_create", "annotation": ""}, "snippet": " cairo_context = widget.window.cairo_create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L225_C6", "label": "rectangle()", "type": "expression", "loc": [225, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.5981, 0.0053, 3, 0.56, 0.1111, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n event.area.x, event.area.y, event.area.width, event.area.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L227_C6", "label": "clip()", "type": "expression", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6021, 0.0027, 3, 0.56, 0.2222, 689, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clip", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " cairo_context.clip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L228_C6", "label": "scale()", "type": "expression", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6048, 0.0027, 3, 0.56, 0.3333, 18, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "scale", "annotation": ""}, "snippet": " cairo_context.scale(BRUSHES_ZOOM, BRUSHES_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L229_C6", "label": "set_source_surface()", "type": "expression", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6074, 0.0027, 3, 0.56, 0.4444, 23, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_surface", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_surface", "annotation": ""}, "snippet": " cairo_context.set_source_surface(self._brushes_surface, 0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L230_C6", "label": "paint()", "type": "expression", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6101, 0.0027, 3, 0.56, 0.5556, 376, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "paint", "arg_names": [], "import_names": [], "rhs_call_name": "paint", "annotation": ""}, "snippet": " cairo_context.paint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L232_C6", "label": "rectangle()", "type": "expression", "loc": [232, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6167, 0.0053, 3, 0.56, 0.6667, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n 0, TILE_SIZE * self._selected_brush, TILE_SIZE, TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L234_C6", "label": "set_line_width()", "type": "expression", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6207, 0.0027, 3, 0.56, 0.7778, 143, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_line_width", "arg_names": [], "import_names": [], "rhs_call_name": "set_line_width", "annotation": ""}, "snippet": " cairo_context.set_line_width(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L235_C6", "label": "set_source_rgba()", "type": "expression", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.6233, 0.0027, 3, 0.56, 0.8889, 979, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_rgba", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_rgba", "annotation": ""}, "snippet": " cairo_context.set_source_rgba(1, 0, 0, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L236_C6", "label": "stroke()", "type": "expression", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "vector": [8, 3, 0.626, 0.0027, 3, 0.56, 1.0, 765, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stroke", "arg_names": [], "import_names": [], "rhs_call_name": "stroke", "annotation": ""}, "snippet": " cairo_context.stroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L237_C4", "label": "return", "type": "return", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L218_C2", "vector": [13, 2, 0.6286, 0.0027, 2, 0.29, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "label": "TilesClickEvent", "type": "function", "loc": [239, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.6565, 0.0477, 1, 0.92, 0.7619, 797, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "TilesClickEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesClickEvent(self, widget, event):\n if not self._brushes_surface:\n return\n\n world_x, world_y = self.WindowToWorld(event.x, event.y)\n tile_index = self.WorldToTileIndex(world_x, world_y)\n if tile_index == -1:\n return # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L240_C4", "label": "if", "type": "if", "loc": [240, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "vector": [4, 2, 0.6379, 0.0053, 2, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._brushes_surface:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L241_C6", "label": "return", "type": "return", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L240_C4", "vector": [13, 3, 0.6393, 0.0027, 3, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L243_C4", "label": "world_x, world_y = WindowToWorld()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "vector": [14, 2, 0.6446, 0.0027, 2, 0.17, 0.25, 151, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "world_x, world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " world_x, world_y = self.WindowToWorld(event.x, event.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L244_C4", "label": "tile_index = WorldToTileIndex()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "vector": [14, 2, 0.6472, 0.0027, 2, 0.17, 0.5, 780, 3, 2, 0, 0, 436, 10, 1], "semantic": {"name": "tile_index", "arg_names": [], "import_names": [], "rhs_call_name": "WorldToTileIndex", "annotation": ""}, "snippet": " tile_index = self.WorldToTileIndex(world_x, world_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L245_C4", "label": "if", "type": "if", "loc": [245, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "vector": [4, 2, 0.6512, 0.0053, 2, 0.17, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tile_index == -1:\n return # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L246_C6", "label": "return", "type": "return", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L245_C4", "vector": [13, 3, 0.6525, 0.0027, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "label": "if", "type": "if", "loc": [247, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "vector": [4, 2, 0.6671, 0.0265, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.button == 1: # Left click.\n self._tiles[tile_index] = self._selected_brush\n self._triggers[tile_index] = None\n self.window.queue_draw()\n self.SetDirtyWindowTitle()\n elif event.button == 3: # Right click.\n trigger_editor_window = (\n TriggerEditorWindow(self.window, self._triggers, tile_index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L248_C6", "label": "assign", "type": "assigned_variable", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "vector": [14, 3, 0.6578, 0.0027, 3, 0.5, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tiles[tile_index] = self._selected_brush"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L249_C6", "label": "assign", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "vector": [14, 3, 0.6605, 0.0027, 3, 0.5, 0.25, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers[tile_index] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L250_C6", "label": "queue_draw()", "type": "expression", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "vector": [8, 3, 0.6631, 0.0027, 3, 0.5, 0.5, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L251_C6", "label": "SetDirtyWindowTitle()", "type": "expression", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "vector": [8, 3, 0.6658, 0.0027, 3, 0.5, 0.75, 598, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetDirtyWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetDirtyWindowTitle", "annotation": ""}, "snippet": " self.SetDirtyWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "label": "if", "type": "if", "loc": [252, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "vector": [4, 3, 0.6737, 0.0133, 3, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.button == 3: # Right click.\n trigger_editor_window = (\n TriggerEditorWindow(self.window, self._triggers, tile_index))\n self.window.queue_draw()\n self.SetDirtyWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L253_C6", "label": "trigger_editor_window = TriggerEditorWindow()", "type": "assigned_variable", "loc": [253, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "vector": [14, 4, 0.6724, 0.0053, 4, 0.17, 0.0, 428, 3, 3, 0, 0, 566, 10, 1], "semantic": {"name": "trigger_editor_window", "arg_names": [], "import_names": [], "rhs_call_name": "TriggerEditorWindow", "annotation": ""}, "snippet": " trigger_editor_window = (\n TriggerEditorWindow(self.window, self._triggers, tile_index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L255_C6", "label": "queue_draw()", "type": "expression", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "vector": [8, 4, 0.6764, 0.0027, 4, 0.17, 0.5, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L256_C6", "label": "SetDirtyWindowTitle()", "type": "expression", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "vector": [8, 4, 0.679, 0.0027, 4, 0.17, 1.0, 598, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetDirtyWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetDirtyWindowTitle", "annotation": ""}, "snippet": " self.SetDirtyWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L258_C2", "label": "TilesKeyEvent", "type": "function", "loc": [258, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.6963, 0.0265, 1, 0.92, 0.8095, 849, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "TilesKeyEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesKeyEvent(self, widget, event):\n if event.keyval == LEFT_KEY:\n self._view_x -= SCROLL_STEP * self._view_zoom\n elif event.keyval == RIGHT_KEY:\n self._view_x += SCROLL_STEP * self._view_zoom\n elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L259_C4", "label": "if", "type": "if", "loc": [259, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L258_C2", "vector": [4, 2, 0.6963, 0.0212, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.keyval == LEFT_KEY:\n self._view_x -= SCROLL_STEP * self._view_zoom\n elif event.keyval == RIGHT_KEY:\n self._view_x += SCROLL_STEP * self._view_zoom\n elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L261_C4", "label": "if", "type": "if", "loc": [261, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L259_C4", "vector": [4, 3, 0.6989, 0.0159, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.keyval == RIGHT_KEY:\n self._view_x += SCROLL_STEP * self._view_zoom\n elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L263_C4", "label": "if", "type": "if", "loc": [263, 266], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L261_C4", "vector": [4, 4, 0.7016, 0.0106, 4, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L265_C4", "label": "if", "type": "if", "loc": [265, 266], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L263_C4", "vector": [4, 5, 0.7042, 0.0053, 5, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L267_C4", "label": "queue_draw()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L258_C2", "vector": [8, 2, 0.7082, 0.0027, 2, 0.43, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "label": "TilesScrollEvent", "type": "function", "loc": [269, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.7294, 0.0345, 1, 0.92, 0.8571, 378, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "TilesScrollEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesScrollEvent(self, widget, event):\n old_world_x, old_world_y = self.WindowToWorld(event.x, event.y)\n if event.direction == 0:\n self._view_zoom += ZOOM_STEP\n elif event.direction == 1:\n self._view_zoom -= ZOOM_STEP\n self._view_zoom = max(self._view_zoom, MIN_ZOOM)\n self._view_zoom = min(self._view_zoom, MAX_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L270_C4", "label": "old_world_x, old_world_y = WindowToWorld()", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "vector": [14, 2, 0.7162, 0.0027, 2, 0.53, 0.0, 26, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "old_world_x, old_world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " old_world_x, old_world_y = self.WindowToWorld(event.x, event.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L271_C4", "label": "if", "type": "if", "loc": [271, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "vector": [4, 2, 0.7228, 0.0106, 2, 0.53, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.direction == 0:\n self._view_zoom += ZOOM_STEP\n elif event.direction == 1:\n self._view_zoom -= ZOOM_STEP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L273_C4", "label": "if", "type": "if", "loc": [273, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L271_C4", "vector": [4, 3, 0.7255, 0.0053, 3, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.direction == 1:\n self._view_zoom -= ZOOM_STEP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L275_C4", "label": "self._view_zoom = max()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "vector": [14, 2, 0.7294, 0.0027, 2, 0.53, 0.4, 361, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "self._view_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " self._view_zoom = max(self._view_zoom, MIN_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L276_C4", "label": "self._view_zoom = min()", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "vector": [14, 2, 0.7321, 0.0027, 2, 0.53, 0.6, 361, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "self._view_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " self._view_zoom = min(self._view_zoom, MAX_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L278_C4", "label": "new_world_x, new_world_y = WindowToWorld()", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "vector": [14, 2, 0.7374, 0.0027, 2, 0.53, 0.8, 573, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "new_world_x, new_world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " new_world_x, new_world_y = self.WindowToWorld(event.x, event.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L281_C4", "label": "queue_draw()", "type": "expression", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "vector": [8, 2, 0.7454, 0.0027, 2, 0.53, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L283_C2", "label": "TilesExposeEvent", "type": "function", "loc": [283, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.8355, 0.1724, 1, 0.92, 0.9048, 795, 0, 3, 1, 0, 0, 0, 36], "semantic": {"name": "TilesExposeEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesExposeEvent(self, widget, event):\n # See comment in BrushesExposeEvent for Cairo documentation.\n if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n brushes_pattern = cairo.SurfacePattern(self._brushes_surface)\n brushes_pattern.set_filter(cairo.FILTER_FAST)\n zoomed_tile_size = TILE_SIZE * self._view_zoom\n x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "label": "if", "type": "if", "loc": [285, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L283_C2", "vector": [4, 2, 0.8369, 0.1645, 2, 0.25, 0.0, 0, 7, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n brushes_pattern = cairo.SurfacePattern(self._brushes_surface)\n brushes_pattern.set_filter(cairo.FILTER_FAST)\n zoomed_tile_size = TILE_SIZE * self._view_zoom\n x = 0\n y = 0\n while x <= event.area.width + zoomed_tile_size:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L286_C6", "label": "cairo_context = cairo_create()", "type": "assigned_variable", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [14, 3, 0.7586, 0.0027, 3, 0.45, 0.0, 845, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "cairo_context", "arg_names": [], "import_names": [], "rhs_call_name": "cairo_create", "annotation": ""}, "snippet": " cairo_context = widget.window.cairo_create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L287_C6", "label": "brushes_pattern = SurfacePattern()", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [14, 3, 0.7613, 0.0027, 3, 0.45, 0.0909, 309, 3, 1, 0, 0, 5, 10, 1], "semantic": {"name": "brushes_pattern", "arg_names": [], "import_names": [], "rhs_call_name": "SurfacePattern", "annotation": ""}, "snippet": " brushes_pattern = cairo.SurfacePattern(self._brushes_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L288_C6", "label": "set_filter()", "type": "expression", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [8, 3, 0.7639, 0.0027, 3, 0.45, 0.1818, 180, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_filter", "arg_names": [], "import_names": [], "rhs_call_name": "set_filter", "annotation": ""}, "snippet": " brushes_pattern.set_filter(cairo.FILTER_FAST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L289_C6", "label": "zoomed_tile_size =", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [14, 3, 0.7666, 0.0027, 3, 0.45, 0.2727, 54, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "zoomed_tile_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zoomed_tile_size = TILE_SIZE * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L290_C6", "label": "x =", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [14, 3, 0.7692, 0.0027, 3, 0.45, 0.3636, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L291_C6", "label": "y =", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [14, 3, 0.7719, 0.0027, 3, 0.45, 0.4545, 304, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L292_C6", "label": "while", "type": "while", "loc": [292, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [5, 3, 0.8382, 0.13, 3, 0.45, 0.5455, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while x <= event.area.width + zoomed_tile_size:\n while y <= event.area.height + zoomed_tile_size:\n world_x, world_y = self.WindowToWorld(x, y)\n tile_index = self.WorldToTileIndex(world_x, world_y)\n if tile_index == -1:\n y += zoomed_tile_size\n continue # Map tile out of bounds.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "label": "while", "type": "while", "loc": [293, 338], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L292_C6", "vector": [5, 4, 0.8369, 0.122, 4, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while y <= event.area.height + zoomed_tile_size:\n world_x, world_y = self.WindowToWorld(x, y)\n tile_index = self.WorldToTileIndex(world_x, world_y)\n if tile_index == -1:\n y += zoomed_tile_size\n continue # Map tile out of bounds.\n\n tile_x = TILE_SIZE * int(world_x / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L294_C10", "label": "world_x, world_y = WindowToWorld()", "type": "assigned_variable", "loc": [294, 294], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.7798, 0.0027, 5, 0.1, 0.0, 151, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "world_x, world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " world_x, world_y = self.WindowToWorld(x, y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L295_C10", "label": "tile_index = WorldToTileIndex()", "type": "assigned_variable", "loc": [295, 295], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.7825, 0.0027, 5, 0.1, 0.0714, 780, 3, 2, 0, 0, 436, 10, 1], "semantic": {"name": "tile_index", "arg_names": [], "import_names": [], "rhs_call_name": "WorldToTileIndex", "annotation": ""}, "snippet": " tile_index = self.WorldToTileIndex(world_x, world_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L296_C10", "label": "if", "type": "if", "loc": [296, 298], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [4, 5, 0.7878, 0.008, 5, 0.1, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tile_index == -1:\n y += zoomed_tile_size\n continue # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L300_C10", "label": "tile_x =", "type": "assigned_variable", "loc": [300, 300], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.7958, 0.0027, 5, 0.1, 0.2143, 422, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tile_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tile_x = TILE_SIZE * int(world_x / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L301_C10", "label": "tile_y =", "type": "assigned_variable", "loc": [301, 301], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.7984, 0.0027, 5, 0.1, 0.2857, 302, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tile_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tile_y = TILE_SIZE * int(world_y / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L302_C10", "label": "window_x, window_y = WorldToWindow()", "type": "assigned_variable", "loc": [302, 302], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.8011, 0.0027, 5, 0.1, 0.3571, 373, 3, 2, 0, 0, 128, 10, 1], "semantic": {"name": "window_x, window_y", "arg_names": [], "import_names": [], "rhs_call_name": "WorldToWindow", "annotation": ""}, "snippet": " window_x, window_y = self.WorldToWindow(tile_x, tile_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L303_C10", "label": "identity_matrix()", "type": "expression", "loc": [303, 303], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [8, 5, 0.8037, 0.0027, 5, 0.1, 0.4286, 990, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "identity_matrix", "arg_names": [], "import_names": [], "rhs_call_name": "identity_matrix", "annotation": ""}, "snippet": " cairo_context.identity_matrix()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L304_C10", "label": "reset_clip()", "type": "expression", "loc": [304, 304], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [8, 5, 0.8064, 0.0027, 5, 0.1, 0.5, 194, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reset_clip", "arg_names": [], "import_names": [], "rhs_call_name": "reset_clip", "annotation": ""}, "snippet": " cairo_context.reset_clip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L305_C10", "label": "rectangle()", "type": "expression", "loc": [305, 306], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [8, 5, 0.8103, 0.0053, 5, 0.1, 0.5714, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n window_x, window_y, zoomed_tile_size, zoomed_tile_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L307_C10", "label": "set_source_rgba()", "type": "expression", "loc": [307, 307], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [8, 5, 0.8143, 0.0027, 5, 0.1, 0.6429, 979, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_rgba", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_rgba", "annotation": ""}, "snippet": " cairo_context.set_source_rgba(0, 0, 0, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L308_C10", "label": "fill()", "type": "expression", "loc": [308, 308], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [8, 5, 0.817, 0.0027, 5, 0.1, 0.7143, 346, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " cairo_context.fill()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L310_C10", "label": "tile_id =", "type": "assigned_variable", "loc": [310, 310], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.8223, 0.0027, 5, 0.1, 0.7857, 145, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tile_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tile_id = self._tiles[tile_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L311_C10", "label": "trigger =", "type": "assigned_variable", "loc": [311, 311], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [14, 5, 0.8249, 0.0027, 5, 0.1, 0.8571, 426, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger = self._triggers[tile_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "label": "if", "type": "if", "loc": [313, 323], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [4, 5, 0.8435, 0.0292, 5, 0.1, 0.9286, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tile_id != 0:\n cairo_context.save()\n cairo_context.rectangle(\n window_x, window_y, zoomed_tile_size, zoomed_tile_size)\n cairo_context.clip()\n cairo_context.translate(window_x, window_y);\n cairo_context.scale(self._view_zoom, self._view_zoom)\n cairo_context.translate(0, -TILE_SIZE * tile_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L314_C12", "label": "save()", "type": "expression", "loc": [314, 314], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8329, 0.0027, 6, 0.72, 0.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " cairo_context.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L315_C12", "label": "rectangle()", "type": "expression", "loc": [315, 316], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8369, 0.0053, 6, 0.72, 0.125, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n window_x, window_y, zoomed_tile_size, zoomed_tile_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L317_C12", "label": "clip()", "type": "expression", "loc": [317, 317], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8408, 0.0027, 6, 0.72, 0.25, 689, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clip", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " cairo_context.clip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L318_C12", "label": "translate()", "type": "expression", "loc": [318, 318], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8435, 0.0027, 6, 0.72, 0.375, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(window_x, window_y);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L319_C12", "label": "scale()", "type": "expression", "loc": [319, 319], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8462, 0.0027, 6, 0.72, 0.5, 18, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "scale", "annotation": ""}, "snippet": " cairo_context.scale(self._view_zoom, self._view_zoom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L320_C12", "label": "translate()", "type": "expression", "loc": [320, 320], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8488, 0.0027, 6, 0.72, 0.625, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(0, -TILE_SIZE * tile_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L321_C12", "label": "set_source()", "type": "expression", "loc": [321, 321], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8515, 0.0027, 6, 0.72, 0.75, 773, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_source", "arg_names": [], "import_names": [], "rhs_call_name": "set_source", "annotation": ""}, "snippet": " cairo_context.set_source(brushes_pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L322_C12", "label": "paint()", "type": "expression", "loc": [322, 322], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8541, 0.0027, 6, 0.72, 0.875, 376, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "paint", "arg_names": [], "import_names": [], "rhs_call_name": "paint", "annotation": ""}, "snippet": " cairo_context.paint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L323_C12", "label": "restore()", "type": "expression", "loc": [323, 323], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "vector": [8, 6, 0.8568, 0.0027, 6, 0.72, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "restore", "arg_names": [], "import_names": [], "rhs_call_name": "restore", "annotation": ""}, "snippet": " cairo_context.restore()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "label": "if", "type": "if", "loc": [325, 336], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "vector": [4, 5, 0.8767, 0.0318, 5, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger != None:\n half_tile_size = TILE_SIZE / 2\n cairo_context.save()\n cairo_context.translate(window_x, window_y)\n cairo_context.scale(self._view_zoom, self._view_zoom)\n cairo_context.translate(half_tile_size, half_tile_size)\n cairo_context.arc(\n 0.0, 0.0, half_tile_size - 10, 0.0, 2.0 * 3.1415926)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L326_C12", "label": "half_tile_size =", "type": "assigned_variable", "loc": [326, 326], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [14, 6, 0.8647, 0.0027, 6, 0.94, 0.0, 791, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "half_tile_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " half_tile_size = TILE_SIZE / 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L327_C12", "label": "save()", "type": "expression", "loc": [327, 327], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8674, 0.0027, 6, 0.94, 0.1111, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " cairo_context.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L328_C12", "label": "translate()", "type": "expression", "loc": [328, 328], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.87, 0.0027, 6, 0.94, 0.2222, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(window_x, window_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L329_C12", "label": "scale()", "type": "expression", "loc": [329, 329], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8727, 0.0027, 6, 0.94, 0.3333, 18, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "scale", "annotation": ""}, "snippet": " cairo_context.scale(self._view_zoom, self._view_zoom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L330_C12", "label": "translate()", "type": "expression", "loc": [330, 330], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8753, 0.0027, 6, 0.94, 0.4444, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(half_tile_size, half_tile_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L331_C12", "label": "arc()", "type": "expression", "loc": [331, 332], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8793, 0.0053, 6, 0.94, 0.5556, 646, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "arc", "arg_names": [], "import_names": [], "rhs_call_name": "arc", "annotation": ""}, "snippet": " cairo_context.arc(\n 0.0, 0.0, half_tile_size - 10, 0.0, 2.0 * 3.1415926)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L333_C12", "label": "set_source_rgba()", "type": "expression", "loc": [333, 333], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8833, 0.0027, 6, 0.94, 0.6667, 979, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_rgba", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_rgba", "annotation": ""}, "snippet": " cairo_context.set_source_rgba(1, 1, 0.5, 0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L334_C12", "label": "set_line_width()", "type": "expression", "loc": [334, 334], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8859, 0.0027, 6, 0.94, 0.7778, 143, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_line_width", "arg_names": [], "import_names": [], "rhs_call_name": "set_line_width", "annotation": ""}, "snippet": " cairo_context.set_line_width(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L335_C12", "label": "stroke()", "type": "expression", "loc": [335, 335], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8886, 0.0027, 6, 0.94, 0.8889, 765, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stroke", "arg_names": [], "import_names": [], "rhs_call_name": "stroke", "annotation": ""}, "snippet": " cairo_context.stroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L336_C12", "label": "restore()", "type": "expression", "loc": [336, 336], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "vector": [8, 6, 0.8912, 0.0027, 6, 0.94, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "restore", "arg_names": [], "import_names": [], "rhs_call_name": "restore", "annotation": ""}, "snippet": " cairo_context.restore()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L340_C8", "label": "y =", "type": "assigned_variable", "loc": [340, 340], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L292_C6", "vector": [14, 4, 0.9019, 0.0027, 4, 0.3, 1.0, 304, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L342_C6", "label": "cairo_context = cairo_create()", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [14, 3, 0.9072, 0.0027, 3, 0.45, 0.6364, 845, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "cairo_context", "arg_names": [], "import_names": [], "rhs_call_name": "cairo_create", "annotation": ""}, "snippet": " cairo_context = widget.window.cairo_create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L343_C6", "label": "select_font_face()", "type": "expression", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [8, 3, 0.9098, 0.0027, 3, 0.45, 0.7273, 633, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "select_font_face", "arg_names": [], "import_names": [], "rhs_call_name": "select_font_face", "annotation": ""}, "snippet": " cairo_context.select_font_face(\"Sans\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L344_C6", "label": "set_font_size()", "type": "expression", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [8, 3, 0.9125, 0.0027, 3, 0.45, 0.8182, 59, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_font_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_font_size", "annotation": ""}, "snippet": " cairo_context.set_font_size(18)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L345_C6", "label": "move_to()", "type": "expression", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [8, 3, 0.9151, 0.0027, 3, 0.45, 0.9091, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_to", "arg_names": [], "import_names": [], "rhs_call_name": "move_to", "annotation": ""}, "snippet": " cairo_context.move_to(event.area.width / 2, event.area.height / 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L346_C6", "label": "show_text()", "type": "expression", "loc": [346, 346], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "vector": [8, 3, 0.9178, 0.0027, 3, 0.45, 1.0, 456, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "show_text", "arg_names": [], "import_names": [], "rhs_call_name": "show_text", "annotation": ""}, "snippet": " cairo_context.show_text(\"No tile set loaded.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L347_C4", "label": "return", "type": "return", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L283_C2", "vector": [13, 2, 0.9204, 0.0027, 2, 0.25, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "label": "ChooseOpenFile", "type": "function", "loc": [349, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.939, 0.0292, 1, 0.92, 0.9524, 836, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "ChooseOpenFile", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ChooseOpenFile(self):\n chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_OPEN,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,\n gtk.RESPONSE_OK))\n response = chooser.run()\n result = None\n if response == gtk.RESPONSE_OK:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L350_C4", "label": "chooser = FileChooserDialog()", "type": "assigned_variable", "loc": [350, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "vector": [14, 2, 0.9324, 0.0106, 2, 0.3, 0.0, 249, 3, 3, 0, 0, 214, 10, 1], "semantic": {"name": "chooser", "arg_names": [], "import_names": [], "rhs_call_name": "FileChooserDialog", "annotation": ""}, "snippet": " chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_OPEN,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,\n gtk.RESPONSE_OK))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L354_C4", "label": "response = run()", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "vector": [14, 2, 0.939, 0.0027, 2, 0.3, 0.2, 511, 3, 0, 0, 0, 679, 10, 1], "semantic": {"name": "response", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " response = chooser.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L355_C4", "label": "result =", "type": "assigned_variable", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "vector": [14, 2, 0.9416, 0.0027, 2, 0.3, 0.4, 51, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L356_C4", "label": "if", "type": "if", "loc": [356, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "vector": [4, 2, 0.9456, 0.0053, 2, 0.3, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response == gtk.RESPONSE_OK:\n result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L357_C6", "label": "result = get_filename()", "type": "assigned_variable", "loc": [357, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L356_C4", "vector": [14, 3, 0.9469, 0.0027, 3, 0.83, 0.0, 51, 3, 0, 0, 0, 676, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_filename", "annotation": ""}, "snippet": " result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L358_C4", "label": "destroy()", "type": "expression", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "vector": [8, 2, 0.9496, 0.0027, 2, 0.3, 0.8, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " chooser.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L359_C4", "label": "return", "type": "return", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "vector": [13, 2, 0.9523, 0.0027, 2, 0.3, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "label": "ChooseSaveFile", "type": "function", "loc": [361, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "vector": [2, 1, 0.9708, 0.0292, 1, 0.92, 1.0, 861, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "ChooseSaveFile", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ChooseSaveFile(self):\n chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_SAVE,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,\n gtk.RESPONSE_OK))\n response = chooser.run()\n result = None\n if response == gtk.RESPONSE_OK:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L362_C4", "label": "chooser = FileChooserDialog()", "type": "assigned_variable", "loc": [362, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "vector": [14, 2, 0.9642, 0.0106, 2, 0.89, 0.0, 249, 3, 3, 0, 0, 214, 10, 1], "semantic": {"name": "chooser", "arg_names": [], "import_names": [], "rhs_call_name": "FileChooserDialog", "annotation": ""}, "snippet": " chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_SAVE,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,\n gtk.RESPONSE_OK))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L366_C4", "label": "response = run()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "vector": [14, 2, 0.9708, 0.0027, 2, 0.89, 0.2, 511, 3, 0, 0, 0, 679, 10, 1], "semantic": {"name": "response", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " response = chooser.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L367_C4", "label": "result =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "vector": [14, 2, 0.9735, 0.0027, 2, 0.89, 0.4, 51, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L368_C4", "label": "if", "type": "if", "loc": [368, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "vector": [4, 2, 0.9775, 0.0053, 2, 0.89, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response == gtk.RESPONSE_OK:\n result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L369_C6", "label": "result = get_filename()", "type": "assigned_variable", "loc": [369, 369], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L368_C4", "vector": [14, 3, 0.9788, 0.0027, 3, 0.29, 0.0, 51, 3, 0, 0, 0, 676, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_filename", "annotation": ""}, "snippet": " result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L370_C4", "label": "destroy()", "type": "expression", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "vector": [8, 2, 0.9814, 0.0027, 2, 0.89, 0.8, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " chooser.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L371_C4", "label": "return", "type": "return", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "vector": [13, 2, 0.9841, 0.0027, 2, 0.89, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "label": "if", "type": "if", "loc": [374, 377], "level": 0, "parent": null, "vector": [4, 0, 0.996, 0.0106, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n gobject.threads_init()\n editor_window = EditorWindow()\n gtk.main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L375_C2", "label": "threads_init()", "type": "expression", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "vector": [8, 1, 0.9947, 0.0027, 1, 0.09, 0.0, 739, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "threads_init", "arg_names": [], "import_names": [], "rhs_call_name": "threads_init", "annotation": ""}, "snippet": " gobject.threads_init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L376_C2", "label": "editor_window = EditorWindow()", "type": "assigned_variable", "loc": [376, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "vector": [14, 1, 0.9973, 0.0027, 1, 0.09, 0.5, 36, 3, 0, 0, 0, 713, 10, 1], "semantic": {"name": "editor_window", "arg_names": [], "import_names": [], "rhs_call_name": "EditorWindow", "annotation": ""}, "snippet": " editor_window = EditorWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L377_C2", "label": "main()", "type": "expression", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "vector": [8, 1, 1.0, 0.0027, 1, 0.09, 1.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " gtk.main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L37_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L53_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L56_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L61_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L72_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L97_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L98_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L98_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L101_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L102_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L102_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L118_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L141_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L144_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L147_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L149_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L150_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L151_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L152_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L153_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L160_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L171_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L173_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L173_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L175_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L176_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L176_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L179_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L183_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L185_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:For_L195_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L199_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L201_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L203_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L211_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L212_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L224_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L225_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L227_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L228_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L229_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L230_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L232_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L234_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L235_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L236_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L241_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L246_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L248_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L249_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L250_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L251_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L253_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L255_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L256_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L283_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L283_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L286_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L287_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L288_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L289_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L290_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L291_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L292_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L292_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L294_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L295_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L296_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L300_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L301_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L302_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L303_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L304_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L305_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L307_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L308_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L310_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L311_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L318_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L319_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L336_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:While_L292_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L342_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L343_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L344_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L345_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L346_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L283_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L357_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L369_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Return_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L375_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Assign_L376_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99199:If_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99199:Expr_L377_C2"}] |
#!/usr/bin/python
import cairo, gobject, gtk, gtk.gdk, gtk.glade, os, pygtk, re, sys, thread
BRUSHES_ZOOM = 0.5
DOWN_KEY = 65364
INITIAL_ZOOM = 0.5
LEFT_KEY = 65361
LEVEL_WIDTH = 100
LEVEL_HEIGHT = 100
MAX_ZOOM = 4
MIN_ZOOM = 0.25
RIGHT_KEY = 65363
SCROLL_STEP = 64
SETTINGS_DIR = os.getenv("HOME") + '/.abb_editor'
LAST_BRUSH_PATH = SETTINGS_DIR + '/last_brush.txt'
LAST_LEVEL_PATH = SETTINGS_DIR + '/last_level.txt'
TILE_SIZE = 64
UP_KEY = 65362
ZOOM_STEP = 0.25
class TriggerEditorWindow:
def __init__(self, parent_window, triggers_array, trigger_index):
self._parent_window = parent_window
self._triggers_array = triggers_array
self._trigger_index = trigger_index
self._gladefile = (
os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))
self._tree = gtk.glade.XML(self._gladefile)
# Set up the initial trigger text.
self._entry = self._tree.get_widget('entry')
trigger_text = self._triggers_array[self._trigger_index]
if trigger_text:
self._entry.set_text(trigger_text)
# Connect window signals.
self._window = self._tree.get_widget('window')
signals = { 'on_entry_changed' : self.EntryChangedEvent,
'on_entry_focus_out_event' : self.LoseFocusEvent,
'on_window_key_press_event' : self.KeyPressEvent }
self._tree.signal_autoconnect(signals)
def DestroyWindow(self):
self._window.destroy()
self._parent_window.queue_draw()
def EntryChangedEvent(self, widget):
trigger_text = widget.get_text()
if trigger_text == '':
trigger_text = None
self._triggers_array[self._trigger_index] = trigger_text
def LoseFocusEvent(self, widget, event):
self.DestroyWindow()
def KeyPressEvent(self, widget, event):
if event.keyval == 65293 or event.keyval == 65307: # Escape or enter key.
self.DestroyWindow()
class EditorWindow:
def __init__(self):
self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')
self.tree = gtk.glade.XML(self.gladefile)
# Connect window signals.
self.window = self.tree.get_widget('window')
if (self.window):
self.window.connect("destroy", gtk.main_quit)
self.brushes_widget = self.tree.get_widget('brushes')
self.tiles_widget = self.tree.get_widget('tiles')
signals = { 'on_brushes_expose_event' : self.BrushesExposeEvent,
'on_tiles_expose_event' : self.TilesExposeEvent,
'on_quit_menuitem_activate' : gtk.main_quit,
'on_menuitem_new_activate' : self.NewMenu,
'on_menuitem_loadlevel_activate' : self.LoadLevelMenu,
'on_menuitem_loadbrushes_activate' : self.LoadBrushesMenu,
'on_menuitem_save_activate' : self.SaveLevelMenu,
'on_menuitem_savelevel_activate' : self.SaveLevelAsMenu,
'on_brushes_button_press_event' : self.BrushesClickEvent,
'on_tiles_button_press_event' : self.TilesClickEvent,
'on_tiles_scroll_event' : self.TilesScrollEvent,
'on_window_key_press_event' : self.TilesKeyEvent }
self.tree.signal_autoconnect(signals)
# Initialize misc editor state and clear the document.
self._brushes_surface = None
self._selected_brush = 0
self.NewMenu(None)
# Load last opened files if any such records exist.
if os.path.exists(LAST_BRUSH_PATH):
file_path = open(LAST_BRUSH_PATH).readlines()[0].strip()
if os.path.exists(file_path):
self.LoadBrushesFromFile(file_path)
if os.path.exists(LAST_LEVEL_PATH):
file_path = open(LAST_LEVEL_PATH).readlines()[0].strip()
if os.path.exists(file_path):
self.LoadLevelFromFile(file_path)
def WorldToWindow(self, world_x, world_y):
window_x = world_x * self._view_zoom - self._view_x
window_y = world_y * self._view_zoom - self._view_y
return window_x, window_y
def WindowToWorld(self, window_x, window_y):
world_x = (window_x + self._view_x) / self._view_zoom
world_y = (window_y + self._view_y) / self._view_zoom
return world_x, world_y
def WorldToTileIndex(self, world_x, world_y):
if (world_x < 0 or world_x >= TILE_SIZE * LEVEL_WIDTH or
world_y < 0 or world_y >= TILE_SIZE * LEVEL_HEIGHT):
return -1
return LEVEL_HEIGHT * int(world_x / TILE_SIZE) + int(world_y / TILE_SIZE)
def NewMenu(self, widget):
self._view_x = 0
self._view_y = 0
self._view_zoom = INITIAL_ZOOM
self._tiles = [0] * LEVEL_WIDTH * LEVEL_HEIGHT
self._triggers = [None] * LEVEL_WIDTH * LEVEL_HEIGHT
self._current_file = None
self.SetCleanWindowTitle()
self.window.queue_draw()
def LoadLevelFromFile(self, file_path):
assert file_path
assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)
open(LAST_LEVEL_PATH, 'w').write(file_path)
self._current_file = file_path
self.SetCleanWindowTitle()
level_lines = open(file_path).readlines()
raw_tiles = level_lines[0].strip()
for tile in xrange(LEVEL_WIDTH * LEVEL_HEIGHT):
self._tiles[tile] = ord(raw_tiles[tile]) - ord('a')
self._triggers = []
for n in xrange(0, LEVEL_WIDTH * LEVEL_HEIGHT):
self._triggers.append(None)
trigger_re = re.compile('(\\d+),(\\d+),"([^"]+)"')
for raw_trigger in level_lines[1:]:
match = trigger_re.match(raw_trigger.strip())
assert match
x = int(match.group(1))
y = int(match.group(2))
trigger = match.group(3)
trigger_index = LEVEL_HEIGHT * x + y
self._triggers[trigger_index] = trigger
self.window.queue_draw()
def LoadLevelMenu(self, widget):
file_path = self.ChooseOpenFile()
if file_path:
self.LoadLevelFromFile(file_path)
def LoadBrushesFromFile(self, file_path):
assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)
open(LAST_BRUSH_PATH, 'w').write(file_path)
self._brushes_surface = cairo.ImageSurface.create_from_png(file_path)
self.window.queue_draw()
def LoadBrushesMenu(self, widget):
file_path = self.ChooseOpenFile()
if file_path:
self.LoadBrushesFromFile(file_path)
def SetDirtyWindowTitle(self):
if self._current_file:
window_title = self.window.get_title()
if window_title[0] != '*':
self.window.set_title('*' + self._current_file)
else:
self.window.set_title('*(Unsaved Level)')
def SetCleanWindowTitle(self):
if self._current_file:
self.window.set_title(self._current_file)
else:
self.window.set_title('(Unsaved Level)')
def SaveLevelToFile(self, file_path):
assert file_path
self._current_file = file_path
self.SetCleanWindowTitle()
level_string = map(lambda tile : '%c' % (tile + ord('a')), self._tiles)
level_file = open(file_path, 'w')
level_file.write(''.join(level_string))
for x in xrange(0, LEVEL_WIDTH):
for y in xrange(0, LEVEL_HEIGHT):
index = LEVEL_HEIGHT * x + y
trigger_string = self._triggers[index];
if trigger_string:
level_file.write('\n%d,%d,"%s"' % (x, y, trigger_string))
def SaveLevelMenu(self, widget):
if self._current_file:
self.SaveLevelToFile(self._current_file)
else:
self.SaveLevelAsMenu(widget)
def SaveLevelAsMenu(self, widget):
file_path = self.ChooseSaveFile()
if file_path:
assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)
open(LAST_LEVEL_PATH, 'w').write(file_path)
self.SaveLevelToFile(file_path)
def BrushesClickEvent(self, widget, event):
self._selected_brush = int(event.y / BRUSHES_ZOOM / TILE_SIZE)
self.window.queue_draw()
def BrushesExposeEvent(self, widget, event):
# Documentation for drawing using Cairo was found on:
# http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm
# Cairo within Python documentation was found on:
# http://www.cairographics.org/pycairo
if self._brushes_surface:
cairo_context = widget.window.cairo_create()
cairo_context.rectangle(
event.area.x, event.area.y, event.area.width, event.area.height)
cairo_context.clip()
cairo_context.scale(BRUSHES_ZOOM, BRUSHES_ZOOM)
cairo_context.set_source_surface(self._brushes_surface, 0, 0)
cairo_context.paint()
cairo_context.rectangle(
0, TILE_SIZE * self._selected_brush, TILE_SIZE, TILE_SIZE)
cairo_context.set_line_width(6)
cairo_context.set_source_rgba(1, 0, 0, 1)
cairo_context.stroke()
return False
def TilesClickEvent(self, widget, event):
if not self._brushes_surface:
return
world_x, world_y = self.WindowToWorld(event.x, event.y)
tile_index = self.WorldToTileIndex(world_x, world_y)
if tile_index == -1:
return # Map tile out of bounds.
if event.button == 1: # Left click.
self._tiles[tile_index] = self._selected_brush
self._triggers[tile_index] = None
self.window.queue_draw()
self.SetDirtyWindowTitle()
elif event.button == 3: # Right click.
trigger_editor_window = (
TriggerEditorWindow(self.window, self._triggers, tile_index))
self.window.queue_draw()
self.SetDirtyWindowTitle()
def TilesKeyEvent(self, widget, event):
if event.keyval == LEFT_KEY:
self._view_x -= SCROLL_STEP * self._view_zoom
elif event.keyval == RIGHT_KEY:
self._view_x += SCROLL_STEP * self._view_zoom
elif event.keyval == UP_KEY:
self._view_y -= SCROLL_STEP * self._view_zoom
elif event.keyval == DOWN_KEY:
self._view_y += SCROLL_STEP * self._view_zoom
self.window.queue_draw()
def TilesScrollEvent(self, widget, event):
old_world_x, old_world_y = self.WindowToWorld(event.x, event.y)
if event.direction == 0:
self._view_zoom += ZOOM_STEP
elif event.direction == 1:
self._view_zoom -= ZOOM_STEP
self._view_zoom = max(self._view_zoom, MIN_ZOOM)
self._view_zoom = min(self._view_zoom, MAX_ZOOM)
# Zoom around the mouse pointer.
new_world_x, new_world_y = self.WindowToWorld(event.x, event.y)
self._view_x += (old_world_x - new_world_x) * self._view_zoom
self._view_y += (old_world_y - new_world_y) * self._view_zoom
self.window.queue_draw()
def TilesExposeEvent(self, widget, event):
# See comment in BrushesExposeEvent for Cairo documentation.
if self._brushes_surface:
cairo_context = widget.window.cairo_create()
brushes_pattern = cairo.SurfacePattern(self._brushes_surface)
brushes_pattern.set_filter(cairo.FILTER_FAST)
zoomed_tile_size = TILE_SIZE * self._view_zoom
x = 0
y = 0
while x <= event.area.width + zoomed_tile_size:
while y <= event.area.height + zoomed_tile_size:
world_x, world_y = self.WindowToWorld(x, y)
tile_index = self.WorldToTileIndex(world_x, world_y)
if tile_index == -1:
y += zoomed_tile_size
continue # Map tile out of bounds.
tile_x = TILE_SIZE * int(world_x / TILE_SIZE)
tile_y = TILE_SIZE * int(world_y / TILE_SIZE)
window_x, window_y = self.WorldToWindow(tile_x, tile_y)
cairo_context.identity_matrix()
cairo_context.reset_clip()
cairo_context.rectangle(
window_x, window_y, zoomed_tile_size, zoomed_tile_size)
cairo_context.set_source_rgba(0, 0, 0, 1)
cairo_context.fill()
tile_id = self._tiles[tile_index]
trigger = self._triggers[tile_index]
if tile_id != 0:
cairo_context.save()
cairo_context.rectangle(
window_x, window_y, zoomed_tile_size, zoomed_tile_size)
cairo_context.clip()
cairo_context.translate(window_x, window_y);
cairo_context.scale(self._view_zoom, self._view_zoom)
cairo_context.translate(0, -TILE_SIZE * tile_id)
cairo_context.set_source(brushes_pattern)
cairo_context.paint()
cairo_context.restore()
if trigger != None:
half_tile_size = TILE_SIZE / 2
cairo_context.save()
cairo_context.translate(window_x, window_y)
cairo_context.scale(self._view_zoom, self._view_zoom)
cairo_context.translate(half_tile_size, half_tile_size)
cairo_context.arc(
0.0, 0.0, half_tile_size - 10, 0.0, 2.0 * 3.1415926)
cairo_context.set_source_rgba(1, 1, 0.5, 0.7)
cairo_context.set_line_width(3)
cairo_context.stroke()
cairo_context.restore()
y += zoomed_tile_size
x += zoomed_tile_size
y = 0
else:
cairo_context = widget.window.cairo_create()
cairo_context.select_font_face("Sans")
cairo_context.set_font_size(18)
cairo_context.move_to(event.area.width / 2, event.area.height / 2)
cairo_context.show_text("No tile set loaded.")
return False
def ChooseOpenFile(self):
chooser = gtk.FileChooserDialog(
title = None,action=gtk.FILE_CHOOSER_ACTION_OPEN,
buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,
gtk.RESPONSE_OK))
response = chooser.run()
result = None
if response == gtk.RESPONSE_OK:
result = chooser.get_filename()
chooser.destroy()
return result
def ChooseSaveFile(self):
chooser = gtk.FileChooserDialog(
title = None,action=gtk.FILE_CHOOSER_ACTION_SAVE,
buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,
gtk.RESPONSE_OK))
response = chooser.run()
result = None
if response == gtk.RESPONSE_OK:
result = chooser.get_filename()
chooser.destroy()
return result
if __name__ == "__main__":
gobject.threads_init()
editor_window = EditorWindow()
gtk.main()
| ajibawa-2023/Python-Code-Large/train/row_99200 | 267 | 377 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Import_L3_C0", "label": "cairo import cairo, gobject, gtk\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.008, 0.0027, 0, 0.66, 0.0, 747, 0, 10, 0, 0, 747, 0, 0], "semantic": {"name": "cairo", "arg_names": [], "import_names": ["cairo", "gobject", "gtk", "gtk.gdk", "gtk.glade", "os", "pygtk", "re", "sys", "thread"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cairo, gobject, gtk, gtk.gdk, gtk.glade, os, pygtk, re, sys, thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L6_C0", "label": "BRUSHES_ZOOM =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0159, 0.0027, 0, 0.66, 0.0526, 826, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "BRUSHES_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BRUSHES_ZOOM = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L7_C0", "label": "DOWN_KEY =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.0186, 0.0027, 0, 0.66, 0.1053, 313, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "DOWN_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DOWN_KEY = 65364"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L8_C0", "label": "INITIAL_ZOOM =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0212, 0.0027, 0, 0.66, 0.1579, 242, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "INITIAL_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INITIAL_ZOOM = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L9_C0", "label": "LEFT_KEY =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0239, 0.0027, 0, 0.66, 0.2105, 505, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LEFT_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEFT_KEY = 65361"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L10_C0", "label": "LEVEL_WIDTH =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0265, 0.0027, 0, 0.66, 0.2632, 116, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LEVEL_WIDTH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEVEL_WIDTH = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L11_C0", "label": "LEVEL_HEIGHT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.0292, 0.0027, 0, 0.66, 0.3158, 950, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LEVEL_HEIGHT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEVEL_HEIGHT = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L12_C0", "label": "MAX_ZOOM =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0318, 0.0027, 0, 0.66, 0.3684, 834, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "MAX_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MAX_ZOOM = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L13_C0", "label": "MIN_ZOOM =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0345, 0.0027, 0, 0.66, 0.4211, 236, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "MIN_ZOOM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MIN_ZOOM = 0.25"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L14_C0", "label": "RIGHT_KEY =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.0371, 0.0027, 0, 0.66, 0.4737, 954, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "RIGHT_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RIGHT_KEY = 65363"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L15_C0", "label": "SCROLL_STEP =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.0398, 0.0027, 0, 0.66, 0.5263, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SCROLL_STEP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SCROLL_STEP = 64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L16_C0", "label": "SETTINGS_DIR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.0424, 0.0027, 0, 0.66, 0.5789, 250, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SETTINGS_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SETTINGS_DIR = os.getenv(\"HOME\") + '/.abb_editor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L17_C0", "label": "LAST_BRUSH_PATH =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.0451, 0.0027, 0, 0.66, 0.6316, 465, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "LAST_BRUSH_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LAST_BRUSH_PATH = SETTINGS_DIR + '/last_brush.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L18_C0", "label": "LAST_LEVEL_PATH =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.0477, 0.0027, 0, 0.66, 0.6842, 178, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "LAST_LEVEL_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LAST_LEVEL_PATH = SETTINGS_DIR + '/last_level.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L19_C0", "label": "TILE_SIZE =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.0504, 0.0027, 0, 0.66, 0.7368, 381, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TILE_SIZE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TILE_SIZE = 64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L20_C0", "label": "UP_KEY =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0531, 0.0027, 0, 0.66, 0.7895, 378, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "UP_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "UP_KEY = 65362"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L21_C0", "label": "ZOOM_STEP =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.0557, 0.0027, 0, 0.66, 0.8421, 21, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ZOOM_STEP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ZOOM_STEP = 0.25"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "label": "TriggerEditorWindow", "type": "class", "loc": [24, 61], "level": 0, "parent": null, "vector": [3, 0, 0.1127, 0.1008, 0, 0.66, 0.8947, 566, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "TriggerEditorWindow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TriggerEditorWindow:\n def __init__(self, parent_window, triggers_array, trigger_index):\n self._parent_window = parent_window\n self._triggers_array = triggers_array\n self._trigger_index = trigger_index\n self._gladefile = (\n os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))\n self._tree = gtk.glade.XML(self._gladefile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "label": "__init__", "type": "function", "loc": [25, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "vector": [2, 1, 0.0915, 0.0531, 1, 0.89, 0.0, 555, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "parent_window", "triggers_array", "trigger_index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent_window, triggers_array, trigger_index):\n self._parent_window = parent_window\n self._triggers_array = triggers_array\n self._trigger_index = trigger_index\n self._gladefile = (\n os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))\n self._tree = gtk.glade.XML(self._gladefile)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L26_C4", "label": "self._parent_window =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.069, 0.0027, 2, 0.93, 0.0, 873, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._parent_window", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._parent_window = parent_window"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L27_C4", "label": "self._triggers_array =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.0716, 0.0027, 2, 0.93, 0.1, 75, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._triggers_array", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers_array = triggers_array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L28_C4", "label": "self._trigger_index =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.0743, 0.0027, 2, 0.93, 0.2, 439, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._trigger_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._trigger_index = trigger_index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L29_C4", "label": "self._gladefile = join()", "type": "assigned_variable", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.0782, 0.0053, 2, 0.93, 0.3, 772, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self._gladefile", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self._gladefile = (\n os.path.join(os.path.dirname(__file__), 'trigger_editor.glade'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L31_C4", "label": "self._tree = XML()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.0822, 0.0027, 2, 0.93, 0.4, 582, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "self._tree", "arg_names": [], "import_names": [], "rhs_call_name": "XML", "annotation": ""}, "snippet": " self._tree = gtk.glade.XML(self._gladefile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L34_C4", "label": "self._entry = get_widget()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.0902, 0.0027, 2, 0.93, 0.5, 285, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self._entry", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self._entry = self._tree.get_widget('entry')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L35_C4", "label": "trigger_text =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.0928, 0.0027, 2, 0.93, 0.6, 102, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_text = self._triggers_array[self._trigger_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L36_C4", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [4, 2, 0.0968, 0.0053, 2, 0.93, 0.7, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger_text:\n self._entry.set_text(trigger_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L37_C6", "label": "set_text()", "type": "expression", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L36_C4", "vector": [8, 3, 0.0981, 0.0027, 3, 0.72, 0.0, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self._entry.set_text(trigger_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L40_C4", "label": "self._window = get_widget()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.1061, 0.0027, 2, 0.93, 0.8, 509, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self._window", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self._window = self._tree.get_widget('window')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L41_C4", "label": "signals =", "type": "assigned_variable", "loc": [41, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [14, 2, 0.1114, 0.008, 2, 0.93, 0.9, 415, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signals = { 'on_entry_changed' : self.EntryChangedEvent,\n 'on_entry_focus_out_event' : self.LoseFocusEvent,\n 'on_window_key_press_event' : self.KeyPressEvent }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L44_C4", "label": "signal_autoconnect()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "vector": [8, 2, 0.1167, 0.0027, 2, 0.93, 1.0, 665, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "signal_autoconnect", "arg_names": [], "import_names": [], "rhs_call_name": "signal_autoconnect", "annotation": ""}, "snippet": " self._tree.signal_autoconnect(signals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L46_C2", "label": "DestroyWindow", "type": "function", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "vector": [2, 1, 0.1247, 0.008, 1, 0.89, 0.25, 578, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "DestroyWindow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def DestroyWindow(self):\n self._window.destroy()\n self._parent_window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L47_C4", "label": "destroy()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L46_C2", "vector": [8, 2, 0.1247, 0.0027, 2, 0.9, 0.0, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " self._window.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L48_C4", "label": "queue_draw()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L46_C2", "vector": [8, 2, 0.1273, 0.0027, 2, 0.9, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self._parent_window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "label": "EntryChangedEvent", "type": "function", "loc": [50, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "vector": [2, 1, 0.1379, 0.0133, 1, 0.89, 0.5, 69, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "EntryChangedEvent", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def EntryChangedEvent(self, widget):\n trigger_text = widget.get_text()\n if trigger_text == '':\n trigger_text = None\n self._triggers_array[self._trigger_index] = trigger_text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L51_C4", "label": "trigger_text = get_text()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "vector": [14, 2, 0.1353, 0.0027, 2, 0.6, 0.0, 102, 3, 0, 0, 0, 530, 10, 1], "semantic": {"name": "trigger_text", "arg_names": [], "import_names": [], "rhs_call_name": "get_text", "annotation": ""}, "snippet": " trigger_text = widget.get_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L52_C4", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "vector": [4, 2, 0.1393, 0.0053, 2, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger_text == '':\n trigger_text = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L53_C6", "label": "trigger_text =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L52_C4", "vector": [14, 3, 0.1406, 0.0027, 3, 0.93, 0.0, 102, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "trigger_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_text = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L54_C4", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "vector": [14, 2, 0.1432, 0.0027, 2, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers_array[self._trigger_index] = trigger_text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L56_C2", "label": "LoseFocusEvent", "type": "function", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "vector": [2, 1, 0.1499, 0.0053, 1, 0.89, 0.75, 318, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "LoseFocusEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoseFocusEvent(self, widget, event):\n self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L57_C4", "label": "DestroyWindow()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L56_C2", "vector": [8, 2, 0.1512, 0.0027, 2, 0.17, 0.0, 578, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "DestroyWindow", "arg_names": [], "import_names": [], "rhs_call_name": "DestroyWindow", "annotation": ""}, "snippet": " self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L59_C2", "label": "KeyPressEvent", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "vector": [2, 1, 0.1592, 0.008, 1, 0.89, 1.0, 64, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "KeyPressEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def KeyPressEvent(self, widget, event):\n if event.keyval == 65293 or event.keyval == 65307: # Escape or enter key.\n self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L60_C4", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L59_C2", "vector": [4, 2, 0.1605, 0.0053, 2, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.keyval == 65293 or event.keyval == 65307: # Escape or enter key.\n self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L61_C6", "label": "DestroyWindow()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L60_C4", "vector": [8, 3, 0.1618, 0.0027, 3, 0.01, 0.0, 578, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "DestroyWindow", "arg_names": [], "import_names": [], "rhs_call_name": "DestroyWindow", "annotation": ""}, "snippet": " self.DestroyWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "label": "EditorWindow", "type": "class", "loc": [64, 371], "level": 0, "parent": null, "vector": [3, 0, 0.5769, 0.817, 0, 0.66, 0.9474, 713, 0, 22, 0, 0, 0, 0, 99], "semantic": {"name": "EditorWindow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EditorWindow:\n def __init__(self):\n self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')\n self.tree = gtk.glade.XML(self.gladefile)\n\n # Connect window signals.\n self.window = self.tree.get_widget('window')\n if (self.window):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "label": "__init__", "type": "function", "loc": [65, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.2228, 0.1034, 1, 0.03, 0.0, 555, 0, 1, 0, 0, 0, 0, 21], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')\n self.tree = gtk.glade.XML(self.gladefile)\n\n # Connect window signals.\n self.window = self.tree.get_widget('window')\n if (self.window):\n self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L66_C4", "label": "self.gladefile = join()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.1751, 0.0027, 2, 0.06, 0.0, 605, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self.gladefile", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.gladefile = os.path.join(os.path.dirname(__file__), 'editor.glade')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L67_C4", "label": "self.tree = XML()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.1777, 0.0027, 2, 0.06, 0.0833, 180, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "self.tree", "arg_names": [], "import_names": [], "rhs_call_name": "XML", "annotation": ""}, "snippet": " self.tree = gtk.glade.XML(self.gladefile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L70_C4", "label": "self.window = get_widget()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.1857, 0.0027, 2, 0.06, 0.1667, 313, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.window", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.window = self.tree.get_widget('window')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L71_C4", "label": "if", "type": "if", "loc": [71, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [4, 2, 0.1897, 0.0053, 2, 0.06, 0.25, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.window):\n self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L72_C6", "label": "connect()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L71_C4", "vector": [8, 3, 0.191, 0.0027, 3, 0.78, 0.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L73_C4", "label": "self.brushes_widget = get_widget()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.1936, 0.0027, 2, 0.06, 0.3333, 658, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.brushes_widget", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.brushes_widget = self.tree.get_widget('brushes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L74_C4", "label": "self.tiles_widget = get_widget()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.1963, 0.0027, 2, 0.06, 0.4167, 684, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.tiles_widget", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.tiles_widget = self.tree.get_widget('tiles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L76_C4", "label": "signals =", "type": "assigned_variable", "loc": [76, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.2162, 0.0318, 2, 0.06, 0.5, 415, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "signals", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signals = { 'on_brushes_expose_event' : self.BrushesExposeEvent,\n 'on_tiles_expose_event' : self.TilesExposeEvent,\n 'on_quit_menuitem_activate' : gtk.main_quit,\n 'on_menuitem_new_activate' : self.NewMenu,\n 'on_menuitem_loadlevel_activate' : self.LoadLevelMenu,\n 'on_menuitem_loadbrushes_activate' : self.LoadBrushesMenu,\n 'on_menuitem_save_activate' : self.SaveLevelMenu,\n 'on_menuitem_savelevel_activate' : self.SaveLevelAsMenu,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L88_C4", "label": "signal_autoconnect()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [8, 2, 0.2334, 0.0027, 2, 0.06, 0.5833, 665, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "signal_autoconnect", "arg_names": [], "import_names": [], "rhs_call_name": "signal_autoconnect", "annotation": ""}, "snippet": " self.tree.signal_autoconnect(signals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L91_C4", "label": "self._brushes_surface =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.2414, 0.0027, 2, 0.06, 0.6667, 171, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._brushes_surface", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._brushes_surface = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L92_C4", "label": "self._selected_brush =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [14, 2, 0.244, 0.0027, 2, 0.06, 0.75, 939, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._selected_brush", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._selected_brush = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L93_C4", "label": "NewMenu()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [8, 2, 0.2467, 0.0027, 2, 0.06, 0.8333, 966, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "NewMenu", "arg_names": [], "import_names": [], "rhs_call_name": "NewMenu", "annotation": ""}, "snippet": " self.NewMenu(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L96_C4", "label": "if", "type": "if", "loc": [96, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [4, 2, 0.2586, 0.0106, 2, 0.06, 0.9167, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(LAST_BRUSH_PATH):\n file_path = open(LAST_BRUSH_PATH).readlines()[0].strip()\n if os.path.exists(file_path):\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L97_C6", "label": "file_path = strip()", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L96_C4", "vector": [14, 3, 0.2573, 0.0027, 3, 0.42, 0.0, 397, 3, 0, 0, 0, 973, 10, 3], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " file_path = open(LAST_BRUSH_PATH).readlines()[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L98_C6", "label": "if", "type": "if", "loc": [98, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L96_C4", "vector": [4, 3, 0.2613, 0.0053, 3, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(file_path):\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L99_C8", "label": "LoadBrushesFromFile()", "type": "expression", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L98_C6", "vector": [8, 4, 0.2626, 0.0027, 4, 0.5, 0.0, 493, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadBrushesFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadBrushesFromFile", "annotation": ""}, "snippet": " self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L100_C4", "label": "if", "type": "if", "loc": [100, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "vector": [4, 2, 0.2692, 0.0106, 2, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(LAST_LEVEL_PATH):\n file_path = open(LAST_LEVEL_PATH).readlines()[0].strip()\n if os.path.exists(file_path):\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L101_C6", "label": "file_path = strip()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L100_C4", "vector": [14, 3, 0.2679, 0.0027, 3, 0.34, 0.0, 397, 3, 0, 0, 0, 973, 10, 3], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " file_path = open(LAST_LEVEL_PATH).readlines()[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L102_C6", "label": "if", "type": "if", "loc": [102, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L100_C4", "vector": [4, 3, 0.2719, 0.0053, 3, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(file_path):\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L103_C8", "label": "LoadLevelFromFile()", "type": "expression", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L102_C6", "vector": [8, 4, 0.2732, 0.0027, 4, 0.32, 0.0, 618, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadLevelFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadLevelFromFile", "annotation": ""}, "snippet": " self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "label": "WorldToWindow", "type": "function", "loc": [105, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.2825, 0.0106, 1, 0.03, 0.0476, 128, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "WorldToWindow", "arg_names": ["self", "world_x", "world_y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def WorldToWindow(self, world_x, world_y):\n window_x = world_x * self._view_zoom - self._view_x\n window_y = world_y * self._view_zoom - self._view_y\n return window_x, window_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L106_C4", "label": "window_x =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "vector": [14, 2, 0.2812, 0.0027, 2, 0.59, 0.0, 201, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "window_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_x = world_x * self._view_zoom - self._view_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L107_C4", "label": "window_y =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "vector": [14, 2, 0.2838, 0.0027, 2, 0.59, 0.5, 263, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "window_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_y = world_y * self._view_zoom - self._view_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L108_C4", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "vector": [13, 2, 0.2865, 0.0027, 2, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return window_x, window_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "label": "WindowToWorld", "type": "function", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.2958, 0.0106, 1, 0.03, 0.0952, 372, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "WindowToWorld", "arg_names": ["self", "window_x", "window_y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def WindowToWorld(self, window_x, window_y):\n world_x = (window_x + self._view_x) / self._view_zoom\n world_y = (window_y + self._view_y) / self._view_zoom\n return world_x, world_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L111_C4", "label": "world_x =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "vector": [14, 2, 0.2944, 0.0027, 2, 0.4, 0.0, 24, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "world_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " world_x = (window_x + self._view_x) / self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L112_C4", "label": "world_y =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "vector": [14, 2, 0.2971, 0.0027, 2, 0.4, 0.5, 192, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "world_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " world_y = (window_y + self._view_y) / self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L113_C4", "label": "return", "type": "return", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "vector": [13, 2, 0.2997, 0.0027, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return world_x, world_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L115_C2", "label": "WorldToTileIndex", "type": "function", "loc": [115, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.3103, 0.0133, 1, 0.03, 0.1429, 436, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "WorldToTileIndex", "arg_names": ["self", "world_x", "world_y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def WorldToTileIndex(self, world_x, world_y):\n if (world_x < 0 or world_x >= TILE_SIZE * LEVEL_WIDTH or\n world_y < 0 or world_y >= TILE_SIZE * LEVEL_HEIGHT):\n return -1\n return LEVEL_HEIGHT * int(world_x / TILE_SIZE) + int(world_y / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L116_C4", "label": "if", "type": "if", "loc": [116, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L115_C2", "vector": [4, 2, 0.3103, 0.008, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (world_x < 0 or world_x >= TILE_SIZE * LEVEL_WIDTH or\n world_y < 0 or world_y >= TILE_SIZE * LEVEL_HEIGHT):\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L118_C6", "label": "return", "type": "return", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L116_C4", "vector": [13, 3, 0.313, 0.0027, 3, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L119_C4", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L115_C2", "vector": [13, 2, 0.3156, 0.0027, 2, 0.91, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return LEVEL_HEIGHT * int(world_x / TILE_SIZE) + int(world_y / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "label": "NewMenu", "type": "function", "loc": [121, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.3316, 0.0239, 1, 0.03, 0.1905, 966, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "NewMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def NewMenu(self, widget):\n self._view_x = 0\n self._view_y = 0\n self._view_zoom = INITIAL_ZOOM\n self._tiles = [0] * LEVEL_WIDTH * LEVEL_HEIGHT\n self._triggers = [None] * LEVEL_WIDTH * LEVEL_HEIGHT\n self._current_file = None\n self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L122_C4", "label": "self._view_x =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [14, 2, 0.3236, 0.0027, 2, 0.69, 0.0, 49, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._view_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._view_x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L123_C4", "label": "self._view_y =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [14, 2, 0.3263, 0.0027, 2, 0.69, 0.1429, 742, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._view_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._view_y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L124_C4", "label": "self._view_zoom =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [14, 2, 0.3289, 0.0027, 2, 0.69, 0.2857, 361, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._view_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._view_zoom = INITIAL_ZOOM"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L125_C4", "label": "self._tiles =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [14, 2, 0.3316, 0.0027, 2, 0.69, 0.4286, 394, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._tiles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tiles = [0] * LEVEL_WIDTH * LEVEL_HEIGHT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L126_C4", "label": "self._triggers =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [14, 2, 0.3342, 0.0027, 2, 0.69, 0.5714, 297, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._triggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers = [None] * LEVEL_WIDTH * LEVEL_HEIGHT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L127_C4", "label": "self._current_file =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [14, 2, 0.3369, 0.0027, 2, 0.69, 0.7143, 11, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._current_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_file = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L128_C4", "label": "SetCleanWindowTitle()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [8, 2, 0.3395, 0.0027, 2, 0.69, 0.8571, 341, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetCleanWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetCleanWindowTitle", "annotation": ""}, "snippet": " self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L129_C4", "label": "queue_draw()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "vector": [8, 2, 0.3422, 0.0027, 2, 0.69, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "label": "LoadLevelFromFile", "type": "function", "loc": [131, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.3793, 0.0663, 1, 0.03, 0.2381, 618, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "LoadLevelFromFile", "arg_names": ["self", "file_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadLevelFromFile(self, file_path):\n assert file_path\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_LEVEL_PATH, 'w').write(file_path)\n\n self._current_file = file_path\n self.SetCleanWindowTitle()\n level_lines = open(file_path).readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L134_C4", "label": "write()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [8, 2, 0.3554, 0.0027, 2, 0.17, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(LAST_LEVEL_PATH, 'w').write(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L136_C4", "label": "self._current_file =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [14, 2, 0.3607, 0.0027, 2, 0.17, 0.1, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_file = file_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L137_C4", "label": "SetCleanWindowTitle()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [8, 2, 0.3634, 0.0027, 2, 0.17, 0.2, 341, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetCleanWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetCleanWindowTitle", "annotation": ""}, "snippet": " self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L138_C4", "label": "level_lines = readlines()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [14, 2, 0.366, 0.0027, 2, 0.17, 0.3, 35, 3, 0, 0, 0, 841, 10, 2], "semantic": {"name": "level_lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": " level_lines = open(file_path).readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L139_C4", "label": "raw_tiles = strip()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [14, 2, 0.3687, 0.0027, 2, 0.17, 0.4, 616, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "raw_tiles", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " raw_tiles = level_lines[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L140_C4", "label": "for tile", "type": "for", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [6, 2, 0.3727, 0.0053, 2, 0.17, 0.5, 319, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tile in xrange(LEVEL_WIDTH * LEVEL_HEIGHT):\n self._tiles[tile] = ord(raw_tiles[tile]) - ord('a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L141_C6", "label": "assign", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L140_C4", "vector": [14, 3, 0.374, 0.0027, 3, 0.6, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tiles[tile] = ord(raw_tiles[tile]) - ord('a')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L142_C4", "label": "self._triggers =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [14, 2, 0.3767, 0.0027, 2, 0.17, 0.6, 297, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._triggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L143_C4", "label": "for n", "type": "for", "loc": [143, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [6, 2, 0.3806, 0.0053, 2, 0.17, 0.7, 773, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for n in xrange(0, LEVEL_WIDTH * LEVEL_HEIGHT):\n self._triggers.append(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L144_C6", "label": "append()", "type": "expression", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L143_C4", "vector": [8, 3, 0.382, 0.0027, 3, 0.81, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._triggers.append(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L145_C4", "label": "trigger_re = compile()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [14, 2, 0.3846, 0.0027, 2, 0.17, 0.8, 228, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "trigger_re", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " trigger_re = re.compile('(\\\\d+),(\\\\d+),\"([^\"]+)\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "label": "for raw_trigger", "type": "for", "loc": [146, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [6, 2, 0.3966, 0.0212, 2, 0.17, 0.9, 365, 6, 0, 0, 0, 0, 0, 7], "semantic": {"name": "raw_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for raw_trigger in level_lines[1:]:\n match = trigger_re.match(raw_trigger.strip())\n assert match\n x = int(match.group(1))\n y = int(match.group(2))\n trigger = match.group(3)\n trigger_index = LEVEL_HEIGHT * x + y\n self._triggers[trigger_index] = trigger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L147_C6", "label": "match = match()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "vector": [14, 3, 0.3899, 0.0027, 3, 0.29, 0.0, 36, 3, 1, 0, 0, 36, 10, 2], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " match = trigger_re.match(raw_trigger.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L149_C6", "label": "x = int()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "vector": [14, 3, 0.3952, 0.0027, 3, 0.29, 0.2, 190, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " x = int(match.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L150_C6", "label": "y = int()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "vector": [14, 3, 0.3979, 0.0027, 3, 0.29, 0.4, 304, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " y = int(match.group(2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L151_C6", "label": "trigger = group()", "type": "assigned_variable", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "vector": [14, 3, 0.4005, 0.0027, 3, 0.29, 0.6, 426, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "trigger", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " trigger = match.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L152_C6", "label": "trigger_index =", "type": "assigned_variable", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "vector": [14, 3, 0.4032, 0.0027, 3, 0.29, 0.8, 465, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_index = LEVEL_HEIGHT * x + y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L153_C6", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "vector": [14, 3, 0.4058, 0.0027, 3, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers[trigger_index] = trigger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L155_C4", "label": "queue_draw()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "vector": [8, 2, 0.4111, 0.0027, 2, 0.17, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L157_C2", "label": "LoadLevelMenu", "type": "function", "loc": [157, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.4204, 0.0106, 1, 0.03, 0.2857, 614, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "LoadLevelMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadLevelMenu(self, widget):\n file_path = self.ChooseOpenFile()\n if file_path:\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L158_C4", "label": "file_path = ChooseOpenFile()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L157_C2", "vector": [14, 2, 0.4191, 0.0027, 2, 0.96, 0.0, 397, 3, 0, 0, 0, 836, 10, 1], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "ChooseOpenFile", "annotation": ""}, "snippet": " file_path = self.ChooseOpenFile()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L159_C4", "label": "if", "type": "if", "loc": [159, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L157_C2", "vector": [4, 2, 0.4231, 0.0053, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_path:\n self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L160_C6", "label": "LoadLevelFromFile()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L159_C4", "vector": [8, 3, 0.4244, 0.0027, 3, 0.56, 0.0, 618, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadLevelFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadLevelFromFile", "annotation": ""}, "snippet": " self.LoadLevelFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "label": "LoadBrushesFromFile", "type": "function", "loc": [162, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.435, 0.0133, 1, 0.03, 0.3333, 493, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "LoadBrushesFromFile", "arg_names": ["self", "file_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadBrushesFromFile(self, file_path):\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_BRUSH_PATH, 'w').write(file_path)\n self._brushes_surface = cairo.ImageSurface.create_from_png(file_path)\n self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L164_C4", "label": "write()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "vector": [8, 2, 0.435, 0.0027, 2, 0.73, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(LAST_BRUSH_PATH, 'w').write(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L165_C4", "label": "self._brushes_surface = create_from_png()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "vector": [14, 2, 0.4377, 0.0027, 2, 0.73, 0.5, 171, 3, 1, 0, 0, 509, 10, 1], "semantic": {"name": "self._brushes_surface", "arg_names": [], "import_names": [], "rhs_call_name": "create_from_png", "annotation": ""}, "snippet": " self._brushes_surface = cairo.ImageSurface.create_from_png(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L166_C4", "label": "queue_draw()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "vector": [8, 2, 0.4403, 0.0027, 2, 0.73, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L168_C2", "label": "LoadBrushesMenu", "type": "function", "loc": [168, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.4496, 0.0106, 1, 0.03, 0.381, 503, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "LoadBrushesMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def LoadBrushesMenu(self, widget):\n file_path = self.ChooseOpenFile()\n if file_path:\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L169_C4", "label": "file_path = ChooseOpenFile()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L168_C2", "vector": [14, 2, 0.4483, 0.0027, 2, 0.18, 0.0, 397, 3, 0, 0, 0, 836, 10, 1], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "ChooseOpenFile", "annotation": ""}, "snippet": " file_path = self.ChooseOpenFile()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L170_C4", "label": "if", "type": "if", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L168_C2", "vector": [4, 2, 0.4523, 0.0053, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_path:\n self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L171_C6", "label": "LoadBrushesFromFile()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L170_C4", "vector": [8, 3, 0.4536, 0.0027, 3, 0.16, 0.0, 493, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "LoadBrushesFromFile", "arg_names": [], "import_names": [], "rhs_call_name": "LoadBrushesFromFile", "annotation": ""}, "snippet": " self.LoadBrushesFromFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L173_C2", "label": "SetDirtyWindowTitle", "type": "function", "loc": [173, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.4668, 0.0186, 1, 0.03, 0.4286, 598, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "SetDirtyWindowTitle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SetDirtyWindowTitle(self):\n if self._current_file:\n window_title = self.window.get_title()\n if window_title[0] != '*':\n self.window.set_title('*' + self._current_file)\n else:\n self.window.set_title('*(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "label": "if", "type": "if", "loc": [174, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L173_C2", "vector": [4, 2, 0.4682, 0.0159, 2, 0.47, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_file:\n window_title = self.window.get_title()\n if window_title[0] != '*':\n self.window.set_title('*' + self._current_file)\n else:\n self.window.set_title('*(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L175_C6", "label": "window_title = get_title()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "vector": [14, 3, 0.4642, 0.0027, 3, 0.71, 0.0, 614, 3, 0, 0, 0, 470, 10, 1], "semantic": {"name": "window_title", "arg_names": [], "import_names": [], "rhs_call_name": "get_title", "annotation": ""}, "snippet": " window_title = self.window.get_title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L176_C6", "label": "if", "type": "if", "loc": [176, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "vector": [4, 3, 0.4682, 0.0053, 3, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if window_title[0] != '*':\n self.window.set_title('*' + self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L177_C8", "label": "set_title()", "type": "expression", "loc": [177, 177], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L176_C6", "vector": [8, 4, 0.4695, 0.0027, 4, 0.33, 0.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title('*' + self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L179_C6", "label": "set_title()", "type": "expression", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "vector": [8, 3, 0.4748, 0.0027, 3, 0.71, 1.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title('*(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L181_C2", "label": "SetCleanWindowTitle", "type": "function", "loc": [181, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.4854, 0.0133, 1, 0.03, 0.4762, 341, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "SetCleanWindowTitle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SetCleanWindowTitle(self):\n if self._current_file:\n self.window.set_title(self._current_file)\n else:\n self.window.set_title('(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L182_C4", "label": "if", "type": "if", "loc": [182, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L181_C2", "vector": [4, 2, 0.4867, 0.0106, 2, 0.79, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_file:\n self.window.set_title(self._current_file)\n else:\n self.window.set_title('(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L183_C6", "label": "set_title()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L182_C4", "vector": [8, 3, 0.4854, 0.0027, 3, 0.96, 0.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title(self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L185_C6", "label": "set_title()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L182_C4", "vector": [8, 3, 0.4907, 0.0027, 3, 0.96, 1.0, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " self.window.set_title('(Unsaved Level)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "label": "SaveLevelToFile", "type": "function", "loc": [187, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.5119, 0.0345, 1, 0.03, 0.5238, 147, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "SaveLevelToFile", "arg_names": ["self", "file_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SaveLevelToFile(self, file_path):\n assert file_path\n self._current_file = file_path\n self.SetCleanWindowTitle()\n level_string = map(lambda tile : '%c' % (tile + ord('a')), self._tiles)\n level_file = open(file_path, 'w')\n level_file.write(''.join(level_string))\n for x in xrange(0, LEVEL_WIDTH):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L189_C4", "label": "self._current_file =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "vector": [14, 2, 0.5013, 0.0027, 2, 0.19, 0.0, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_file = file_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L190_C4", "label": "SetCleanWindowTitle()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "vector": [8, 2, 0.504, 0.0027, 2, 0.19, 0.2, 341, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetCleanWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetCleanWindowTitle", "annotation": ""}, "snippet": " self.SetCleanWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L191_C4", "label": "level_string = map()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "vector": [14, 2, 0.5066, 0.0027, 2, 0.19, 0.4, 487, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "level_string", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " level_string = map(lambda tile : '%c' % (tile + ord('a')), self._tiles)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L192_C4", "label": "level_file = open()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "vector": [14, 2, 0.5093, 0.0027, 2, 0.19, 0.6, 970, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "level_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " level_file = open(file_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L193_C4", "label": "write()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "vector": [8, 2, 0.5119, 0.0027, 2, 0.19, 0.8, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " level_file.write(''.join(level_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L194_C4", "label": "for x", "type": "for", "loc": [194, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "vector": [6, 2, 0.5212, 0.0159, 2, 0.19, 1.0, 190, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for x in xrange(0, LEVEL_WIDTH):\n for y in xrange(0, LEVEL_HEIGHT):\n index = LEVEL_HEIGHT * x + y\n trigger_string = self._triggers[index];\n if trigger_string:\n level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "label": "for y", "type": "for", "loc": [195, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L194_C4", "vector": [6, 3, 0.5225, 0.0133, 3, 0.04, 0.0, 304, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for y in xrange(0, LEVEL_HEIGHT):\n index = LEVEL_HEIGHT * x + y\n trigger_string = self._triggers[index];\n if trigger_string:\n level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L196_C8", "label": "index =", "type": "assigned_variable", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "vector": [14, 4, 0.5199, 0.0027, 4, 0.97, 0.0, 780, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index = LEVEL_HEIGHT * x + y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L197_C8", "label": "trigger_string =", "type": "assigned_variable", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "vector": [14, 4, 0.5225, 0.0027, 4, 0.97, 0.5, 605, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger_string = self._triggers[index];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L198_C8", "label": "if", "type": "if", "loc": [198, 199], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "vector": [4, 4, 0.5265, 0.0053, 4, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger_string:\n level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L199_C10", "label": "write()", "type": "expression", "loc": [199, 199], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L198_C8", "vector": [8, 5, 0.5279, 0.0027, 5, 0.38, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " level_file.write('\\n%d,%d,\"%s\"' % (x, y, trigger_string))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L201_C2", "label": "SaveLevelMenu", "type": "function", "loc": [201, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.5385, 0.0133, 1, 0.03, 0.5714, 157, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "SaveLevelMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SaveLevelMenu(self, widget):\n if self._current_file:\n self.SaveLevelToFile(self._current_file)\n else:\n self.SaveLevelAsMenu(widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L202_C4", "label": "if", "type": "if", "loc": [202, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L201_C2", "vector": [4, 2, 0.5398, 0.0106, 2, 0.21, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._current_file:\n self.SaveLevelToFile(self._current_file)\n else:\n self.SaveLevelAsMenu(widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L203_C6", "label": "SaveLevelToFile()", "type": "expression", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L202_C4", "vector": [8, 3, 0.5385, 0.0027, 3, 0.46, 0.0, 147, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SaveLevelToFile", "arg_names": [], "import_names": [], "rhs_call_name": "SaveLevelToFile", "annotation": ""}, "snippet": " self.SaveLevelToFile(self._current_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L205_C6", "label": "SaveLevelAsMenu()", "type": "expression", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L202_C4", "vector": [8, 3, 0.5438, 0.0027, 3, 0.46, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SaveLevelAsMenu", "arg_names": [], "import_names": [], "rhs_call_name": "SaveLevelAsMenu", "annotation": ""}, "snippet": " self.SaveLevelAsMenu(widget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L207_C2", "label": "SaveLevelAsMenu", "type": "function", "loc": [207, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.5557, 0.0159, 1, 0.03, 0.619, 128, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "SaveLevelAsMenu", "arg_names": ["self", "widget"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SaveLevelAsMenu(self, widget):\n file_path = self.ChooseSaveFile()\n if file_path:\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_LEVEL_PATH, 'w').write(file_path)\n self.SaveLevelToFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L208_C4", "label": "file_path = ChooseSaveFile()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L207_C2", "vector": [14, 2, 0.5517, 0.0027, 2, 0.22, 0.0, 397, 3, 0, 0, 0, 861, 10, 1], "semantic": {"name": "file_path", "arg_names": [], "import_names": [], "rhs_call_name": "ChooseSaveFile", "annotation": ""}, "snippet": " file_path = self.ChooseSaveFile()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L209_C4", "label": "if", "type": "if", "loc": [209, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L207_C2", "vector": [4, 2, 0.5584, 0.0106, 2, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file_path:\n assert 0 == os.system('mkdir -p %s' % SETTINGS_DIR)\n open(LAST_LEVEL_PATH, 'w').write(file_path)\n self.SaveLevelToFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L211_C6", "label": "write()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L209_C4", "vector": [8, 3, 0.5597, 0.0027, 3, 0.47, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(LAST_LEVEL_PATH, 'w').write(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L212_C6", "label": "SaveLevelToFile()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L209_C4", "vector": [8, 3, 0.5623, 0.0027, 3, 0.47, 1.0, 147, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SaveLevelToFile", "arg_names": [], "import_names": [], "rhs_call_name": "SaveLevelToFile", "annotation": ""}, "snippet": " self.SaveLevelToFile(file_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L214_C2", "label": "BrushesClickEvent", "type": "function", "loc": [214, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.5703, 0.008, 1, 0.03, 0.6667, 25, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "BrushesClickEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def BrushesClickEvent(self, widget, event):\n self._selected_brush = int(event.y / BRUSHES_ZOOM / TILE_SIZE)\n self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L215_C4", "label": "self._selected_brush = int()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L214_C2", "vector": [14, 2, 0.5703, 0.0027, 2, 0.76, 0.0, 939, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self._selected_brush", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self._selected_brush = int(event.y / BRUSHES_ZOOM / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L216_C4", "label": "queue_draw()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L214_C2", "vector": [8, 2, 0.5729, 0.0027, 2, 0.76, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L218_C2", "label": "BrushesExposeEvent", "type": "function", "loc": [218, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.6034, 0.0531, 1, 0.03, 0.7143, 735, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "BrushesExposeEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def BrushesExposeEvent(self, widget, event):\n # Documentation for drawing using Cairo was found on:\n # http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm\n # Cairo within Python documentation was found on:\n # http://www.cairographics.org/pycairo\n if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n cairo_context.rectangle("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "label": "if", "type": "if", "loc": [223, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L218_C2", "vector": [4, 2, 0.6088, 0.0371, 2, 0.44, 0.0, 0, 7, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n cairo_context.rectangle(\n event.area.x, event.area.y, event.area.width, event.area.height)\n cairo_context.clip()\n cairo_context.scale(BRUSHES_ZOOM, BRUSHES_ZOOM)\n cairo_context.set_source_surface(self._brushes_surface, 0, 0)\n cairo_context.paint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L224_C6", "label": "cairo_context = cairo_create()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [14, 3, 0.5942, 0.0027, 3, 0.77, 0.0, 845, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "cairo_context", "arg_names": [], "import_names": [], "rhs_call_name": "cairo_create", "annotation": ""}, "snippet": " cairo_context = widget.window.cairo_create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L225_C6", "label": "rectangle()", "type": "expression", "loc": [225, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.5981, 0.0053, 3, 0.77, 0.1111, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n event.area.x, event.area.y, event.area.width, event.area.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L227_C6", "label": "clip()", "type": "expression", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6021, 0.0027, 3, 0.77, 0.2222, 689, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clip", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " cairo_context.clip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L228_C6", "label": "scale()", "type": "expression", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6048, 0.0027, 3, 0.77, 0.3333, 18, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "scale", "annotation": ""}, "snippet": " cairo_context.scale(BRUSHES_ZOOM, BRUSHES_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L229_C6", "label": "set_source_surface()", "type": "expression", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6074, 0.0027, 3, 0.77, 0.4444, 23, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_surface", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_surface", "annotation": ""}, "snippet": " cairo_context.set_source_surface(self._brushes_surface, 0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L230_C6", "label": "paint()", "type": "expression", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6101, 0.0027, 3, 0.77, 0.5556, 376, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "paint", "arg_names": [], "import_names": [], "rhs_call_name": "paint", "annotation": ""}, "snippet": " cairo_context.paint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L232_C6", "label": "rectangle()", "type": "expression", "loc": [232, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6167, 0.0053, 3, 0.77, 0.6667, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n 0, TILE_SIZE * self._selected_brush, TILE_SIZE, TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L234_C6", "label": "set_line_width()", "type": "expression", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6207, 0.0027, 3, 0.77, 0.7778, 143, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_line_width", "arg_names": [], "import_names": [], "rhs_call_name": "set_line_width", "annotation": ""}, "snippet": " cairo_context.set_line_width(6)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L235_C6", "label": "set_source_rgba()", "type": "expression", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.6233, 0.0027, 3, 0.77, 0.8889, 979, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_rgba", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_rgba", "annotation": ""}, "snippet": " cairo_context.set_source_rgba(1, 0, 0, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L236_C6", "label": "stroke()", "type": "expression", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "vector": [8, 3, 0.626, 0.0027, 3, 0.77, 1.0, 765, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stroke", "arg_names": [], "import_names": [], "rhs_call_name": "stroke", "annotation": ""}, "snippet": " cairo_context.stroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L237_C4", "label": "return", "type": "return", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L218_C2", "vector": [13, 2, 0.6286, 0.0027, 2, 0.44, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "label": "TilesClickEvent", "type": "function", "loc": [239, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.6565, 0.0477, 1, 0.03, 0.7619, 797, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "TilesClickEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesClickEvent(self, widget, event):\n if not self._brushes_surface:\n return\n\n world_x, world_y = self.WindowToWorld(event.x, event.y)\n tile_index = self.WorldToTileIndex(world_x, world_y)\n if tile_index == -1:\n return # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L240_C4", "label": "if", "type": "if", "loc": [240, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "vector": [4, 2, 0.6379, 0.0053, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._brushes_surface:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L241_C6", "label": "return", "type": "return", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L240_C4", "vector": [13, 3, 0.6393, 0.0027, 3, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L243_C4", "label": "world_x, world_y = WindowToWorld()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "vector": [14, 2, 0.6446, 0.0027, 2, 0.66, 0.25, 151, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "world_x, world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " world_x, world_y = self.WindowToWorld(event.x, event.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L244_C4", "label": "tile_index = WorldToTileIndex()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "vector": [14, 2, 0.6472, 0.0027, 2, 0.66, 0.5, 780, 3, 2, 0, 0, 436, 10, 1], "semantic": {"name": "tile_index", "arg_names": [], "import_names": [], "rhs_call_name": "WorldToTileIndex", "annotation": ""}, "snippet": " tile_index = self.WorldToTileIndex(world_x, world_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L245_C4", "label": "if", "type": "if", "loc": [245, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "vector": [4, 2, 0.6512, 0.0053, 2, 0.66, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tile_index == -1:\n return # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L246_C6", "label": "return", "type": "return", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L245_C4", "vector": [13, 3, 0.6525, 0.0027, 3, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "label": "if", "type": "if", "loc": [247, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "vector": [4, 2, 0.6671, 0.0265, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.button == 1: # Left click.\n self._tiles[tile_index] = self._selected_brush\n self._triggers[tile_index] = None\n self.window.queue_draw()\n self.SetDirtyWindowTitle()\n elif event.button == 3: # Right click.\n trigger_editor_window = (\n TriggerEditorWindow(self.window, self._triggers, tile_index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L248_C6", "label": "assign", "type": "assigned_variable", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "vector": [14, 3, 0.6578, 0.0027, 3, 0.66, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tiles[tile_index] = self._selected_brush"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L249_C6", "label": "assign", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "vector": [14, 3, 0.6605, 0.0027, 3, 0.66, 0.25, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._triggers[tile_index] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L250_C6", "label": "queue_draw()", "type": "expression", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "vector": [8, 3, 0.6631, 0.0027, 3, 0.66, 0.5, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L251_C6", "label": "SetDirtyWindowTitle()", "type": "expression", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "vector": [8, 3, 0.6658, 0.0027, 3, 0.66, 0.75, 598, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetDirtyWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetDirtyWindowTitle", "annotation": ""}, "snippet": " self.SetDirtyWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "label": "if", "type": "if", "loc": [252, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "vector": [4, 3, 0.6737, 0.0133, 3, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.button == 3: # Right click.\n trigger_editor_window = (\n TriggerEditorWindow(self.window, self._triggers, tile_index))\n self.window.queue_draw()\n self.SetDirtyWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L253_C6", "label": "trigger_editor_window = TriggerEditorWindow()", "type": "assigned_variable", "loc": [253, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "vector": [14, 4, 0.6724, 0.0053, 4, 0.49, 0.0, 428, 3, 3, 0, 0, 566, 10, 1], "semantic": {"name": "trigger_editor_window", "arg_names": [], "import_names": [], "rhs_call_name": "TriggerEditorWindow", "annotation": ""}, "snippet": " trigger_editor_window = (\n TriggerEditorWindow(self.window, self._triggers, tile_index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L255_C6", "label": "queue_draw()", "type": "expression", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "vector": [8, 4, 0.6764, 0.0027, 4, 0.49, 0.5, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L256_C6", "label": "SetDirtyWindowTitle()", "type": "expression", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "vector": [8, 4, 0.679, 0.0027, 4, 0.49, 1.0, 598, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetDirtyWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "SetDirtyWindowTitle", "annotation": ""}, "snippet": " self.SetDirtyWindowTitle()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L258_C2", "label": "TilesKeyEvent", "type": "function", "loc": [258, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.6963, 0.0265, 1, 0.03, 0.8095, 849, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "TilesKeyEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesKeyEvent(self, widget, event):\n if event.keyval == LEFT_KEY:\n self._view_x -= SCROLL_STEP * self._view_zoom\n elif event.keyval == RIGHT_KEY:\n self._view_x += SCROLL_STEP * self._view_zoom\n elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L259_C4", "label": "if", "type": "if", "loc": [259, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L258_C2", "vector": [4, 2, 0.6963, 0.0212, 2, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.keyval == LEFT_KEY:\n self._view_x -= SCROLL_STEP * self._view_zoom\n elif event.keyval == RIGHT_KEY:\n self._view_x += SCROLL_STEP * self._view_zoom\n elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L261_C4", "label": "if", "type": "if", "loc": [261, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L259_C4", "vector": [4, 3, 0.6989, 0.0159, 3, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.keyval == RIGHT_KEY:\n self._view_x += SCROLL_STEP * self._view_zoom\n elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L263_C4", "label": "if", "type": "if", "loc": [263, 266], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L261_C4", "vector": [4, 4, 0.7016, 0.0106, 4, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.keyval == UP_KEY:\n self._view_y -= SCROLL_STEP * self._view_zoom\n elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L265_C4", "label": "if", "type": "if", "loc": [265, 266], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L263_C4", "vector": [4, 5, 0.7042, 0.0053, 5, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.keyval == DOWN_KEY:\n self._view_y += SCROLL_STEP * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L267_C4", "label": "queue_draw()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L258_C2", "vector": [8, 2, 0.7082, 0.0027, 2, 0.07, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "label": "TilesScrollEvent", "type": "function", "loc": [269, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.7294, 0.0345, 1, 0.03, 0.8571, 378, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "TilesScrollEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesScrollEvent(self, widget, event):\n old_world_x, old_world_y = self.WindowToWorld(event.x, event.y)\n if event.direction == 0:\n self._view_zoom += ZOOM_STEP\n elif event.direction == 1:\n self._view_zoom -= ZOOM_STEP\n self._view_zoom = max(self._view_zoom, MIN_ZOOM)\n self._view_zoom = min(self._view_zoom, MAX_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L270_C4", "label": "old_world_x, old_world_y = WindowToWorld()", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "vector": [14, 2, 0.7162, 0.0027, 2, 0.52, 0.0, 26, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "old_world_x, old_world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " old_world_x, old_world_y = self.WindowToWorld(event.x, event.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L271_C4", "label": "if", "type": "if", "loc": [271, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "vector": [4, 2, 0.7228, 0.0106, 2, 0.52, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event.direction == 0:\n self._view_zoom += ZOOM_STEP\n elif event.direction == 1:\n self._view_zoom -= ZOOM_STEP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L273_C4", "label": "if", "type": "if", "loc": [273, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L271_C4", "vector": [4, 3, 0.7255, 0.0053, 3, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event.direction == 1:\n self._view_zoom -= ZOOM_STEP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L275_C4", "label": "self._view_zoom = max()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "vector": [14, 2, 0.7294, 0.0027, 2, 0.52, 0.4, 361, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "self._view_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " self._view_zoom = max(self._view_zoom, MIN_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L276_C4", "label": "self._view_zoom = min()", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "vector": [14, 2, 0.7321, 0.0027, 2, 0.52, 0.6, 361, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "self._view_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " self._view_zoom = min(self._view_zoom, MAX_ZOOM)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L278_C4", "label": "new_world_x, new_world_y = WindowToWorld()", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "vector": [14, 2, 0.7374, 0.0027, 2, 0.52, 0.8, 573, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "new_world_x, new_world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " new_world_x, new_world_y = self.WindowToWorld(event.x, event.y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L281_C4", "label": "queue_draw()", "type": "expression", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "vector": [8, 2, 0.7454, 0.0027, 2, 0.52, 1.0, 526, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "queue_draw", "arg_names": [], "import_names": [], "rhs_call_name": "queue_draw", "annotation": ""}, "snippet": " self.window.queue_draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L283_C2", "label": "TilesExposeEvent", "type": "function", "loc": [283, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.8355, 0.1724, 1, 0.03, 0.9048, 795, 0, 3, 1, 0, 0, 0, 36], "semantic": {"name": "TilesExposeEvent", "arg_names": ["self", "widget", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def TilesExposeEvent(self, widget, event):\n # See comment in BrushesExposeEvent for Cairo documentation.\n if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n brushes_pattern = cairo.SurfacePattern(self._brushes_surface)\n brushes_pattern.set_filter(cairo.FILTER_FAST)\n zoomed_tile_size = TILE_SIZE * self._view_zoom\n x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "label": "if", "type": "if", "loc": [285, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L283_C2", "vector": [4, 2, 0.8369, 0.1645, 2, 0.19, 0.0, 0, 7, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._brushes_surface:\n cairo_context = widget.window.cairo_create()\n brushes_pattern = cairo.SurfacePattern(self._brushes_surface)\n brushes_pattern.set_filter(cairo.FILTER_FAST)\n zoomed_tile_size = TILE_SIZE * self._view_zoom\n x = 0\n y = 0\n while x <= event.area.width + zoomed_tile_size:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L286_C6", "label": "cairo_context = cairo_create()", "type": "assigned_variable", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [14, 3, 0.7586, 0.0027, 3, 0.8, 0.0, 845, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "cairo_context", "arg_names": [], "import_names": [], "rhs_call_name": "cairo_create", "annotation": ""}, "snippet": " cairo_context = widget.window.cairo_create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L287_C6", "label": "brushes_pattern = SurfacePattern()", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [14, 3, 0.7613, 0.0027, 3, 0.8, 0.0909, 309, 3, 1, 0, 0, 5, 10, 1], "semantic": {"name": "brushes_pattern", "arg_names": [], "import_names": [], "rhs_call_name": "SurfacePattern", "annotation": ""}, "snippet": " brushes_pattern = cairo.SurfacePattern(self._brushes_surface)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L288_C6", "label": "set_filter()", "type": "expression", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [8, 3, 0.7639, 0.0027, 3, 0.8, 0.1818, 180, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_filter", "arg_names": [], "import_names": [], "rhs_call_name": "set_filter", "annotation": ""}, "snippet": " brushes_pattern.set_filter(cairo.FILTER_FAST)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L289_C6", "label": "zoomed_tile_size =", "type": "assigned_variable", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [14, 3, 0.7666, 0.0027, 3, 0.8, 0.2727, 54, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "zoomed_tile_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zoomed_tile_size = TILE_SIZE * self._view_zoom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L290_C6", "label": "x =", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [14, 3, 0.7692, 0.0027, 3, 0.8, 0.3636, 190, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L291_C6", "label": "y =", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [14, 3, 0.7719, 0.0027, 3, 0.8, 0.4545, 304, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L292_C6", "label": "while", "type": "while", "loc": [292, 340], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [5, 3, 0.8382, 0.13, 3, 0.8, 0.5455, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while x <= event.area.width + zoomed_tile_size:\n while y <= event.area.height + zoomed_tile_size:\n world_x, world_y = self.WindowToWorld(x, y)\n tile_index = self.WorldToTileIndex(world_x, world_y)\n if tile_index == -1:\n y += zoomed_tile_size\n continue # Map tile out of bounds.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "label": "while", "type": "while", "loc": [293, 338], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L292_C6", "vector": [5, 4, 0.8369, 0.122, 4, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 28], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while y <= event.area.height + zoomed_tile_size:\n world_x, world_y = self.WindowToWorld(x, y)\n tile_index = self.WorldToTileIndex(world_x, world_y)\n if tile_index == -1:\n y += zoomed_tile_size\n continue # Map tile out of bounds.\n\n tile_x = TILE_SIZE * int(world_x / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L294_C10", "label": "world_x, world_y = WindowToWorld()", "type": "assigned_variable", "loc": [294, 294], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.7798, 0.0027, 5, 0.28, 0.0, 151, 3, 2, 0, 0, 372, 10, 1], "semantic": {"name": "world_x, world_y", "arg_names": [], "import_names": [], "rhs_call_name": "WindowToWorld", "annotation": ""}, "snippet": " world_x, world_y = self.WindowToWorld(x, y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L295_C10", "label": "tile_index = WorldToTileIndex()", "type": "assigned_variable", "loc": [295, 295], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.7825, 0.0027, 5, 0.28, 0.0714, 780, 3, 2, 0, 0, 436, 10, 1], "semantic": {"name": "tile_index", "arg_names": [], "import_names": [], "rhs_call_name": "WorldToTileIndex", "annotation": ""}, "snippet": " tile_index = self.WorldToTileIndex(world_x, world_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L296_C10", "label": "if", "type": "if", "loc": [296, 298], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [4, 5, 0.7878, 0.008, 5, 0.28, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tile_index == -1:\n y += zoomed_tile_size\n continue # Map tile out of bounds."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L300_C10", "label": "tile_x =", "type": "assigned_variable", "loc": [300, 300], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.7958, 0.0027, 5, 0.28, 0.2143, 422, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tile_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tile_x = TILE_SIZE * int(world_x / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L301_C10", "label": "tile_y =", "type": "assigned_variable", "loc": [301, 301], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.7984, 0.0027, 5, 0.28, 0.2857, 302, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tile_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tile_y = TILE_SIZE * int(world_y / TILE_SIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L302_C10", "label": "window_x, window_y = WorldToWindow()", "type": "assigned_variable", "loc": [302, 302], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.8011, 0.0027, 5, 0.28, 0.3571, 373, 3, 2, 0, 0, 128, 10, 1], "semantic": {"name": "window_x, window_y", "arg_names": [], "import_names": [], "rhs_call_name": "WorldToWindow", "annotation": ""}, "snippet": " window_x, window_y = self.WorldToWindow(tile_x, tile_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L303_C10", "label": "identity_matrix()", "type": "expression", "loc": [303, 303], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [8, 5, 0.8037, 0.0027, 5, 0.28, 0.4286, 990, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "identity_matrix", "arg_names": [], "import_names": [], "rhs_call_name": "identity_matrix", "annotation": ""}, "snippet": " cairo_context.identity_matrix()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L304_C10", "label": "reset_clip()", "type": "expression", "loc": [304, 304], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [8, 5, 0.8064, 0.0027, 5, 0.28, 0.5, 194, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reset_clip", "arg_names": [], "import_names": [], "rhs_call_name": "reset_clip", "annotation": ""}, "snippet": " cairo_context.reset_clip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L305_C10", "label": "rectangle()", "type": "expression", "loc": [305, 306], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [8, 5, 0.8103, 0.0053, 5, 0.28, 0.5714, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n window_x, window_y, zoomed_tile_size, zoomed_tile_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L307_C10", "label": "set_source_rgba()", "type": "expression", "loc": [307, 307], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [8, 5, 0.8143, 0.0027, 5, 0.28, 0.6429, 979, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_rgba", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_rgba", "annotation": ""}, "snippet": " cairo_context.set_source_rgba(0, 0, 0, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L308_C10", "label": "fill()", "type": "expression", "loc": [308, 308], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [8, 5, 0.817, 0.0027, 5, 0.28, 0.7143, 346, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fill", "arg_names": [], "import_names": [], "rhs_call_name": "fill", "annotation": ""}, "snippet": " cairo_context.fill()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L310_C10", "label": "tile_id =", "type": "assigned_variable", "loc": [310, 310], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.8223, 0.0027, 5, 0.28, 0.7857, 145, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tile_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tile_id = self._tiles[tile_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L311_C10", "label": "trigger =", "type": "assigned_variable", "loc": [311, 311], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [14, 5, 0.8249, 0.0027, 5, 0.28, 0.8571, 426, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trigger = self._triggers[tile_index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "label": "if", "type": "if", "loc": [313, 323], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [4, 5, 0.8435, 0.0292, 5, 0.28, 0.9286, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tile_id != 0:\n cairo_context.save()\n cairo_context.rectangle(\n window_x, window_y, zoomed_tile_size, zoomed_tile_size)\n cairo_context.clip()\n cairo_context.translate(window_x, window_y);\n cairo_context.scale(self._view_zoom, self._view_zoom)\n cairo_context.translate(0, -TILE_SIZE * tile_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L314_C12", "label": "save()", "type": "expression", "loc": [314, 314], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8329, 0.0027, 6, 0.54, 0.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " cairo_context.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L315_C12", "label": "rectangle()", "type": "expression", "loc": [315, 316], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8369, 0.0053, 6, 0.54, 0.125, 995, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "rectangle", "arg_names": [], "import_names": [], "rhs_call_name": "rectangle", "annotation": ""}, "snippet": " cairo_context.rectangle(\n window_x, window_y, zoomed_tile_size, zoomed_tile_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L317_C12", "label": "clip()", "type": "expression", "loc": [317, 317], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8408, 0.0027, 6, 0.54, 0.25, 689, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clip", "arg_names": [], "import_names": [], "rhs_call_name": "clip", "annotation": ""}, "snippet": " cairo_context.clip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L318_C12", "label": "translate()", "type": "expression", "loc": [318, 318], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8435, 0.0027, 6, 0.54, 0.375, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(window_x, window_y);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L319_C12", "label": "scale()", "type": "expression", "loc": [319, 319], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8462, 0.0027, 6, 0.54, 0.5, 18, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "scale", "annotation": ""}, "snippet": " cairo_context.scale(self._view_zoom, self._view_zoom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L320_C12", "label": "translate()", "type": "expression", "loc": [320, 320], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8488, 0.0027, 6, 0.54, 0.625, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(0, -TILE_SIZE * tile_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L321_C12", "label": "set_source()", "type": "expression", "loc": [321, 321], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8515, 0.0027, 6, 0.54, 0.75, 773, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_source", "arg_names": [], "import_names": [], "rhs_call_name": "set_source", "annotation": ""}, "snippet": " cairo_context.set_source(brushes_pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L322_C12", "label": "paint()", "type": "expression", "loc": [322, 322], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8541, 0.0027, 6, 0.54, 0.875, 376, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "paint", "arg_names": [], "import_names": [], "rhs_call_name": "paint", "annotation": ""}, "snippet": " cairo_context.paint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L323_C12", "label": "restore()", "type": "expression", "loc": [323, 323], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "vector": [8, 6, 0.8568, 0.0027, 6, 0.54, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "restore", "arg_names": [], "import_names": [], "rhs_call_name": "restore", "annotation": ""}, "snippet": " cairo_context.restore()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "label": "if", "type": "if", "loc": [325, 336], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "vector": [4, 5, 0.8767, 0.0318, 5, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if trigger != None:\n half_tile_size = TILE_SIZE / 2\n cairo_context.save()\n cairo_context.translate(window_x, window_y)\n cairo_context.scale(self._view_zoom, self._view_zoom)\n cairo_context.translate(half_tile_size, half_tile_size)\n cairo_context.arc(\n 0.0, 0.0, half_tile_size - 10, 0.0, 2.0 * 3.1415926)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L326_C12", "label": "half_tile_size =", "type": "assigned_variable", "loc": [326, 326], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [14, 6, 0.8647, 0.0027, 6, 0.33, 0.0, 791, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "half_tile_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " half_tile_size = TILE_SIZE / 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L327_C12", "label": "save()", "type": "expression", "loc": [327, 327], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8674, 0.0027, 6, 0.33, 0.1111, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " cairo_context.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L328_C12", "label": "translate()", "type": "expression", "loc": [328, 328], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.87, 0.0027, 6, 0.33, 0.2222, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(window_x, window_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L329_C12", "label": "scale()", "type": "expression", "loc": [329, 329], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8727, 0.0027, 6, 0.33, 0.3333, 18, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "scale", "arg_names": [], "import_names": [], "rhs_call_name": "scale", "annotation": ""}, "snippet": " cairo_context.scale(self._view_zoom, self._view_zoom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L330_C12", "label": "translate()", "type": "expression", "loc": [330, 330], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8753, 0.0027, 6, 0.33, 0.4444, 384, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "translate", "arg_names": [], "import_names": [], "rhs_call_name": "translate", "annotation": ""}, "snippet": " cairo_context.translate(half_tile_size, half_tile_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L331_C12", "label": "arc()", "type": "expression", "loc": [331, 332], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8793, 0.0053, 6, 0.33, 0.5556, 646, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "arc", "arg_names": [], "import_names": [], "rhs_call_name": "arc", "annotation": ""}, "snippet": " cairo_context.arc(\n 0.0, 0.0, half_tile_size - 10, 0.0, 2.0 * 3.1415926)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L333_C12", "label": "set_source_rgba()", "type": "expression", "loc": [333, 333], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8833, 0.0027, 6, 0.33, 0.6667, 979, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_source_rgba", "arg_names": [], "import_names": [], "rhs_call_name": "set_source_rgba", "annotation": ""}, "snippet": " cairo_context.set_source_rgba(1, 1, 0.5, 0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L334_C12", "label": "set_line_width()", "type": "expression", "loc": [334, 334], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8859, 0.0027, 6, 0.33, 0.7778, 143, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_line_width", "arg_names": [], "import_names": [], "rhs_call_name": "set_line_width", "annotation": ""}, "snippet": " cairo_context.set_line_width(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L335_C12", "label": "stroke()", "type": "expression", "loc": [335, 335], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8886, 0.0027, 6, 0.33, 0.8889, 765, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stroke", "arg_names": [], "import_names": [], "rhs_call_name": "stroke", "annotation": ""}, "snippet": " cairo_context.stroke()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L336_C12", "label": "restore()", "type": "expression", "loc": [336, 336], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "vector": [8, 6, 0.8912, 0.0027, 6, 0.33, 1.0, 821, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "restore", "arg_names": [], "import_names": [], "rhs_call_name": "restore", "annotation": ""}, "snippet": " cairo_context.restore()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L340_C8", "label": "y =", "type": "assigned_variable", "loc": [340, 340], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L292_C6", "vector": [14, 4, 0.9019, 0.0027, 4, 0.96, 1.0, 304, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L342_C6", "label": "cairo_context = cairo_create()", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [14, 3, 0.9072, 0.0027, 3, 0.8, 0.6364, 845, 3, 0, 0, 0, 317, 10, 1], "semantic": {"name": "cairo_context", "arg_names": [], "import_names": [], "rhs_call_name": "cairo_create", "annotation": ""}, "snippet": " cairo_context = widget.window.cairo_create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L343_C6", "label": "select_font_face()", "type": "expression", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [8, 3, 0.9098, 0.0027, 3, 0.8, 0.7273, 633, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "select_font_face", "arg_names": [], "import_names": [], "rhs_call_name": "select_font_face", "annotation": ""}, "snippet": " cairo_context.select_font_face(\"Sans\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L344_C6", "label": "set_font_size()", "type": "expression", "loc": [344, 344], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [8, 3, 0.9125, 0.0027, 3, 0.8, 0.8182, 59, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_font_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_font_size", "annotation": ""}, "snippet": " cairo_context.set_font_size(18)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L345_C6", "label": "move_to()", "type": "expression", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [8, 3, 0.9151, 0.0027, 3, 0.8, 0.9091, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_to", "arg_names": [], "import_names": [], "rhs_call_name": "move_to", "annotation": ""}, "snippet": " cairo_context.move_to(event.area.width / 2, event.area.height / 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L346_C6", "label": "show_text()", "type": "expression", "loc": [346, 346], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "vector": [8, 3, 0.9178, 0.0027, 3, 0.8, 1.0, 456, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "show_text", "arg_names": [], "import_names": [], "rhs_call_name": "show_text", "annotation": ""}, "snippet": " cairo_context.show_text(\"No tile set loaded.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L347_C4", "label": "return", "type": "return", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L283_C2", "vector": [13, 2, 0.9204, 0.0027, 2, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "label": "ChooseOpenFile", "type": "function", "loc": [349, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.939, 0.0292, 1, 0.03, 0.9524, 836, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "ChooseOpenFile", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ChooseOpenFile(self):\n chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_OPEN,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,\n gtk.RESPONSE_OK))\n response = chooser.run()\n result = None\n if response == gtk.RESPONSE_OK:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L350_C4", "label": "chooser = FileChooserDialog()", "type": "assigned_variable", "loc": [350, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "vector": [14, 2, 0.9324, 0.0106, 2, 0.48, 0.0, 249, 3, 3, 0, 0, 214, 10, 1], "semantic": {"name": "chooser", "arg_names": [], "import_names": [], "rhs_call_name": "FileChooserDialog", "annotation": ""}, "snippet": " chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_OPEN,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN,\n gtk.RESPONSE_OK))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L354_C4", "label": "response = run()", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "vector": [14, 2, 0.939, 0.0027, 2, 0.48, 0.2, 511, 3, 0, 0, 0, 679, 10, 1], "semantic": {"name": "response", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " response = chooser.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L355_C4", "label": "result =", "type": "assigned_variable", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "vector": [14, 2, 0.9416, 0.0027, 2, 0.48, 0.4, 51, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L356_C4", "label": "if", "type": "if", "loc": [356, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "vector": [4, 2, 0.9456, 0.0053, 2, 0.48, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response == gtk.RESPONSE_OK:\n result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L357_C6", "label": "result = get_filename()", "type": "assigned_variable", "loc": [357, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L356_C4", "vector": [14, 3, 0.9469, 0.0027, 3, 0.08, 0.0, 51, 3, 0, 0, 0, 676, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_filename", "annotation": ""}, "snippet": " result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L358_C4", "label": "destroy()", "type": "expression", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "vector": [8, 2, 0.9496, 0.0027, 2, 0.48, 0.8, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " chooser.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L359_C4", "label": "return", "type": "return", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "vector": [13, 2, 0.9523, 0.0027, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "label": "ChooseSaveFile", "type": "function", "loc": [361, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "vector": [2, 1, 0.9708, 0.0292, 1, 0.03, 1.0, 861, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "ChooseSaveFile", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ChooseSaveFile(self):\n chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_SAVE,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,\n gtk.RESPONSE_OK))\n response = chooser.run()\n result = None\n if response == gtk.RESPONSE_OK:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L362_C4", "label": "chooser = FileChooserDialog()", "type": "assigned_variable", "loc": [362, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "vector": [14, 2, 0.9642, 0.0106, 2, 0.06, 0.0, 249, 3, 3, 0, 0, 214, 10, 1], "semantic": {"name": "chooser", "arg_names": [], "import_names": [], "rhs_call_name": "FileChooserDialog", "annotation": ""}, "snippet": " chooser = gtk.FileChooserDialog(\n title = None,action=gtk.FILE_CHOOSER_ACTION_SAVE,\n buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE,\n gtk.RESPONSE_OK))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L366_C4", "label": "response = run()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "vector": [14, 2, 0.9708, 0.0027, 2, 0.06, 0.2, 511, 3, 0, 0, 0, 679, 10, 1], "semantic": {"name": "response", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " response = chooser.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L367_C4", "label": "result =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "vector": [14, 2, 0.9735, 0.0027, 2, 0.06, 0.4, 51, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L368_C4", "label": "if", "type": "if", "loc": [368, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "vector": [4, 2, 0.9775, 0.0053, 2, 0.06, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response == gtk.RESPONSE_OK:\n result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L369_C6", "label": "result = get_filename()", "type": "assigned_variable", "loc": [369, 369], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L368_C4", "vector": [14, 3, 0.9788, 0.0027, 3, 0.0, 0.0, 51, 3, 0, 0, 0, 676, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_filename", "annotation": ""}, "snippet": " result = chooser.get_filename()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L370_C4", "label": "destroy()", "type": "expression", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "vector": [8, 2, 0.9814, 0.0027, 2, 0.06, 0.8, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "destroy", "arg_names": [], "import_names": [], "rhs_call_name": "destroy", "annotation": ""}, "snippet": " chooser.destroy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L371_C4", "label": "return", "type": "return", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "vector": [13, 2, 0.9841, 0.0027, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "label": "if", "type": "if", "loc": [374, 377], "level": 0, "parent": null, "vector": [4, 0, 0.996, 0.0106, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n gobject.threads_init()\n editor_window = EditorWindow()\n gtk.main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L375_C2", "label": "threads_init()", "type": "expression", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "vector": [8, 1, 0.9947, 0.0027, 1, 0.91, 0.0, 739, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "threads_init", "arg_names": [], "import_names": [], "rhs_call_name": "threads_init", "annotation": ""}, "snippet": " gobject.threads_init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L376_C2", "label": "editor_window = EditorWindow()", "type": "assigned_variable", "loc": [376, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "vector": [14, 1, 0.9973, 0.0027, 1, 0.91, 0.5, 36, 3, 0, 0, 0, 713, 10, 1], "semantic": {"name": "editor_window", "arg_names": [], "import_names": [], "rhs_call_name": "EditorWindow", "annotation": ""}, "snippet": " editor_window = EditorWindow()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L377_C2", "label": "main()", "type": "expression", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "vector": [8, 1, 1.0, 0.0027, 1, 0.91, 1.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " gtk.main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L37_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L46_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L53_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L56_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L61_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L72_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L97_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L98_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L98_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L101_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L102_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L102_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L118_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L115_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L121_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L141_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L144_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L147_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L149_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L150_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L151_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L152_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L153_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L131_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L160_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L162_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L168_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L171_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L173_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L173_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L175_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L176_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L176_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L179_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L181_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L183_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L185_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L187_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:For_L195_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L199_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L201_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L201_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L203_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L205_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L207_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L211_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L212_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L214_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L224_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L225_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L227_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L228_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L229_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L230_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L232_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L234_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L235_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L236_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L241_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L246_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L248_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L249_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L250_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L251_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L253_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L255_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L256_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L269_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L283_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L283_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L286_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L287_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L288_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L289_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L290_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L291_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L292_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L292_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L294_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L295_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L296_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L300_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L301_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L302_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L303_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L304_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L305_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L307_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L308_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L310_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L311_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L318_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L319_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L313_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L293_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L330_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L325_C10", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L336_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:While_L292_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L342_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L343_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L344_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L345_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L346_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L283_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L357_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L358_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L349_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L368_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L369_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:FunctionDef_L361_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Return_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L375_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Assign_L376_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99200:If_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99200:Expr_L377_C2"}] |
#! /usr/bin/python
import random
import sys
import roslib; roslib.load_manifest("hrl_object_fetching")
import rospy
import actionlib
from pr2_overhead_grasping.msg import *
#from pr2_playpen.srv import *
from hrl_lib.keyboard_input import KeyboardInput
from pr2_overhead_grasping.helpers import log
from tabletop_object_detector.srv import TabletopSegmentation
from tabletop_object_detector.msg import TabletopDetectionResult
##
# Uses the object_detection service detect objects on the table. Returns a list
# of pairs [ [ x, y, z], rot ] which represent the centers and z orientation of
# each object detected on the table.
def detect_tabletop_objects():
DETECT_ERROR = 0.
#cbbf = ClusterBoundingBoxFinder(tf_listener=self.oger.cm.tf_listener)
object_detector = rospy.ServiceProxy("/tabletop_segmentation", TabletopSegmentation)
table = object_detector().table
object_detector.close()
return table
#if detects.result != 4:
# err("Detection failed (err %d)" % (detects.result))
# return []
#table_z = detects.table.pose.pose.position.z
#objects = []
#for cluster in detects.clusters:
# (object_points,
# object_bounding_box_dims,
# object_bounding_box,
# object_to_base_link_frame,
# object_to_cluster_frame) = cbbf.find_object_frame_and_bounding_box(cluster)
# # log("bounding box:", object_bounding_box)
# (object_pos, object_quat) = cf.mat_to_pos_and_quat(object_to_cluster_frame)
# angs = euler_from_quaternion(object_quat)
# log("angs:", angs)
# # position is half of height
# object_pos[2] = table_z + object_bounding_box[1][2] / 2. + DETECT_ERROR
# log("pos:", object_pos)
# log("table_z:", table_z)
# objects += [[object_pos, angs[2]]]
#return objects
if __name__ == '__main__':
args = sys.argv
rospy.init_node('object_fetching')
print detect_tabletop_objects()
# ki = KeyboardInput()
# grasp_client = actionlib.SimpleActionClient('overhead_grasp', OverheadGraspAction)
# grasp_client.wait_for_server()
# grasp_setup_client = actionlib.SimpleActionClient('overhead_grasp_setup', OverheadGraspSetupAction)
# grasp_setup_client.wait_for_server()
# print "grasp_client ready"
# if args[1] == 'reg_test':
# results_dict = {}
# ki.kbhit()
# while not rospy.is_shutdown():
# goal = OverheadGraspSetupGoal()
# grasp_setup_client.send_goal(goal)
# #grasp_setup_client.wait_for_result()
# rospy.sleep(1.0)
#
# print "Grasp started"
# goal = OverheadGraspGoal()
# goal.is_grasp = True
# goal.grasp_type=OverheadGraspGoal.VISION_GRASP
# goal.x = 0.5 + random.uniform(-0.1, 0.1)
# goal.y = 0.0 + random.uniform(-0.1, 0.1)
# grasp_client.send_goal(goal)
# grasp_client.wait_for_result()
# result = grasp_client.get_result()
# goal = OverheadGraspGoal()
# if result.grasp_result == "Table collision" or True:
# goal.is_grasp = False
# goal.grasp_type=OverheadGraspGoal.MANUAL_GRASP
# goal.x = 0.5 + random.uniform(-0.1, 0.1)
# goal.y = 0.0 + random.uniform(-0.1, 0.1)
# grasp_client.send_goal(goal)
# grasp_client.wait_for_result()
# result = grasp_client.get_result()
# if result.grasp_result not in results_dict:
# results_dict[result.grasp_result] = 0
# results_dict[result.grasp_result] += 1
#
# print results_dict
# try:
# print float(results_dict["No collision"]) / results_dict["Regular collision"]
# except:
# pass
#
# elif args[1] == 'playpen_demo':
# rospy.wait_for_service('conveyor')
# conveyor = rospy.ServiceProxy('conveyor', Conveyor)
# print "conveyor ready"
# rospy.wait_for_service('playpen')
# playpen = rospy.ServiceProxy('playpen', Playpen)
# print "playpen ready"
# print "waiting for setup"
# rospy.sleep(20.0)
# while not rospy.is_shutdown():
# conveyor(0.10 * 2.)
#
# print "Grasp started"
# goal = OverheadGraspGoal()
# goal.is_grasp = True
# goal.grasp_type=OverheadGraspGoal.VISION_GRASP
# goal.x = 0.5
# goal.y = 0.0
# grasp_client.send_goal(goal)
# grasp_client.wait_for_result()
# result = grasp_client.get_result()
# goal = OverheadGraspGoal()
# goal.is_grasp = False
# goal.grasp_type=OverheadGraspGoal.MANUAL_GRASP
# goal.x = 0.5 + random.uniform(-0.1, 0.1)
# goal.y = 0.0 + random.uniform(-0.1, 0.1)
# grasp_client.send_goal(goal)
# grasp_client.wait_for_result()
# result = grasp_client.get_result()
#
# # do playpen stuff
#
# log("Opening trap door")
# playpen(1)
# rospy.sleep(0.2)
# log("Closing trap door")
# playpen(0)
# rospy.sleep(0.2)
| ajibawa-2023/Python-Code-Large/train/row_99201 | 21 | 137 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Import_L2_C0", "label": "random import random", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0146, 0.0073, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rhs_call_name": "", "annotation": ""}, "snippet": "import random"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0219, 0.0073, 0, 0.66, 0.0833, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0365, 0.0073, 0, 0.66, 0.1667, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest(\"hrl_object_fetching\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L5_C15", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0365, 0.0073, 0, 0.66, 0.25, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest(\"hrl_object_fetching\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0438, 0.0073, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Import_L7_C0", "label": "actionlib import actionlib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0511, 0.0073, 0, 0.66, 0.4167, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:ImportFrom_L9_C0", "label": "from pr2_overhead_grasping.msg import *", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0657, 0.0073, 0, 0.66, 0.5, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "pr2_overhead_grasping.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_overhead_grasping.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:ImportFrom_L11_C0", "label": "from hrl_lib.keyboard_input import KeyboardInput", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0803, 0.0073, 0, 0.66, 0.5833, 339, 0, 1, 0, 0, 339, 0, 0], "semantic": {"name": "hrl_lib.keyboard_input", "arg_names": [], "import_names": ["KeyboardInput"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.keyboard_input import KeyboardInput"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:ImportFrom_L12_C0", "label": "from pr2_overhead_grasping.helpers import log", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0876, 0.0073, 0, 0.66, 0.6667, 931, 0, 1, 0, 0, 931, 0, 0], "semantic": {"name": "pr2_overhead_grasping.helpers", "arg_names": [], "import_names": ["log"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_overhead_grasping.helpers import log"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:ImportFrom_L13_C0", "label": "from tabletop_object_detector.srv import TabletopSegmentation", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0949, 0.0073, 0, 0.66, 0.75, 763, 0, 1, 0, 0, 763, 0, 0], "semantic": {"name": "tabletop_object_detector.srv", "arg_names": [], "import_names": ["TabletopSegmentation"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tabletop_object_detector.srv import TabletopSegmentation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:ImportFrom_L14_C0", "label": "from tabletop_object_detector.msg import TabletopDetectionResult", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1022, 0.0073, 0, 0.66, 0.8333, 29, 0, 1, 0, 0, 29, 0, 0], "semantic": {"name": "tabletop_object_detector.msg", "arg_names": [], "import_names": ["TabletopDetectionResult"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tabletop_object_detector.msg import TabletopDetectionResult"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "label": "detect_tabletop_objects", "type": "function", "loc": [20, 26], "level": 0, "parent": null, "vector": [2, 0, 0.1679, 0.0511, 0, 0.66, 0.9167, 463, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "detect_tabletop_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def detect_tabletop_objects():\n DETECT_ERROR = 0.\n #cbbf = ClusterBoundingBoxFinder(tf_listener=self.oger.cm.tf_listener)\n object_detector = rospy.ServiceProxy(\"/tabletop_segmentation\", TabletopSegmentation)\n table = object_detector().table\n object_detector.close()\n return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L21_C4", "label": "DETECT_ERROR =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "vector": [14, 1, 0.1533, 0.0073, 1, 0.35, 0.0, 77, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "DETECT_ERROR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " DETECT_ERROR = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L23_C4", "label": "object_detector = ServiceProxy()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "vector": [14, 1, 0.1679, 0.0073, 1, 0.35, 0.25, 484, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "object_detector", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " object_detector = rospy.ServiceProxy(\"/tabletop_segmentation\", TabletopSegmentation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L24_C4", "label": "table =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "vector": [14, 1, 0.1752, 0.0073, 1, 0.35, 0.5, 338, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = object_detector().table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L25_C4", "label": "close()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "vector": [8, 1, 0.1825, 0.0073, 1, 0.35, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " object_detector.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Return_L26_C4", "label": "return", "type": "return", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "vector": [13, 1, 0.1898, 0.0073, 1, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "label": "if", "type": "if", "loc": [50, 53], "level": 0, "parent": null, "vector": [4, 0, 0.3759, 0.0292, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n args = sys.argv\n rospy.init_node('object_fetching')\n print(detect_tabletop_objects())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L51_C4", "label": "args =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "vector": [14, 1, 0.3723, 0.0073, 1, 0.95, 0.0, 805, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = sys.argv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L52_C4", "label": "init_node()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "vector": [8, 1, 0.3796, 0.0073, 1, 0.95, 0.5, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L53_C4", "label": "print()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "vector": [8, 1, 0.3869, 0.0073, 1, 0.95, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(detect_tabletop_objects())"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Return_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99201:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99201:Expr_L53_C4"}] |
#! /usr/bin/python
import numpy as np, math
import scipy.io as spio
import roslib; roslib.load_manifest('hrl_object_fetching')
import rospy
import hrl_lib.util as hrl_util
from std_msgs.msg import Float64MultiArray, Bool
from pr2_msgs.msg import AccelerometerState, PressureState
from sensor_msgs.msg import JointState
from pr2_controllers_msgs.msg import JointTrajectoryControllerState
from hrl_pr2_lib.pr2 import PR2, Joint
from motion_planning_msgs.srv import FilterJointTrajectory
import pr2_controllers_msgs.msg as pm
UNTUCK = False
rospy.init_node('untuck_grasp')
[q, t] = hrl_util.load_pickle('untuck_traj_6.pickle')
q = np.mat(q.T)
q = q[:,0::30]
#trim_val = -1
#q = q[:,0:trim_val]
#q[:,-1] = np.mat([[-0.269010636167, -0.307363010617, -1.52246181858, -1.67151320238, 294.057002545, -1.55558026761, -1.71909509593]]).T
vel = q.copy()
vel[:,1:] -= q[:,0:-1]
vel[:,0] = 0
vel /= 0.3
#vel[:,-1] = np.mat([[0.1] * 7]).T
t = np.linspace(1.3, 1.3 + (q.shape[1] - 1) * 0.3, q.shape[1])
#t[-1] = t[-1] + 2
#t = q / vel
#t = t.max(1)
#t = np.cumsum(t)
#print t
pr2 = PR2()
rospy.wait_for_service('trajectory_filter/filter_trajectory')
filter_traj = rospy.ServiceProxy('trajectory_filter/filter_trajectory', FilterJointTrajectory)
#print q.shape
#vel = vel[:,0:trim_val]
#t = t[0:trim_val]
if not UNTUCK:
q = q[:,::-1]
vel = -vel[:,::-1]
vel[:,-1] = 0
#vel[:,0] = np.mat([[0.1] * 7]).T
#t[-1] = t[-1] - 2
t[0] = 0
t[1:] += 0.1
#print q
#print vel
joint_traj = pr2.right._create_trajectory(q, t, vel)
result = filter_traj(trajectory=joint_traj, allowed_time=rospy.Duration.from_sec(20))
filtered_traj = result.trajectory
filtered_traj.header.stamp = rospy.get_rostime() + rospy.Duration(1.)
g = pm.JointTrajectoryGoal()
g.trajectory = joint_traj
pr2.right.client.send_goal(g)
#pr2.right.set_poses(q, t, vel)
#def set_poses(self, pos_mat, times, vel_mat=None, block=True):
| ajibawa-2023/Python-Code-Large/train/row_99202 | 36 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0328, 0.0164, 0, 0.66, 0.0, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Import_L3_C0", "label": "scipy.io import spio", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0164, 0, 0.66, 0.0323, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "scipy.io", "arg_names": [], "import_names": ["spio"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.io as spio"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0164, 0, 0.66, 0.0645, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0656, 0.0164, 0, 0.66, 0.0968, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0164, 0, 0.66, 0.129, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Import_L6_C0", "label": "hrl_lib.util import hrl_util", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0164, 0, 0.66, 0.1613, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hrl_util"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as hrl_util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:ImportFrom_L7_C0", "label": "from std_msgs.msg import Float64MultiArray, Bool", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1148, 0.0164, 0, 0.66, 0.1935, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64MultiArray", "Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64MultiArray, Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:ImportFrom_L8_C0", "label": "from pr2_msgs.msg import AccelerometerState, PressureState", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1311, 0.0164, 0, 0.66, 0.2258, 797, 0, 2, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["AccelerometerState", "PressureState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_msgs.msg import AccelerometerState, PressureState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:ImportFrom_L9_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1475, 0.0164, 0, 0.66, 0.2581, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:ImportFrom_L10_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryControllerState", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1639, 0.0164, 0, 0.66, 0.2903, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:ImportFrom_L11_C0", "label": "from hrl_pr2_lib.pr2 import PR2, Joint", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1803, 0.0164, 0, 0.66, 0.3226, 137, 0, 2, 0, 0, 137, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2", "arg_names": [], "import_names": ["PR2", "Joint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_lib.pr2 import PR2, Joint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:ImportFrom_L12_C0", "label": "from motion_planning_msgs.srv import FilterJointTrajectory", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1967, 0.0164, 0, 0.66, 0.3548, 316, 0, 1, 0, 0, 316, 0, 0], "semantic": {"name": "motion_planning_msgs.srv", "arg_names": [], "import_names": ["FilterJointTrajectory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from motion_planning_msgs.srv import FilterJointTrajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Import_L13_C0", "label": "pr2_controllers_msgs.msg import pm", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.2131, 0.0164, 0, 0.66, 0.3871, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_controllers_msgs.msg as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L15_C0", "label": "UNTUCK =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.2459, 0.0164, 0, 0.66, 0.4194, 744, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "UNTUCK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "UNTUCK = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Expr_L17_C0", "label": "init_node()", "type": "expression", "loc": [17, 17], "level": 0, "parent": null, "vector": [8, 0, 0.2787, 0.0164, 0, 0.66, 0.4516, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node('untuck_grasp')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L18_C0", "label": " = load_pickle()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.2951, 0.0164, 0, 0.66, 0.4839, 0, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": "[q, t] = hrl_util.load_pickle('untuck_traj_6.pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L19_C0", "label": "q = mat()", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.3115, 0.0164, 0, 0.66, 0.5161, 516, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": "q = np.mat(q.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L20_C0", "label": "q =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.3279, 0.0164, 0, 0.66, 0.5484, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "q = q[:,0::30]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L24_C0", "label": "vel = copy()", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.3934, 0.0164, 0, 0.66, 0.5806, 527, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": "vel = q.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L26_C0", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.4262, 0.0164, 0, 0.66, 0.6452, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "vel[:,0] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L29_C0", "label": "t = linspace()", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.4754, 0.0164, 0, 0.66, 0.7097, 15, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": "t = np.linspace(1.3, 1.3 + (q.shape[1] - 1) * 0.3, q.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L35_C0", "label": "pr2 = PR2()", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.5738, 0.0164, 0, 0.66, 0.7419, 244, 3, 0, 0, 0, 573, 10, 1], "semantic": {"name": "pr2", "arg_names": [], "import_names": [], "rhs_call_name": "PR2", "annotation": ""}, "snippet": "pr2 = PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Expr_L36_C0", "label": "wait_for_service()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.5902, 0.0164, 0, 0.66, 0.7742, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": "rospy.wait_for_service('trajectory_filter/filter_trajectory')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L37_C0", "label": "filter_traj = ServiceProxy()", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.6066, 0.0164, 0, 0.66, 0.8065, 859, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "filter_traj", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": "filter_traj = rospy.ServiceProxy('trajectory_filter/filter_trajectory', FilterJointTrajectory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "label": "if", "type": "if", "loc": [41, 48], "level": 0, "parent": null, "vector": [4, 0, 0.7295, 0.1311, 0, 0.66, 0.8387, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not UNTUCK:\n q = q[:,::-1]\n vel = -vel[:,::-1]\n vel[:,-1] = 0\n #vel[:,0] = np.mat([[0.1] * 7]).T\n #t[-1] = t[-1] - 2\n t[0] = 0\n t[1:] += 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L42_C4", "label": "q =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "vector": [14, 1, 0.6885, 0.0164, 1, 0.33, 0.0, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = q[:,::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L43_C4", "label": "vel =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "vector": [14, 1, 0.7049, 0.0164, 1, 0.33, 0.3333, 527, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = -vel[:,::-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L44_C4", "label": "assign", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "vector": [14, 1, 0.7213, 0.0164, 1, 0.33, 0.6667, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel[:,-1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L47_C4", "label": "assign", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "vector": [14, 1, 0.7705, 0.0164, 1, 0.33, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t[0] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L52_C0", "label": "joint_traj = _create_trajectory()", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.8525, 0.0164, 0, 0.66, 0.871, 460, 3, 3, 0, 0, 149, 10, 1], "semantic": {"name": "joint_traj", "arg_names": [], "import_names": [], "rhs_call_name": "_create_trajectory", "annotation": ""}, "snippet": "joint_traj = pr2.right._create_trajectory(q, t, vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L53_C0", "label": "result = filter_traj()", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.8689, 0.0164, 0, 0.66, 0.9032, 51, 3, 2, 0, 0, 859, 10, 2], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "filter_traj", "annotation": ""}, "snippet": "result = filter_traj(trajectory=joint_traj, allowed_time=rospy.Duration.from_sec(20))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L54_C0", "label": "filtered_traj =", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.8852, 0.0164, 0, 0.66, 0.9355, 746, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filtered_traj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "filtered_traj = result.trajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L55_C0", "label": "filtered_traj.header.stamp =", "type": "assigned_variable", "loc": [55, 55], "level": 0, "parent": null, "vector": [14, 0, 0.9016, 0.0164, 0, 0.66, 0.9677, 46, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "filtered_traj.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "filtered_traj.header.stamp = rospy.get_rostime() + rospy.Duration(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L56_C0", "label": "g = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.918, 0.0164, 0, 0.66, 1.0, 384, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": "g = pm.JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L57_C0", "label": "g.trajectory =", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.9344, 0.0164, 0, 0.66, 1.0323, 100, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "g.trajectory = joint_traj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99202:Expr_L58_C0", "label": "send_goal()", "type": "expression", "loc": [58, 58], "level": 0, "parent": null, "vector": [8, 0, 0.9508, 0.0164, 0, 0.66, 1.0645, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": "pr2.right.client.send_goal(g)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99202:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99202:Assign_L47_C4"}] |
#! /usr/bin/python
import numpy as np, math
import scipy.io as spio
import roslib; roslib.load_manifest('hrl_object_fetching')
import rospy
import hrl_lib.util as hrl_util
from std_msgs.msg import Float64MultiArray, Bool
from pr2_msgs.msg import AccelerometerState, PressureState
from sensor_msgs.msg import JointState
from pr2_controllers_msgs.msg import JointTrajectoryControllerState
r_jt_idx_lis = [17, 18, 16, 20, 19, 21, 22]
l_jt_idx_lis = [29, 30, 28, 32, 31, 33, 34]
n_samples = 100 * 20
class Listener:
def __init__(self):
self.q = np.zeros(( n_samples, 7))
self.t = np.zeros((n_samples, 1))
self.tind = 0
self.ind = 0
def callback(self,msg):
if self.ind % 10 == 0:
print self.tind, self.ind
for i,idx in enumerate(r_jt_idx_lis):
self.q[self.ind, i] = msg.position[idx]
print self.q[self.ind, i],
print ""
self.t[self.ind] = msg.header.stamp.to_sec()
self.ind += 1
rospy.init_node('quick_data')
lis = Listener()
sub = rospy.Subscriber('/joint_states', JointState, lis.callback)
#sub_started = rospy.Subscriber('/grasper/grasp_executing', Bool, lis.grasp_executing)
rospy.spin()
hrl_util.save_pickle([lis.q[0:lis.ind,:], lis.t[0:lis.ind,:]], 'untuck_traj_6.pickle')
i = 0
while lis.q[i,4] != 0:
print lis.q[i-1,3] - lis.q[i,3],
i += 1
#c = 10
#data = {'q%d'%c:lis.q, 'des%d'%c:lis.des, 't%d'%c:lis.t}
#data = {'q':lis.q, 'des':lis.des, 't':lis.t}
#spio.savemat('grasp_err_all_1.mat', data)
| ajibawa-2023/Python-Code-Large/train/row_99203 | 35 | 47 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0426, 0.0213, 0, 0.66, 0.0, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Import_L3_C0", "label": "scipy.io import spio", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0638, 0.0213, 0, 0.66, 0.05, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "scipy.io", "arg_names": [], "import_names": ["spio"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.io as spio"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0213, 0, 0.66, 0.1, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L4_C15", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0851, 0.0213, 0, 0.66, 0.15, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_object_fetching')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1064, 0.0213, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Import_L6_C0", "label": "hrl_lib.util import hrl_util", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1277, 0.0213, 0, 0.66, 0.25, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hrl_util"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as hrl_util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:ImportFrom_L7_C0", "label": "from std_msgs.msg import Float64MultiArray, Bool", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1489, 0.0213, 0, 0.66, 0.3, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64MultiArray", "Bool"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64MultiArray, Bool"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:ImportFrom_L8_C0", "label": "from pr2_msgs.msg import AccelerometerState, PressureState", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1702, 0.0213, 0, 0.66, 0.35, 797, 0, 2, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["AccelerometerState", "PressureState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_msgs.msg import AccelerometerState, PressureState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:ImportFrom_L9_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1915, 0.0213, 0, 0.66, 0.4, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:ImportFrom_L10_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryControllerState", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2128, 0.0213, 0, 0.66, 0.45, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L12_C0", "label": "r_jt_idx_lis =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2553, 0.0213, 0, 0.66, 0.5, 147, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "r_jt_idx_lis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "r_jt_idx_lis = [17, 18, 16, 20, 19, 21, 22]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L13_C0", "label": "l_jt_idx_lis =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.2766, 0.0213, 0, 0.66, 0.55, 930, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l_jt_idx_lis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "l_jt_idx_lis = [29, 30, 28, 32, 31, 33, 34]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L14_C0", "label": "n_samples =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.2979, 0.0213, 0, 0.66, 0.6, 812, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "n_samples = 100 * 20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:ClassDef_L15_C0", "label": "Listener", "type": "class", "loc": [15, 30], "level": 0, "parent": null, "vector": [3, 0, 0.4787, 0.3404, 0, 0.66, 0.65, 32, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "Listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Listener:\n def __init__(self):\n self.q = np.zeros(( n_samples, 7))\n self.t = np.zeros((n_samples, 1))\n self.tind = 0\n self.ind = 0\n\n def callback(self,msg):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "label": "__init__", "type": "function", "loc": [16, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:ClassDef_L15_C0", "vector": [2, 1, 0.383, 0.1064, 1, 0.6, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.q = np.zeros(( n_samples, 7))\n self.t = np.zeros((n_samples, 1))\n self.tind = 0\n self.ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L17_C8", "label": "self.q = zeros()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "vector": [14, 2, 0.3617, 0.0213, 2, 0.22, 0.0, 561, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.q = np.zeros(( n_samples, 7))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L18_C8", "label": "self.t = zeros()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "vector": [14, 2, 0.383, 0.0213, 2, 0.22, 0.3333, 670, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "self.t", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " self.t = np.zeros((n_samples, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L19_C8", "label": "self.tind =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "vector": [14, 2, 0.4043, 0.0213, 2, 0.22, 0.6667, 287, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.tind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L20_C8", "label": "self.ind =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "vector": [14, 2, 0.4255, 0.0213, 2, 0.22, 1.0, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "label": "callback", "type": "function", "loc": [22, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:ClassDef_L15_C0", "vector": [2, 1, 0.5532, 0.1915, 1, 0.6, 1.0, 342, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self,msg):\n if self.ind % 10 == 0:\n print(self.tind, self.ind)\n for i,idx in enumerate(r_jt_idx_lis):\n self.q[self.ind, i] = msg.position[idx]\n print(self.q[self.ind, i],)\n print(\"\")\n self.t[self.ind] = msg.header.stamp.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:If_L23_C8", "label": "if", "type": "if", "loc": [23, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "vector": [4, 2, 0.5, 0.0426, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.ind % 10 == 0:\n print(self.tind, self.ind)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L24_C12", "label": "print()", "type": "expression", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:If_L23_C8", "vector": [8, 3, 0.5106, 0.0213, 3, 0.03, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.tind, self.ind)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:For_L25_C8", "label": "for i, idx", "type": "for", "loc": [25, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "vector": [6, 2, 0.5532, 0.0638, 2, 0.23, 0.3333, 506, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,idx in enumerate(r_jt_idx_lis):\n self.q[self.ind, i] = msg.position[idx]\n print(self.q[self.ind, i],)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L26_C12", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:For_L25_C8", "vector": [14, 3, 0.5532, 0.0213, 3, 0.84, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q[self.ind, i] = msg.position[idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L27_C12", "label": "print()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:For_L25_C8", "vector": [8, 3, 0.5745, 0.0213, 3, 0.84, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.q[self.ind, i],)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L28_C8", "label": "print()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "vector": [8, 2, 0.5957, 0.0213, 2, 0.23, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L29_C8", "label": " = to_sec()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "vector": [14, 2, 0.617, 0.0213, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 750, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.t[self.ind] = msg.header.stamp.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L33_C0", "label": "init_node()", "type": "expression", "loc": [33, 33], "level": 0, "parent": null, "vector": [8, 0, 0.7021, 0.0213, 0, 0.66, 0.7, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node('quick_data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L34_C0", "label": "lis = Listener()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.7234, 0.0213, 0, 0.66, 0.75, 96, 3, 0, 0, 0, 32, 10, 1], "semantic": {"name": "lis", "arg_names": [], "import_names": [], "rhs_call_name": "Listener", "annotation": ""}, "snippet": "lis = Listener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L35_C0", "label": "sub = Subscriber()", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.7447, 0.0213, 0, 0.66, 0.8, 819, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "sub = rospy.Subscriber('/joint_states', JointState, lis.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L37_C0", "label": "spin()", "type": "expression", "loc": [37, 37], "level": 0, "parent": null, "vector": [8, 0, 0.7872, 0.0213, 0, 0.66, 0.85, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": "rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L38_C0", "label": "save_pickle()", "type": "expression", "loc": [38, 38], "level": 0, "parent": null, "vector": [8, 0, 0.8085, 0.0213, 0, 0.66, 0.9, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": "hrl_util.save_pickle([lis.q[0:lis.ind,:], lis.t[0:lis.ind,:]], 'untuck_traj_6.pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L39_C0", "label": "i =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.8298, 0.0213, 0, 0.66, 0.95, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:While_L40_C0", "label": "while", "type": "while", "loc": [40, 42], "level": 0, "parent": null, "vector": [5, 0, 0.8723, 0.0638, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while lis.q[i,4] != 0:\n print(lis.q[i-1,3] - lis.q[i,3],)\n i += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L41_C4", "label": "print()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99203:While_L40_C0", "vector": [8, 1, 0.8723, 0.0213, 1, 0.64, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(lis.q[i-1,3] - lis.q[i,3],)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99203:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:For_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:For_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:For_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99203:While_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99203:Expr_L41_C4"}] |
#! /usr/bin/python
import roslib
roslib.load_manifest('hrl_trajectory_playback')
import rospy
import actionlib
import trajectory_msgs.msg as tm
import pr2_controllers_msgs.msg as pm
import hrl_lib.util as hrl_util
#from hrl_pr2_lib.pr2 import PR2, Joint
from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest
import numpy as np, math
##
# This code was crudely grabbed from Hai's hrl_pr2_lib.pr2 because it's broken...
class PR2(object):
def __init__(self):
self.right = PR2Arm('r')
self.left = PR2Arm('l')
class PR2Arm(object):
def __init__(self, arm):
joint_controller_name = arm + '_arm_controller'
self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % joint_controller_name, pm.JointTrajectoryAction)
rospy.loginfo('pr2arm: waiting for server %s' % joint_controller_name)
self.client.wait_for_server()
self.joint_names = rospy.get_param('/%s/joints' % joint_controller_name)
self.zeros = [0 for j in range(len(self.joint_names))]
def create_trajectory(self, pos_mat, times, vel_mat=None):
#Make JointTrajectoryPoints
points = [tm.JointTrajectoryPoint() for i in range(pos_mat.shape[1])]
for i in range(pos_mat.shape[1]):
points[i].positions = pos_mat[:,i].A1.tolist()
points[i].accelerations = self.zeros
if vel_mat == None:
points[i].velocities = self.zeros
else:
points[i].velocities = vel_mat[:,i].A1.tolist()
for i in range(pos_mat.shape[1]):
points[i].time_from_start = rospy.Duration(times[i])
#Create JointTrajectory
jt = tm.JointTrajectory()
jt.joint_names = self.joint_names
jt.points = points
jt.header.stamp = rospy.get_rostime()
return jt
##
class TrajPlayback():
def __init__( self, name, fname, arm = 'right' ):
self.arm = arm
self.name = name
rospy.logout( 'TrajPlayback: Initializing (%s)' % self.name )
try:
rospy.init_node('traj_playback_'+self.name)
except:
pass
dat = hrl_util.load_pickle( fname )
self.q = np.mat( dat[0].T )
# subsample
self.q = self.q[:,0::30]
# smooth
self.t = np.linspace( 1.3, 1.3 + (self.q.shape[1]-1)*0.3, self.q.shape[1] )
self.vel = self.q.copy()
self.vel[:,1:] -= self.q[:,0:-1]
self.vel[:,0] = 0
self.vel /= 0.3
self.pr2 = PR2()
self.__service = rospy.Service( 'traj_playback/' + name,
TrajPlaybackSrv,
self.process_service )
rospy.logout( 'TrajPlayback: Ready for service requests (%s)' % self.name )
def process_service( self, req ):
if req.play_backward:
rospy.loginfo( 'TrajPlayback: Playing Reverse (%s)' % self.name )
else:
rospy.loginfo( 'TrajPlayback: Playing Forward (%s)' % self.name )
if req.play_backward:
tq = self.q[:,::-1].copy()
tvel = -1 * self.vel[:,::-1].copy()
tvel[:,-1] = 0
tt = self.t.copy()
tt[0] = 0
tt[1:] += 0.1
else:
tq = self.q.copy()
tvel = self.vel.copy()
tt = self.t.copy()
if self.arm == 'right':
joint_traj = self.pr2.right.create_trajectory( tq, tt, tvel )
else:
joint_traj = self.pr2.left.create_trajectory( tq, tt, tvel )
dur = rospy.Duration.from_sec( tt[-1] + 5 )
# result = self.filter_traj( trajectory = joint_traj,
# allowed_time = dur)
# ft = result.trajectory
# ft.header.stamp = rospy.get_rostime() + rospy.Duration( 1.0 )
g = pm.JointTrajectoryGoal()
g.trajectory = joint_traj # why not ft...?
if self.arm == 'right':
self.pr2.right.client.send_goal( g )
self.pr2.right.client.wait_for_result()
else:
self.pr2.left.client.send_goal( g )
self.pr2.left.client.wait_for_result()
return True
if __name__ == '__main__':
import optparse
p = optparse.OptionParser()
p.add_option('--pkl', action='store', type='string', dest='pkl',
help='Output file [default=\'out.pkl\']', default='out.pkl')
p.add_option('--name', action='store', type='string', dest='name',
help='Service "name": /traj_playback/name [default=\'test\']',
default='test')
p.add_option('--play', action='store_true', dest='play',
help='Just play it once instead of building service [default=False]',
default=False)
p.add_option('--reverse', action='store_true', dest='rev',
help='Just play it once in reverse [default=False]',
default=False)
p.add_option('--left', action='store_true', dest='left_arm',
help='Use the left arm? [Right is default]')
opt, args = p.parse_args()
if opt.left_arm:
tp = TrajPlayback( opt.name, opt.pkl, arm = 'left' )
else:
tp = TrajPlayback( opt.name, opt.pkl, arm = 'right' )
if opt.play:
req = TrajPlaybackSrvRequest()
req.play_backward = opt.rev
tp.process_service( req )
else:
rospy.spin()
| ajibawa-2023/Python-Code-Large/train/row_99204 | 94 | 158 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0127, 0.0063, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.019, 0.0063, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_trajectory_playback')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0253, 0.0063, 0, 0.66, 0.1667, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L5_C0", "label": "actionlib import actionlib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0316, 0.0063, 0, 0.66, 0.25, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L7_C0", "label": "trajectory_msgs.msg import tm", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0443, 0.0063, 0, 0.66, 0.3333, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["tm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import trajectory_msgs.msg as tm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L8_C0", "label": "pr2_controllers_msgs.msg import pm", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0506, 0.0063, 0, 0.66, 0.4167, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_controllers_msgs.msg as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L9_C0", "label": "hrl_lib.util import hrl_util", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.057, 0.0063, 0, 0.66, 0.5, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hrl_util"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as hrl_util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:ImportFrom_L11_C0", "label": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0696, 0.0063, 0, 0.66, 0.5833, 12, 0, 2, 0, 0, 12, 0, 0], "semantic": {"name": "hrl_trajectory_playback.srv", "arg_names": [], "import_names": ["TrajPlaybackSrv", "TrajPlaybackSrvRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_trajectory_playback.srv import TrajPlaybackSrv, TrajPlaybackSrvRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L13_C0", "label": "numpy import np, math", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0823, 0.0063, 0, 0.66, 0.6667, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L17_C0", "label": "PR2", "type": "class", "loc": [17, 20], "level": 0, "parent": null, "vector": [3, 0, 0.1171, 0.0253, 0, 0.66, 0.75, 573, 0, 1, 0, 0, 186, 0, 2], "semantic": {"name": "PR2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2(object):\n def __init__(self):\n self.right = PR2Arm('r')\n self.left = PR2Arm('l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L17_C0", "vector": [2, 1, 0.1203, 0.019, 1, 0.96, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.right = PR2Arm('r')\n self.left = PR2Arm('l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L19_C8", "label": "self.right = PR2Arm()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L18_C4", "vector": [14, 2, 0.1203, 0.0063, 2, 0.21, 0.0, 683, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arm", "annotation": ""}, "snippet": " self.right = PR2Arm('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L20_C8", "label": "self.left = PR2Arm()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L18_C4", "vector": [14, 2, 0.1266, 0.0063, 2, 0.21, 1.0, 643, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arm", "annotation": ""}, "snippet": " self.left = PR2Arm('l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L22_C0", "label": "PR2Arm", "type": "class", "loc": [22, 50], "level": 0, "parent": null, "vector": [3, 0, 0.2278, 0.1835, 0, 0.66, 0.8333, 181, 0, 2, 0, 0, 186, 0, 15], "semantic": {"name": "PR2Arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arm(object):\n def __init__(self, arm):\n joint_controller_name = arm + '_arm_controller'\n self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % joint_controller_name, pm.JointTrajectoryAction)\n rospy.loginfo('pr2arm: waiting for server %s' % joint_controller_name)\n self.client.wait_for_server()\n self.joint_names = rospy.get_param('/%s/joints' % joint_controller_name)\n self.zeros = [0 for j in range(len(self.joint_names))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L22_C0", "vector": [2, 1, 0.1646, 0.0443, 1, 0.42, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n joint_controller_name = arm + '_arm_controller'\n self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % joint_controller_name, pm.JointTrajectoryAction)\n rospy.loginfo('pr2arm: waiting for server %s' % joint_controller_name)\n self.client.wait_for_server()\n self.joint_names = rospy.get_param('/%s/joints' % joint_controller_name)\n self.zeros = [0 for j in range(len(self.joint_names))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L24_C8", "label": "joint_controller_name =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "vector": [14, 2, 0.1519, 0.0063, 2, 0.17, 0.0, 606, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_controller_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_controller_name = arm + '_arm_controller'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L25_C8", "label": "self.client = SimpleActionClient()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "vector": [14, 2, 0.1582, 0.0063, 2, 0.17, 0.2, 349, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "self.client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " self.client = actionlib.SimpleActionClient('/%s/joint_trajectory_action' % joint_controller_name, pm.JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L26_C8", "label": "loginfo()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "vector": [8, 2, 0.1646, 0.0063, 2, 0.17, 0.4, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('pr2arm: waiting for server %s' % joint_controller_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L27_C8", "label": "wait_for_server()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "vector": [8, 2, 0.1709, 0.0063, 2, 0.17, 0.6, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L28_C8", "label": "self.joint_names = get_param()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "vector": [14, 2, 0.1772, 0.0063, 2, 0.17, 0.8, 338, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "self.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " self.joint_names = rospy.get_param('/%s/joints' % joint_controller_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L29_C8", "label": "self.zeros =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "vector": [14, 2, 0.1835, 0.0063, 2, 0.17, 1.0, 335, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.zeros", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.zeros = [0 for j in range(len(self.joint_names))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "label": "create_trajectory", "type": "function", "loc": [31, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L22_C0", "vector": [2, 1, 0.2563, 0.1266, 1, 0.42, 1.0, 448, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "create_trajectory", "arg_names": ["self", "pos_mat", "times", "vel_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_trajectory(self, pos_mat, times, vel_mat=None):\n #Make JointTrajectoryPoints\n points = [tm.JointTrajectoryPoint() for i in range(pos_mat.shape[1])]\n for i in range(pos_mat.shape[1]):\n points[i].positions = pos_mat[:,i].A1.tolist()\n points[i].accelerations = self.zeros\n if vel_mat == None:\n points[i].velocities = self.zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L33_C8", "label": "points =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [14, 2, 0.2089, 0.0063, 2, 0.0, 0.0, 738, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points = [tm.JointTrajectoryPoint() for i in range(pos_mat.shape[1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "label": "for i", "type": "for", "loc": [34, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [6, 2, 0.2342, 0.0443, 2, 0.0, 0.1429, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(pos_mat.shape[1]):\n points[i].positions = pos_mat[:,i].A1.tolist()\n points[i].accelerations = self.zeros\n if vel_mat == None:\n points[i].velocities = self.zeros\n else:\n points[i].velocities = vel_mat[:,i].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L35_C12", "label": "points[i].positions = tolist()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "vector": [14, 3, 0.2215, 0.0063, 3, 0.52, 0.0, 379, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "points[i].positions", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " points[i].positions = pos_mat[:,i].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L36_C12", "label": "points[i].accelerations =", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "vector": [14, 3, 0.2278, 0.0063, 3, 0.52, 0.5, 425, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "points[i].accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points[i].accelerations = self.zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L37_C12", "label": "if", "type": "if", "loc": [37, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "vector": [4, 3, 0.2437, 0.0253, 3, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vel_mat == None:\n points[i].velocities = self.zeros\n else:\n points[i].velocities = vel_mat[:,i].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L38_C16", "label": "points[i].velocities =", "type": "assigned_variable", "loc": [38, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L37_C12", "vector": [14, 4, 0.2405, 0.0063, 4, 0.08, 0.0, 925, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "points[i].velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points[i].velocities = self.zeros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L40_C16", "label": "points[i].velocities = tolist()", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L37_C12", "vector": [14, 4, 0.2532, 0.0063, 4, 0.08, 1.0, 925, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "points[i].velocities", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " points[i].velocities = vel_mat[:,i].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L42_C8", "label": "for i", "type": "for", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [6, 2, 0.269, 0.0127, 2, 0.0, 0.2857, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(pos_mat.shape[1]):\n points[i].time_from_start = rospy.Duration(times[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L43_C12", "label": "points[i].time_from_start = Duration()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L42_C8", "vector": [14, 3, 0.2722, 0.0063, 3, 0.94, 0.0, 300, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "points[i].time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " points[i].time_from_start = rospy.Duration(times[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L46_C8", "label": "jt = JointTrajectory()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [14, 2, 0.2911, 0.0063, 2, 0.0, 0.4286, 61, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jt", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " jt = tm.JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L47_C8", "label": "jt.joint_names =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [14, 2, 0.2975, 0.0063, 2, 0.0, 0.5714, 350, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.joint_names = self.joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L48_C8", "label": "jt.points =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [14, 2, 0.3038, 0.0063, 2, 0.0, 0.7143, 737, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.points = points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L49_C8", "label": "jt.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [14, 2, 0.3101, 0.0063, 2, 0.0, 0.8571, 279, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "jt.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " jt.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "vector": [13, 2, 0.3165, 0.0063, 2, 0.0, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return jt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L54_C0", "label": "TrajPlayback", "type": "class", "loc": [54, 127], "level": 0, "parent": null, "vector": [3, 0, 0.5728, 0.4684, 0, 0.66, 0.9167, 724, 0, 2, 0, 0, 0, 0, 25], "semantic": {"name": "TrajPlayback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TrajPlayback():\n def __init__( self, name, fname, arm = 'right' ):\n self.arm = arm\n self.name = name\n\n rospy.logout( 'TrajPlayback: Initializing (%s)' % self.name )\n try:\n rospy.init_node('traj_playback_'+self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "label": "__init__", "type": "function", "loc": [55, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L54_C0", "vector": [2, 1, 0.4399, 0.1899, 1, 0.53, 0.0, 555, 0, 4, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "name", "fname", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, name, fname, arm = 'right' ):\n self.arm = arm\n self.name = name\n\n rospy.logout( 'TrajPlayback: Initializing (%s)' % self.name )\n try:\n rospy.init_node('traj_playback_'+self.name)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L56_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.3544, 0.0063, 2, 0.92, 0.0, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L57_C8", "label": "self.name =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.3608, 0.0063, 2, 0.92, 0.0833, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L59_C8", "label": "logout()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [8, 2, 0.3734, 0.0063, 2, 0.92, 0.1667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'TrajPlayback: Initializing (%s)' % self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Try_L60_C8", "label": "try", "type": "try", "loc": [60, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [7, 2, 0.3892, 0.0253, 2, 0.92, 0.25, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n rospy.init_node('traj_playback_'+self.name)\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L61_C12", "label": "init_node()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:Try_L60_C8", "vector": [8, 3, 0.3861, 0.0063, 3, 0.38, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('traj_playback_'+self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L65_C8", "label": "dat = load_pickle()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.4114, 0.0063, 2, 0.92, 0.3333, 934, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dat", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dat = hrl_util.load_pickle( fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L66_C8", "label": "self.q = mat()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.4177, 0.0063, 2, 0.92, 0.4167, 561, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.q = np.mat( dat[0].T )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L69_C8", "label": "self.q =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.4367, 0.0063, 2, 0.92, 0.5, 561, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q = self.q[:,0::30]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L71_C8", "label": "self.t = linspace()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.4494, 0.0063, 2, 0.92, 0.5833, 670, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "self.t", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " self.t = np.linspace( 1.3, 1.3 + (self.q.shape[1]-1)*0.3, self.q.shape[1] ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L73_C8", "label": "self.vel = copy()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.462, 0.0063, 2, 0.92, 0.6667, 189, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "self.vel", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.vel = self.q.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L75_C8", "label": "assign", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.4747, 0.0063, 2, 0.92, 0.75, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.vel[:,0] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L78_C8", "label": "self.pr2 = PR2()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.4937, 0.0063, 2, 0.92, 0.8333, 141, 3, 0, 0, 0, 573, 10, 1], "semantic": {"name": "self.pr2", "arg_names": [], "import_names": [], "rhs_call_name": "PR2", "annotation": ""}, "snippet": " self.pr2 = PR2()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L80_C8", "label": "self.__service = Service()", "type": "assigned_variable", "loc": [80, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [14, 2, 0.5127, 0.019, 2, 0.92, 0.9167, 236, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "self.__service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " self.__service = rospy.Service( 'traj_playback/' + name,\n TrajPlaybackSrv,\n self.process_service )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L84_C8", "label": "logout()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "vector": [8, 2, 0.5316, 0.0063, 2, 0.92, 1.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'TrajPlayback: Ready for service requests (%s)' % self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "label": "process_service", "type": "function", "loc": [87, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L54_C0", "vector": [2, 1, 0.6772, 0.2595, 1, 0.53, 1.0, 430, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "process_service", "arg_names": ["self", "req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def process_service( self, req ):\n if req.play_backward:\n rospy.loginfo( 'TrajPlayback: Playing Reverse (%s)' % self.name )\n else:\n rospy.loginfo( 'TrajPlayback: Playing Forward (%s)' % self.name )\n \n if req.play_backward:\n tq = self.q[:,::-1].copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L88_C8", "label": "if", "type": "if", "loc": [88, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [4, 2, 0.5665, 0.0253, 2, 0.65, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if req.play_backward:\n rospy.loginfo( 'TrajPlayback: Playing Reverse (%s)' % self.name )\n else:\n rospy.loginfo( 'TrajPlayback: Playing Forward (%s)' % self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L89_C12", "label": "loginfo()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L88_C8", "vector": [8, 3, 0.5633, 0.0063, 3, 0.56, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'TrajPlayback: Playing Reverse (%s)' % self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L91_C12", "label": "loginfo()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L88_C8", "vector": [8, 3, 0.5759, 0.0063, 3, 0.56, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'TrajPlayback: Playing Forward (%s)' % self.name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "label": "if", "type": "if", "loc": [93, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [4, 2, 0.6203, 0.0696, 2, 0.65, 0.1429, 0, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if req.play_backward:\n tq = self.q[:,::-1].copy()\n tvel = -1 * self.vel[:,::-1].copy()\n tvel[:,-1] = 0\n tt = self.t.copy()\n tt[0] = 0\n tt[1:] += 0.1\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L94_C12", "label": "tq = copy()", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.5949, 0.0063, 3, 0.76, 0.0, 470, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " tq = self.q[:,::-1].copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L95_C12", "label": "tvel =", "type": "assigned_variable", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6013, 0.0063, 3, 0.76, 0.1429, 220, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tvel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvel = -1 * self.vel[:,::-1].copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L96_C12", "label": "assign", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6076, 0.0063, 3, 0.76, 0.2857, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tvel[:,-1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L97_C12", "label": "tt = copy()", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6139, 0.0063, 3, 0.76, 0.4286, 266, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "tt", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " tt = self.t.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L98_C12", "label": "assign", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6203, 0.0063, 3, 0.76, 0.5714, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tt[0] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L101_C12", "label": "tq = copy()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6392, 0.0063, 3, 0.76, 0.7143, 470, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " tq = self.q.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L102_C12", "label": "tvel = copy()", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6456, 0.0063, 3, 0.76, 0.8571, 220, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "tvel", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " tvel = self.vel.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L103_C12", "label": "tt = copy()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "vector": [14, 3, 0.6519, 0.0063, 3, 0.76, 1.0, 266, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "tt", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " tt = self.t.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L105_C8", "label": "if", "type": "if", "loc": [105, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [4, 2, 0.6741, 0.0253, 2, 0.65, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm == 'right':\n joint_traj = self.pr2.right.create_trajectory( tq, tt, tvel )\n else:\n joint_traj = self.pr2.left.create_trajectory( tq, tt, tvel )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L106_C12", "label": "joint_traj = create_trajectory()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L105_C8", "vector": [14, 3, 0.6709, 0.0063, 3, 0.93, 0.0, 460, 3, 3, 0, 0, 448, 10, 1], "semantic": {"name": "joint_traj", "arg_names": [], "import_names": [], "rhs_call_name": "create_trajectory", "annotation": ""}, "snippet": " joint_traj = self.pr2.right.create_trajectory( tq, tt, tvel )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L108_C12", "label": "joint_traj = create_trajectory()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L105_C8", "vector": [14, 3, 0.6835, 0.0063, 3, 0.93, 1.0, 460, 3, 3, 0, 0, 448, 10, 1], "semantic": {"name": "joint_traj", "arg_names": [], "import_names": [], "rhs_call_name": "create_trajectory", "annotation": ""}, "snippet": " joint_traj = self.pr2.left.create_trajectory( tq, tt, tvel )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L110_C8", "label": "dur = from_sec()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [14, 2, 0.6962, 0.0063, 2, 0.65, 0.4286, 45, 3, 1, 0, 0, 334, 10, 1], "semantic": {"name": "dur", "arg_names": [], "import_names": [], "rhs_call_name": "from_sec", "annotation": ""}, "snippet": " dur = rospy.Duration.from_sec( tt[-1] + 5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L117_C8", "label": "g = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [14, 2, 0.7405, 0.0063, 2, 0.65, 0.5714, 384, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "g", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " g = pm.JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L118_C8", "label": "g.trajectory =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [14, 2, 0.7468, 0.0063, 2, 0.65, 0.7143, 100, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "g.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " g.trajectory = joint_traj # why not ft...?"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "label": "if", "type": "if", "loc": [120, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [4, 2, 0.7753, 0.038, 2, 0.65, 0.8571, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm == 'right':\n self.pr2.right.client.send_goal( g )\n self.pr2.right.client.wait_for_result()\n else:\n self.pr2.left.client.send_goal( g )\n self.pr2.left.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L121_C12", "label": "send_goal()", "type": "expression", "loc": [121, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "vector": [8, 3, 0.7658, 0.0063, 3, 0.96, 0.0, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.pr2.right.client.send_goal( g )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L122_C12", "label": "wait_for_result()", "type": "expression", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "vector": [8, 3, 0.7722, 0.0063, 3, 0.96, 0.3333, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " self.pr2.right.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L124_C12", "label": "send_goal()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "vector": [8, 3, 0.7848, 0.0063, 3, 0.96, 0.6667, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.pr2.left.client.send_goal( g )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L125_C12", "label": "wait_for_result()", "type": "expression", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "vector": [8, 3, 0.7911, 0.0063, 3, 0.96, 1.0, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " self.pr2.left.client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "vector": [13, 2, 0.8038, 0.0063, 2, 0.65, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "label": "if", "type": "if", "loc": [129, 157], "level": 0, "parent": null, "vector": [4, 0, 0.9051, 0.1835, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import optparse\n p = optparse.OptionParser()\n p.add_option('--pkl', action='store', type='string', dest='pkl',\n help='Output file [default=\\'out.pkl\\']', default='out.pkl')\n p.add_option('--name', action='store', type='string', dest='name',\n help='Service \"name\": /traj_playback/name [default=\\'test\\']',\n default='test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L130_C4", "label": "optparse import optparse", "type": "import", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [1, 1, 0.8228, 0.0063, 1, 0.09, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": " import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L131_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [14, 1, 0.8291, 0.0063, 1, 0.09, 0.1111, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = optparse.OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L132_C4", "label": "add_option()", "type": "expression", "loc": [132, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [8, 1, 0.8386, 0.0127, 1, 0.09, 0.2222, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--pkl', action='store', type='string', dest='pkl',\n help='Output file [default=\\'out.pkl\\']', default='out.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L134_C4", "label": "add_option()", "type": "expression", "loc": [134, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [8, 1, 0.8544, 0.019, 1, 0.09, 0.3333, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--name', action='store', type='string', dest='name',\n help='Service \"name\": /traj_playback/name [default=\\'test\\']',\n default='test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L137_C4", "label": "add_option()", "type": "expression", "loc": [137, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [8, 1, 0.8734, 0.019, 1, 0.09, 0.4444, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--play', action='store_true', dest='play',\n help='Just play it once instead of building service [default=False]',\n default=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L140_C4", "label": "add_option()", "type": "expression", "loc": [140, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [8, 1, 0.8924, 0.019, 1, 0.09, 0.5556, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--reverse', action='store_true', dest='rev',\n help='Just play it once in reverse [default=False]',\n default=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L143_C4", "label": "add_option()", "type": "expression", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [8, 1, 0.9082, 0.0127, 1, 0.09, 0.6667, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--left', action='store_true', dest='left_arm',\n help='Use the left arm? [Right is default]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L145_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [14, 1, 0.9177, 0.0063, 1, 0.09, 0.7778, 852, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opt, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L147_C4", "label": "if", "type": "if", "loc": [147, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [4, 1, 0.9399, 0.0253, 1, 0.09, 0.8889, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.left_arm:\n tp = TrajPlayback( opt.name, opt.pkl, arm = 'left' )\n else:\n tp = TrajPlayback( opt.name, opt.pkl, arm = 'right' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L148_C8", "label": "tp = TrajPlayback()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L147_C4", "vector": [14, 2, 0.9367, 0.0063, 2, 0.95, 0.0, 53, 3, 3, 0, 0, 724, 10, 1], "semantic": {"name": "tp", "arg_names": [], "import_names": [], "rhs_call_name": "TrajPlayback", "annotation": ""}, "snippet": " tp = TrajPlayback( opt.name, opt.pkl, arm = 'left' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L150_C8", "label": "tp = TrajPlayback()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L147_C4", "vector": [14, 2, 0.9494, 0.0063, 2, 0.95, 1.0, 53, 3, 3, 0, 0, 724, 10, 1], "semantic": {"name": "tp", "arg_names": [], "import_names": [], "rhs_call_name": "TrajPlayback", "annotation": ""}, "snippet": " tp = TrajPlayback( opt.name, opt.pkl, arm = 'right' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "label": "if", "type": "if", "loc": [152, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "vector": [4, 1, 0.9778, 0.038, 1, 0.09, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.play:\n req = TrajPlaybackSrvRequest()\n req.play_backward = opt.rev\n tp.process_service( req )\n else:\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L153_C8", "label": "req = TrajPlaybackSrvRequest()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "vector": [14, 2, 0.9684, 0.0063, 2, 0.94, 0.0, 233, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "TrajPlaybackSrvRequest", "annotation": ""}, "snippet": " req = TrajPlaybackSrvRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L154_C8", "label": "req.play_backward =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "vector": [14, 2, 0.9747, 0.0063, 2, 0.94, 0.3333, 40, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.play_backward", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.play_backward = opt.rev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L155_C8", "label": "process_service()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "vector": [8, 2, 0.981, 0.0063, 2, 0.94, 0.6667, 430, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "process_service", "arg_names": [], "import_names": [], "rhs_call_name": "process_service", "annotation": ""}, "snippet": " tp.process_service( req )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L157_C8", "label": "spin()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "vector": [8, 2, 0.9937, 0.0063, 2, 0.94, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Try_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:Try_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L121_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L120_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Import_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99204:If_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99204:Expr_L157_C8"}] |
#! /usr/bin/python
import roslib
roslib.load_manifest('hrl_trajectory_playback')
import rospy
import hrl_lib.util as hrl_util
from sensor_msgs.msg import JointState
from collections import deque # fast appends
import numpy as np, math
# Hack (this code currently only supports the right arm!)
JOINT_NAMES = ['%s_shoulder_pan_joint', '%s_shoulder_lift_joint', '%s_upper_arm_roll_joint',
'%s_elbow_flex_joint', '%s_forearm_roll_joint', '%s_wrist_flex_joint',
'%s_wrist_roll_joint']
class Listener:
def __init__(self, arm = 'right'):
self.q = deque() # np.zeros(( n_samples, 7))
self.t = deque() # np.zeros((n_samples, 1))
self.arm = arm
# self.tind = 0
# self.ind = 0
self.initialized = False
self.starttime = rospy.Time(0)
self.r_jt_idx_lis = None
self.l_jt_idx_lis = None
def callback( self, msg ):
currtime = msg.header.stamp.to_sec()
if not self.initialized:
self.initialized = True
self.starttime = currtime
self.lasttime = currtime
self.r_jt_idx_lis = [msg.name.index(joint_name % 'r') for joint_name in JOINT_NAMES]
self.l_jt_idx_lis = [msg.name.index(joint_name % 'l') for joint_name in JOINT_NAMES]
if currtime - self.lasttime > 1.0:
self.lasttime = currtime
print 'Still Capturing (%d sec)' % (currtime - self.starttime)
if self.arm == 'right':
q_ja = [ msg.position[idx] for idx in self.r_jt_idx_lis ]
else:
q_ja = [ msg.position[idx] for idx in self.l_jt_idx_lis ]
self.q.append( q_ja )
# for i,idx in enumerate( r_jt_idx_lis ): # only dealing with right arm!
# self.q[self.ind, i] = msg.position[idx]
# print self.q[self.ind, i],
# print ""
# self.t[self.ind] = msg.header.stamp.to_sec()
# self.ind += 1
self.t.append([ currtime ])
if __name__ == '__main__':
import optparse
p = optparse.OptionParser()
p.add_option('--pkl', action='store', type='string', dest='pkl',
help='Output file [default=\'out.pkl\']', default='out.pkl')
p.add_option('--left', action='store_true', dest='left_arm',
help='Use the left arm? [Right is default]')
opt, args = p.parse_args()
rospy.init_node('quick_data')
if opt.left_arm:
lis = Listener( arm = 'left' )
else:
lis = Listener( arm = 'right' )
sub = rospy.Subscriber( '/joint_states', JointState, lis.callback )
print 'Recording... <Ctrl-C> to stop.'
rospy.spin()
sub.unregister()
#hrl_util.save_pickle([lis.q[0:lis.ind,:], lis.t[0:lis.ind,:]], 'untuck_traj_6.pickle')
print 'Outputting to: %s' % opt.pkl
hrl_util.save_pickle([ np.array(lis.q), # Nx7 numpy array
np.array(lis.t) ], # Nx1 numpy array
opt.pkl )
| ajibawa-2023/Python-Code-Large/train/row_99205 | 49 | 85 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0235, 0.0118, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0353, 0.0118, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_trajectory_playback')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0471, 0.0118, 0, 0.66, 0.2222, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Import_L6_C0", "label": "hrl_lib.util import hrl_util", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0706, 0.0118, 0, 0.66, 0.3333, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["hrl_util"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as hrl_util"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:ImportFrom_L7_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0824, 0.0118, 0, 0.66, 0.4444, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:ImportFrom_L9_C0", "label": "from collections import deque", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1059, 0.0118, 0, 0.66, 0.5556, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque # fast appends"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Import_L10_C0", "label": "numpy import np, math", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0118, 0, 0.66, 0.6667, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L13_C0", "label": "JOINT_NAMES =", "type": "assigned_variable", "loc": [13, 15], "level": 0, "parent": null, "vector": [14, 0, 0.1647, 0.0353, 0, 0.66, 0.7778, 236, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_NAMES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_NAMES = ['%s_shoulder_pan_joint', '%s_shoulder_lift_joint', '%s_upper_arm_roll_joint',\n '%s_elbow_flex_joint', '%s_forearm_roll_joint', '%s_wrist_flex_joint',\n '%s_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:ClassDef_L17_C0", "label": "Listener", "type": "class", "loc": [17, 56], "level": 0, "parent": null, "vector": [3, 0, 0.4294, 0.4706, 0, 0.66, 0.8889, 32, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "Listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Listener:\n def __init__(self, arm = 'right'):\n self.q = deque() # np.zeros(( n_samples, 7))\n self.t = deque() # np.zeros((n_samples, 1))\n self.arm = arm\n # self.tind = 0\n # self.ind = 0\n self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:ClassDef_L17_C0", "vector": [2, 1, 0.2647, 0.1176, 1, 0.76, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm = 'right'):\n self.q = deque() # np.zeros(( n_samples, 7))\n self.t = deque() # np.zeros((n_samples, 1))\n self.arm = arm\n # self.tind = 0\n # self.ind = 0\n self.initialized = False\n self.starttime = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L19_C8", "label": "self.q = deque()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.2235, 0.0118, 2, 0.12, 0.0, 561, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.q", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.q = deque() # np.zeros(( n_samples, 7))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L20_C8", "label": "self.t = deque()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.2353, 0.0118, 2, 0.12, 0.1667, 670, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.t", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.t = deque() # np.zeros((n_samples, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L21_C8", "label": "self.arm =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.2471, 0.0118, 2, 0.12, 0.3333, 720, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm = arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L24_C8", "label": "self.initialized =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.2824, 0.0118, 2, 0.12, 0.5, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L25_C8", "label": "self.starttime = Time()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.2941, 0.0118, 2, 0.12, 0.6667, 705, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " self.starttime = rospy.Time(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L26_C8", "label": "self.r_jt_idx_lis =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.3059, 0.0118, 2, 0.12, 0.8333, 680, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.r_jt_idx_lis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_jt_idx_lis = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L27_C8", "label": "self.l_jt_idx_lis =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "vector": [14, 2, 0.3176, 0.0118, 2, 0.12, 1.0, 451, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.l_jt_idx_lis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_jt_idx_lis = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "label": "callback", "type": "function", "loc": [29, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:ClassDef_L17_C0", "vector": [2, 1, 0.5, 0.3294, 1, 0.76, 1.0, 342, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback( self, msg ):\n currtime = msg.header.stamp.to_sec()\n \n if not self.initialized:\n self.initialized = True\n self.starttime = currtime\n self.lasttime = currtime\n self.r_jt_idx_lis = [msg.name.index(joint_name % 'r') for joint_name in JOINT_NAMES]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L30_C8", "label": "currtime = to_sec()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "vector": [14, 2, 0.3529, 0.0118, 2, 0.27, 0.0, 65, 3, 0, 0, 0, 750, 10, 1], "semantic": {"name": "currtime", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " currtime = msg.header.stamp.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "label": "if", "type": "if", "loc": [32, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "vector": [4, 2, 0.4059, 0.0706, 2, 0.27, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.initialized:\n self.initialized = True\n self.starttime = currtime\n self.lasttime = currtime\n self.r_jt_idx_lis = [msg.name.index(joint_name % 'r') for joint_name in JOINT_NAMES]\n self.l_jt_idx_lis = [msg.name.index(joint_name % 'l') for joint_name in JOINT_NAMES]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L33_C12", "label": "self.initialized =", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "vector": [14, 3, 0.3882, 0.0118, 3, 0.59, 0.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.initialized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.initialized = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L34_C12", "label": "self.starttime =", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "vector": [14, 3, 0.4, 0.0118, 3, 0.59, 0.25, 705, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.starttime = currtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L35_C12", "label": "self.lasttime =", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "vector": [14, 3, 0.4118, 0.0118, 3, 0.59, 0.5, 816, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lasttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lasttime = currtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L36_C12", "label": "self.r_jt_idx_lis =", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "vector": [14, 3, 0.4235, 0.0118, 3, 0.59, 0.75, 680, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_jt_idx_lis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_jt_idx_lis = [msg.name.index(joint_name % 'r') for joint_name in JOINT_NAMES]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L37_C12", "label": "self.l_jt_idx_lis =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "vector": [14, 3, 0.4353, 0.0118, 3, 0.59, 1.0, 451, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.l_jt_idx_lis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_jt_idx_lis = [msg.name.index(joint_name % 'l') for joint_name in JOINT_NAMES]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L39_C8", "label": "if", "type": "if", "loc": [39, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "vector": [4, 2, 0.4706, 0.0353, 2, 0.27, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if currtime - self.lasttime > 1.0:\n self.lasttime = currtime\n print('Still Capturing (%d sec)' % (currtime - self.starttime))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L40_C12", "label": "self.lasttime =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L39_C8", "vector": [14, 3, 0.4706, 0.0118, 3, 0.38, 0.0, 816, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lasttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lasttime = currtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L41_C12", "label": "print()", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L39_C8", "vector": [8, 3, 0.4824, 0.0118, 3, 0.38, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Still Capturing (%d sec)' % (currtime - self.starttime))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L44_C8", "label": "if", "type": "if", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "vector": [4, 2, 0.5353, 0.0471, 2, 0.27, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.arm == 'right':\n q_ja = [ msg.position[idx] for idx in self.r_jt_idx_lis ]\n else:\n q_ja = [ msg.position[idx] for idx in self.l_jt_idx_lis ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L45_C12", "label": "q_ja =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L44_C8", "vector": [14, 3, 0.5294, 0.0118, 3, 0.53, 0.0, 541, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_ja", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_ja = [ msg.position[idx] for idx in self.r_jt_idx_lis ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L47_C12", "label": "q_ja =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L44_C8", "vector": [14, 3, 0.5529, 0.0118, 3, 0.53, 1.0, 541, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q_ja", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_ja = [ msg.position[idx] for idx in self.l_jt_idx_lis ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L48_C8", "label": "append()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "vector": [8, 2, 0.5647, 0.0118, 2, 0.27, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.q.append( q_ja )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L56_C8", "label": "append()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "vector": [8, 2, 0.6588, 0.0118, 2, 0.27, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.t.append([ currtime ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "label": "if", "type": "if", "loc": [59, 85], "level": 0, "parent": null, "vector": [4, 0, 0.8471, 0.3176, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import optparse\n p = optparse.OptionParser()\n p.add_option('--pkl', action='store', type='string', dest='pkl',\n help='Output file [default=\\'out.pkl\\']', default='out.pkl')\n p.add_option('--left', action='store_true', dest='left_arm',\n help='Use the left arm? [Right is default]')\n opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Import_L60_C4", "label": "optparse import optparse", "type": "import", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [1, 1, 0.7059, 0.0118, 1, 0.45, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": " import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L61_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [14, 1, 0.7176, 0.0118, 1, 0.45, 0.0833, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = optparse.OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L62_C4", "label": "add_option()", "type": "expression", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.7353, 0.0235, 1, 0.45, 0.1667, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--pkl', action='store', type='string', dest='pkl',\n help='Output file [default=\\'out.pkl\\']', default='out.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L64_C4", "label": "add_option()", "type": "expression", "loc": [64, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.7588, 0.0235, 1, 0.45, 0.25, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--left', action='store_true', dest='left_arm',\n help='Use the left arm? [Right is default]')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L66_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [14, 1, 0.7765, 0.0118, 1, 0.45, 0.3333, 852, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opt, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L68_C4", "label": "init_node()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.8, 0.0118, 1, 0.45, 0.4167, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('quick_data')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L70_C4", "label": "if", "type": "if", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [4, 1, 0.8412, 0.0471, 1, 0.45, 0.5, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.left_arm:\n lis = Listener( arm = 'left' )\n else:\n lis = Listener( arm = 'right' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L71_C8", "label": "lis = Listener()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L70_C4", "vector": [14, 2, 0.8353, 0.0118, 2, 0.5, 0.0, 96, 3, 1, 0, 0, 32, 10, 1], "semantic": {"name": "lis", "arg_names": [], "import_names": [], "rhs_call_name": "Listener", "annotation": ""}, "snippet": " lis = Listener( arm = 'left' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L73_C8", "label": "lis = Listener()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L70_C4", "vector": [14, 2, 0.8588, 0.0118, 2, 0.5, 1.0, 96, 3, 1, 0, 0, 32, 10, 1], "semantic": {"name": "lis", "arg_names": [], "import_names": [], "rhs_call_name": "Listener", "annotation": ""}, "snippet": " lis = Listener( arm = 'right' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L74_C4", "label": "sub = Subscriber()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [14, 1, 0.8706, 0.0118, 1, 0.45, 0.5833, 819, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " sub = rospy.Subscriber( '/joint_states', JointState, lis.callback )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L76_C4", "label": "print()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.8941, 0.0118, 1, 0.45, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Recording... <Ctrl-C> to stop.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L77_C4", "label": "spin()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.9059, 0.0118, 1, 0.45, 0.75, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L78_C4", "label": "unregister()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.9176, 0.0118, 1, 0.45, 0.8333, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " sub.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L82_C4", "label": "print()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.9647, 0.0118, 1, 0.45, 0.9167, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Outputting to: %s' % opt.pkl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L83_C4", "label": "save_pickle()", "type": "expression", "loc": [83, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "vector": [8, 1, 0.9882, 0.0353, 1, 0.45, 1.0, 390, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " hrl_util.save_pickle([ np.array(lis.q), # Nx7 numpy array\n np.array(lis.t) ], # Nx1 numpy array\n opt.pkl )"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99205:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Import_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99205:If_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99205:Expr_L83_C4"}] |
__all__ = [
'playback',
'record'
]
| ajibawa-2023/Python-Code-Large/train/row_99206 | 1 | 4 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99206:Assign_L1_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [1, 4], "level": 0, "parent": null, "vector": [14, 0, 0.625, 1.0, 0, 0.66, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = [\n'playback',\n'record'\n]"}] | [] |
import scipy.optimize as so
import math, numpy as np
import pylab as pl
import sys, optparse, time
import copy
from enthought.mayavi import mlab
#import util as ut
import roslib; roslib.load_manifest('doors_forces_kinematics')
roslib.load_manifest('epc_core')
import cody_arms.arms as ca
#import mekabot.coord_frames as mcf
import cody_arms.coord_frames as mcf
import hrl_lib.util as ut, hrl_lib.transforms as tr
roslib.load_manifest('hrl_tilting_hokuyo')
import hrl_tilting_hokuyo.display_3d_mayavi as d3m
roslib.load_manifest('epc_door_opening')
import epc_door_opening.segway_motion_calc as smc
class JointTrajectory():
''' class to store joint trajectories.
data only - use for pickling.
'''
def __init__(self):
self.time_list = [] # time in seconds
self.q_list = [] #each element is a list of 7 joint angles.
self.qdot_list = [] #each element is a list of 7 joint angles.
self.qdotdot_list = [] #each element is a list of 7 joint angles.
## class to store trajectory of a coord frame executing planar motion (x,y,a)
#data only - use for pickling
class PlanarTrajectory():
def __init__(self):
self.time_list = [] # time in seconds
self.x_list = []
self.y_list = []
self.a_list = []
class CartesianTajectory():
''' class to store trajectory of cartesian points.
data only - use for pickling
'''
def __init__(self):
self.time_list = [] # time in seconds
self.p_list = [] #each element is a list of 3 coordinates
self.v_list = [] #each element is a list of 3 coordinates (velocity)
class ForceTrajectory():
''' class to store time evolution of the force at the end effector.
data only - use for pickling
'''
def __init__(self):
self.time_list = [] # time in seconds
self.f_list = [] #each element is a list of 3 coordinates
##
# @param traj - JointTrajectory
# @return CartesianTajectory after performing FK on traj to compute
# cartesian position, velocity
def joint_to_cartesian(traj, arm):
firenze = ca.M3HrlRobot(end_effector_length = 0.17318)
#firenze = ca.M3HrlRobot()
pts = []
cart_vel = []
for i in range(len(traj.q_list)):
q = traj.q_list[i]
p = firenze.FK(arm, q)
pts.append(p.A1.tolist())
if traj.qdot_list != [] and traj.qdot_list[0] != None:
qdot = traj.qdot_list[i]
jac = firenze.Jac(arm, q)
vel = jac * np.matrix(qdot).T
cart_vel.append(vel.A1[0:3].tolist())
ct = CartesianTajectory()
ct.time_list = copy.copy(traj.time_list)
ct.p_list = copy.copy(pts)
ct.v_list = copy.copy(cart_vel)
#return np.matrix(pts).T
return ct
def plot_forces_quiver(pos_traj,force_traj,color='k'):
import arm_trajectories as at
#if traj.__class__ == at.JointTrajectory:
if isinstance(pos_traj,at.JointTrajectory):
pos_traj = joint_to_cartesian(pos_traj)
pts = np.matrix(pos_traj.p_list).T
label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']
x = pts[0,:].A1.tolist()
y = pts[1,:].A1.tolist()
forces = np.matrix(force_traj.f_list).T
u = (-1*forces[0,:]).A1.tolist()
v = (-1*forces[1,:]).A1.tolist()
pl.quiver(x,y,u,v,width=0.002,color=color,scale=100.0)
# pl.quiver(x,y,u,v,width=0.002,color=color)
pl.axis('equal')
##
# @param xaxis - x axis for the graph (0,1 or 2)
# @param zaxis - for a 3d plot. not implemented.
def plot_cartesian(traj, xaxis=None, yaxis=None, zaxis=None, color='b',label='_nolegend_',
linewidth=2, scatter_size=10, plot_velocity=False):
import matplotlib_util.util as mpu
import arm_trajectories as at
#if traj.__class__ == at.JointTrajectory:
if isinstance(traj,at.JointTrajectory):
traj = joint_to_cartesian(traj)
pts = np.matrix(traj.p_list).T
label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']
x = pts[xaxis,:].A1.tolist()
y = pts[yaxis,:].A1.tolist()
if plot_velocity:
vels = np.matrix(traj.v_list).T
xvel = vels[xaxis,:].A1.tolist()
yvel = vels[yaxis,:].A1.tolist()
if zaxis == None:
mpu.plot_yx(y, x, color, linewidth, '-', scatter_size, label,
axis = 'equal', xlabel = label_list[xaxis],
ylabel = label_list[yaxis],)
if plot_velocity:
mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),
width = 0.001, scale = 1.)
mpu.legend()
else:
from numpy import array
from enthought.mayavi.api import Engine
engine = Engine()
engine.start()
if len(engine.scenes) == 0:
engine.new_scene()
z = pts[zaxis,:].A1.tolist()
time_list = [t-traj.time_list[0] for t in traj.time_list]
mlab.plot3d(x,y,z,time_list,tube_radius=None,line_width=4)
mlab.axes()
mlab.xlabel(label_list[xaxis])
mlab.ylabel(label_list[yaxis])
mlab.zlabel(label_list[zaxis])
mlab.colorbar(title='Time')
# -------------------------------------------
axes = engine.scenes[0].children[0].children[0].children[1]
axes.axes.position = array([ 0., 0.])
axes.axes.label_format = '%-#6.2g'
axes.title_text_property.font_size=4
## return two lists containing the radial and tangential components of the forces.
# @param f_list - list of forces. (each force is a list of 2 or 3 floats)
# @param p_list - list of positions. (each position is a list of 2 or 3 floats)
# @param cx - x coord of the center of the circle.
# @param cy - y coord of the center of the circle.
# @return list of magnitude of radial component, list of magnitude
# tangential component, list of the force along the remaining
# direction
def compute_radial_tangential_forces(f_list,p_list,cx,cy):
f_rad_l,f_tan_l, f_res_l = [], [], []
for f,p in zip(f_list,p_list):
rad_vec = np.array([p[0]-cx,p[1]-cy])
rad_vec = rad_vec/np.linalg.norm(rad_vec)
tan_vec = (np.matrix([[0,-1],[1,0]]) * np.matrix(rad_vec).T).A1
f_vec = np.array([f[0],f[1]])
f_tan_mag = np.dot(f_vec, tan_vec)
f_rad_mag = np.dot(f_vec, rad_vec)
# f_res_mag = np.linalg.norm(f_vec- rad_vec*f_rad_mag - tan_vec*f_tan_mag)
f_rad_mag = abs(f_rad_mag)
f_tan_mag = abs(f_tan_mag)
f_rad_l.append(f_rad_mag)
f_tan_l.append(f_tan_mag)
f_res_l.append(abs(f[2]))
return f_rad_l, f_tan_l, f_res_l
def fit_circle_priors(rad_guess, x_guess, y_guess, pts, sigma_r,
sigma_xy, sigma_pts, verbose=True):
global x_prior, y_prior
x_prior = x_guess
y_prior = y_guess
def error_function(params):
center = np.matrix((params[0],params[1])).T
rad = params[2]
err_pts = ut.norm(pts-center).A1 - rad
lik = np.dot(err_pts, err_pts) / (sigma_pts * sigma_pts)
pri = ((rad - rad_guess)**2) / (sigma_r * sigma_r)
#pri += ((x_prior - center[0,0])**2) / (sigma_xy * sigma_xy)
#pri += ((y_prior - center[1,0])**2) / (sigma_xy * sigma_xy)
return (lik + pri)
params_1 = [x_prior, y_prior, rad_guess]
r = so.fmin_bfgs(error_function, params_1, full_output=1,
disp = verbose, gtol=1e-5)
opt_params_1,fopt_1 = r[0],r[1]
y_prior = y_guess + 2*rad_guess
params_2 = [x_prior, y_prior, rad_guess]
r = so.fmin_bfgs(error_function, params_2, full_output=1,
disp = verbose, gtol=1e-5)
opt_params_2,fopt_2 = r[0],r[1]
if fopt_2<fopt_1:
return opt_params_2[2],opt_params_2[0],opt_params_2[1]
else:
return opt_params_1[2],opt_params_1[0],opt_params_1[1]
## find the x and y coord of the center of the circle and the radius that
# best matches the data.
# @param rad_guess - guess for the radius of the circle
# @param x_guess - guess for x coord of center
# @param y_guess - guess for y coord of center.
# @param pts - 2xN np matrix of points.
# @param method - optimization method. ('fmin' or 'fmin_bfgs')
# @param verbose - passed onto the scipy optimize functions. whether to print out the convergence info.
# @return r,x,y (radius, x and y coord of the center of the circle)
def fit_circle(rad_guess, x_guess, y_guess, pts, method, verbose=True,
rad_fix = False):
def error_function(params):
center = np.matrix((params[0],params[1])).T
if rad_fix:
rad = rad_guess
else:
rad = params[2]
err = ut.norm(pts-center).A1 - rad
res = np.dot(err,err)
#if not rad_fix and rad < 0.3:
# res = res*(0.3-rad)*100
return res
params_1 = [x_guess,y_guess]
if not rad_fix:
params_1.append(rad_guess)
if method == 'fmin':
r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)
opt_params_1,fopt_1 = r[0],r[1]
elif method == 'fmin_bfgs':
r = so.fmin_bfgs(error_function, params_1, full_output=1,
disp = verbose, gtol=1e-5)
opt_params_1,fopt_1 = r[0],r[1]
else:
raise RuntimeError('unknown method: '+method)
params_2 = [x_guess,y_guess+2*rad_guess]
if not rad_fix:
params_2.append(rad_guess)
if method == 'fmin':
r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)
opt_params_2,fopt_2 = r[0],r[1]
elif method == 'fmin_bfgs':
r = so.fmin_bfgs(error_function, params_2, full_output=1,
disp = verbose, gtol=1e-5)
opt_params_2,fopt_2 = r[0],r[1]
else:
raise RuntimeError('unknown method: '+method)
if fopt_2<fopt_1:
if rad_fix:
return rad_guess,opt_params_2[0],opt_params_2[1]
else:
return opt_params_2[2],opt_params_2[0],opt_params_2[1]
else:
if rad_fix:
return rad_guess,opt_params_1[0],opt_params_1[1]
else:
return opt_params_1[2],opt_params_1[0],opt_params_1[1]
## changes the cartesian trajectory to put everything in the same frame.
# NOTE - velocity transformation does not work if the segway is also
# moving. This is because I am not logging the velocity of the segway.
# @param pts - CartesianTajectory
# @param st - object of type PlanarTrajectory (segway trajectory)
# @return CartesianTajectory
def account_segway_motion(cart_traj, force_traj, st):
ct = CartesianTajectory()
ft = ForceTrajectory()
for i in range(len(cart_traj.p_list)):
x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]
p_tl = np.matrix(cart_traj.p_list[i]).T
p_ts = smc.tsTtl(p_tl, x, y, a)
p = p_ts
ct.p_list.append(p.A1.tolist())
# transform forces to the world frame.
f_tl = np.matrix(force_traj.f_list[i]).T
f_ts = smc.tsRtl(f_tl, a)
f = f_ts
ft.f_list.append(f.A1.tolist())
# this is incorrect. I also need to use the velocity of the
# segway. Unclear whether this is useful right now, so not
# implementing it. (Advait. Jan 6, 2010.)
if cart_traj.v_list != []:
v_tl = np.matrix(cart_traj.v_list[i]).T
v_ts = smc.tsRtl(v_tl, a)
ct.v_list.append(v_ts.A1.tolist())
ct.time_list = copy.copy(cart_traj.time_list)
ft.time_list = copy.copy(force_traj.time_list)
return ct, ft
# @param cart_traj - CartesianTajectory
# @param z_l - list of zenither heights
# @return CartesianTajectory
def account_zenithering(cart_traj, z_l):
ct = CartesianTajectory()
h_start = z_l[0]
for i in range(len(cart_traj.p_list)):
h = z_l[i]
p = cart_traj.p_list[i]
p[2] += h - h_start
ct.p_list.append(p)
# this is incorrect. I also need to use the velocity of the
# zenither. Unclear whether this is useful right now, so not
# implementing it. (Advait. Jan 6, 2010.)
if cart_traj.v_list != []:
ct.v_list.append(cart_traj.v_list[i])
ct.time_list = copy.copy(cart_traj.time_list)
return ct
##
# remove the initial part of the trjectory in which the hook is not moving.
# @param ct - cartesian trajectory of the end effector in the world frame.
# @return 2xN np matrix, reject_idx
def filter_cartesian_trajectory(ct):
pts_list = ct.p_list
ee_start_pos = pts_list[0]
l = [pts_list[0]]
for i, p in enumerate(pts_list[1:]):
l.append(p)
pts_2d = (np.matrix(l).T)[0:2,:]
st_pt = pts_2d[:,0]
end_pt = pts_2d[:,-1]
dist_moved = np.linalg.norm(st_pt-end_pt)
#if dist_moved < 0.1:
if dist_moved < 0.03:
reject_idx = i
pts_2d = pts_2d[:,reject_idx:]
return pts_2d, reject_idx
##
# remove the last part of the trjectory in which the hook might have slipped off
# @param ct - cartesian trajectory of the end effector in the world frame.
# @param ft - force trajectory
# @return cartesian trajectory with the zero force end part removed, force trajectory
def filter_trajectory_force(ct, ft):
vel_list = copy.copy(ct.v_list)
pts_list = copy.copy(ct.p_list)
time_list = copy.copy(ct.time_list)
ft_list = copy.copy(ft.f_list)
f_mag_list = ut.norm(np.matrix(ft.f_list).T).A1.tolist()
if len(pts_list) != len(f_mag_list):
print 'arm_trajectories.filter_trajectory_force: force and end effector lists are not of the same length.'
print 'Exiting ...'
sys.exit()
n_pts = len(pts_list)
i = n_pts - 1
hook_slip_off_threshold = 1.5 # from compliant_trajectories.py
while i > 0:
if f_mag_list[i] < hook_slip_off_threshold:
pts_list.pop()
time_list.pop()
ft_list.pop()
if vel_list != []:
vel_list.pop()
else:
break
i -= 1
ct2 = CartesianTajectory()
ct2.time_list = time_list
ct2.p_list = pts_list
ct2.v_list = vel_list
ft2 = ForceTrajectory()
ft2.time_list = copy.copy(time_list)
ft2.f_list = ft_list
return ct2, ft2
if __name__ == '__main__':
import matplotlib_util.util as mpu
p = optparse.OptionParser()
p.add_option('-f', action='store', type='string', dest='fname',
help='pkl file to use.', default='')
p.add_option('--xy', action='store_true', dest='xy',
help='plot the x and y coordinates of the end effector.')
p.add_option('--yz', action='store_true', dest='yz',
help='plot the y and z coordinates of the end effector.')
p.add_option('--xz', action='store_true', dest='xz',
help='plot the x and z coordinates of the end effector.')
p.add_option('--plot_ellipses', action='store_true', dest='plot_ellipses',
help='plot the stiffness ellipse in the x-y plane')
p.add_option('--pfc', action='store_true', dest='pfc',
help='plot the radial and tangential components of the force.')
p.add_option('--pff', action='store_true', dest='pff',
help='plot the force field corresponding to a stiffness ellipse.')
p.add_option('--pev', action='store_true', dest='pev',
help='plot the stiffness ellipses for different combinations of the rel stiffnesses.')
p.add_option('--plot_forces', action='store_true', dest='plot_forces',
help='plot the force in the x-y plane')
p.add_option('--plot_forces_error', action='store_true', dest='plot_forces_error',
help='plot the error between the computed and measured (ATI) forces in the x-y plane')
p.add_option('--xyz', action='store_true', dest='xyz',
help='plot in 3d the coordinates of the end effector.')
p.add_option('-r', action='store', type='float', dest='rad',
help='radius of the joint.', default=None)
p.add_option('--noshow', action='store_true', dest='noshow',
help='do not display the figure (use while saving figures to disk)')
p.add_option('--exptplot', action='store_true', dest='exptplot',
help='put all the graphs of an experiment as subplots.')
p.add_option('--sturm', action='store_true', dest='sturm',
help='make log files to send to sturm')
p.add_option('--icra_presentation_plot', action='store_true',
dest='icra_presentation_plot',
help='plot explaining CEP update.')
opt, args = p.parse_args()
fname = opt.fname
xy_flag = opt.xy
yz_flag = opt.yz
xz_flag = opt.xz
plot_forces_flag = opt.plot_forces
plot_ellipses_flag = opt.plot_ellipses
plot_forces_error_flag = opt.plot_forces_error
plot_force_components_flag = opt.pfc
plot_force_field_flag = opt.pff
xyz_flag = opt.xyz
rad = opt.rad
show_fig = not(opt.noshow)
plot_ellipses_vary_flag = opt.pev
expt_plot = opt.exptplot
sturm_output = opt.sturm
if plot_ellipses_vary_flag:
show_fig=False
i = 0
ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search
ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search
ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search
# ratio_list1 = [0.7,0.8,0.9,1.0]
# ratio_list2 = [0.7,0.8,0.9,1.0]
# ratio_list3 = [0.3,0.4,0.5,0.6,0.7]
# ratio_list1 = [1.0,2.,3.0]
# ratio_list2 = [1.,2.,3.]
# ratio_list3 = [0.3,0.4,0.5,0.6,0.7]
inv_mean_list,std_list = [],[]
x_l,y_l,z_l = [],[],[]
s0 = 0.2
#s0 = 0.4
for s1 in ratio_list1:
for s2 in ratio_list2:
for s3 in ratio_list3:
i += 1
s_list = [s0,s1,s2,s3,0.8]
#s_list = [s1,s2,s3,s0,0.8]
print '################## s_list:', s_list
m,s = plot_stiff_ellipse_map(s_list,i)
inv_mean_list.append(1./m)
std_list.append(s)
x_l.append(s1)
y_l.append(s2)
z_l.append(s3)
ut.save_pickle({'x_l':x_l,'y_l':y_l,'z_l':z_l,'inv_mean_list':inv_mean_list,'std_list':std_list},
'stiff_dict_'+ut.formatted_time()+'.pkl')
d3m.plot_points(np.matrix([x_l,y_l,z_l]),scalar_list=inv_mean_list,mode='sphere')
mlab.axes()
d3m.show()
sys.exit()
if fname=='':
print 'please specify a pkl file (-f option)'
print 'Exiting...'
sys.exit()
d = ut.load_pickle(fname)
actual_cartesian_tl = joint_to_cartesian(d['actual'], d['arm'])
actual_cartesian, _ = account_segway_motion(actual_cartesian_tl,d['force'], d['segway'])
if d.has_key('zenither_list'):
actual_cartesian = account_zenithering(actual_cartesian,
d['zenither_list'])
eq_cartesian_tl = joint_to_cartesian(d['eq_pt'], d['arm'])
eq_cartesian, _ = account_segway_motion(eq_cartesian_tl, d['force'], d['segway'])
if d.has_key('zenither_list'):
eq_cartesian = account_zenithering(eq_cartesian, d['zenither_list'])
cartesian_force_clean, _ = filter_trajectory_force(actual_cartesian,
d['force'])
pts_2d, reject_idx = filter_cartesian_trajectory(cartesian_force_clean)
if rad != None:
#rad = 0.39 # lab cabinet recessed.
#rad = 0.42 # kitchen cabinet
#rad = 0.80 # lab glass door
pts_list = actual_cartesian.p_list
eq_pts_list = eq_cartesian.p_list
ee_start_pos = pts_list[0]
x_guess = ee_start_pos[0]
y_guess = ee_start_pos[1] - rad
print 'before call to fit_rotary_joint'
force_list = d['force'].f_list
if sturm_output:
str_parts = fname.split('.')
sturm_file_name = str_parts[0]+'_sturm.log'
print 'Sturm file name:', sturm_file_name
sturm_file = open(sturm_file_name,'w')
sturm_pts = cartesian_force_clean.p_list
print 'len(sturm_pts):', len(sturm_pts)
print 'len(pts_list):', len(pts_list)
for i,p in enumerate(sturm_pts[1:]):
sturm_file.write(" ".join(map(str,p)))
sturm_file.write('\n')
sturm_file.write('\n')
sturm_file.close()
rad_guess = rad
rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,
method='fmin_bfgs',verbose=False)
print 'rad, cx, cy:', rad, cx, cy
c_ts = np.matrix([cx, cy, 0.]).T
start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,
pts_2d[0,0]-cx) - math.pi/2)
end_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,-1]-cy,
pts_2d[0,-1]-cx) - math.pi/2)
mpu.plot_circle(cx, cy, rad, start_angle, end_angle,
label='Actual\_opt', color='r')
if opt.icra_presentation_plot:
mpu.set_figure_size(30,20)
rad = 1.0
x_guess = pts_2d[0,0]
y_guess = pts_2d[1,0] - rad
rad_guess = rad
rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,
method='fmin_bfgs',verbose=False)
print 'Estimated rad, cx, cy:', rad, cx, cy
start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,
pts_2d[0,0]-cx) - math.pi/2)
end_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,-1]-cy,
pts_2d[0,-1]-cx) - math.pi/2)
subsample_ratio = 1
pts_2d_s = pts_2d[:,::subsample_ratio]
cep_force_clean, force_new = filter_trajectory_force(eq_cartesian,
d['force'])
cep_2d = np.matrix(cep_force_clean.p_list).T[0:2,reject_idx:]
# first draw the entire CEP and end effector trajectories
mpu.figure()
mpu.plot_yx(pts_2d_s[1,:].A1, pts_2d_s[0,:].A1, color='b',
label = '\huge{End Effector Trajectory}', axis = 'equal', alpha = 1.0,
scatter_size=7, linewidth=0, marker='x',
marker_edge_width = 1.5)
cep_2d_s = cep_2d[:,::subsample_ratio]
mpu.plot_yx(cep_2d_s[1,:].A1, cep_2d_s[0,:].A1, color='g',
label = '\huge{Equilibrium Point Trajectory}', axis = 'equal', alpha = 1.0,
scatter_size=10, linewidth=0, marker='+',
marker_edge_width = 1.5)
mpu.plot_circle(cx, cy, rad, start_angle, end_angle,
label='\huge{Estimated Kinematics}', color='r',
alpha=0.7)
mpu.plot_radii(cx, cy, rad, start_angle, end_angle,
interval=end_angle-start_angle, color='r',
alpha=0.7)
mpu.legend()
fig_name = 'epc'
fig_number = 1
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
# now zoom in to a small region to show the force
# decomposition.
zoom_location = 10
pts_2d_zoom = pts_2d[:,:zoom_location]
cep_2d_zoom = cep_2d[:,:zoom_location]
# image_name = 'anim'
# for i in range(zoom_location):
# mpu.figure()
# mpu.plot_yx(pts_2d_zoom[1,:].A1, pts_2d_zoom[0,:].A1, color='w',
# axis = 'equal', alpha = 1.0)
# mpu.plot_yx(cep_2d_zoom[1,:].A1, cep_2d_zoom[0,:].A1, color='w',
# axis = 'equal', alpha = 1.0)
# mpu.plot_yx(pts_2d_zoom[1,:i+1].A1, pts_2d_zoom[0,:i+1].A1, color='b',
# label = '\huge{End Effector Trajectory}', axis = 'equal', alpha = 1.0,
# scatter_size=7, linewidth=0, marker='x',
# marker_edge_width = 1.5)
# mpu.plot_yx(cep_2d_zoom[1,:i+1].A1, cep_2d_zoom[0,:i+1].A1, color='g',
# label = '\huge{Equilibrium Point Trajectory}', axis = 'equal', alpha = 1.0,
# scatter_size=10, linewidth=0, marker='+',
# marker_edge_width = 1.5)
# mpu.pl.xlim(0.28, 0.47)
# mpu.legend()
# mpu.savefig(image_name+'%d.png'%(i+1))
mpu.figure()
mpu.plot_yx(pts_2d_zoom[1,:].A1, pts_2d_zoom[0,:].A1, color='b',
label = '\huge{End Effector Trajectory}', axis = 'equal', alpha = 1.0,
scatter_size=7, linewidth=0, marker='x',
marker_edge_width = 1.5)
mpu.plot_yx(cep_2d_zoom[1,:].A1, cep_2d_zoom[0,:].A1, color='g',
label = '\huge{Equilibrium Point Trajectory}', axis = 'equal', alpha = 1.0,
scatter_size=10, linewidth=0, marker='+',
marker_edge_width = 1.5)
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('two.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
rad, cx, cy = fit_circle(1.0,x_guess,y_guess,pts_2d_zoom,
method='fmin_bfgs',verbose=False)
print 'Estimated rad, cx, cy:', rad, cx, cy
start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,
pts_2d[0,0]-cx) - math.pi/2)
end_angle = tr.angle_within_mod180(math.atan2(pts_2d_zoom[1,-1]-cy,
pts_2d_zoom[0,-1]-cx) - math.pi/2)
mpu.plot_circle(cx, cy, rad, start_angle, end_angle,
label='\huge{Estimated Kinematics}', color='r',
alpha=0.7)
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('three.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
current_pos = pts_2d_zoom[:,-1]
radial_vec = current_pos - np.matrix([cx,cy]).T
radial_vec = radial_vec / np.linalg.norm(radial_vec)
tangential_vec = np.matrix([[0,-1],[1,0]]) * radial_vec
mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],
[pts_2d_zoom[0,-1]],
radial_vec, scale=10., width = 0.002)
rad_text_loc = pts_2d_zoom[:,-1] + np.matrix([0.001,0.01]).T
mpu.pl.text(rad_text_loc[0,0], rad_text_loc[1,0], '$\hat v_{rad}$', fontsize = 30)
mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],
[pts_2d_zoom[0,-1]],
tangential_vec, scale=10., width = 0.002)
tan_text_loc = pts_2d_zoom[:,-1] + np.matrix([-0.012, -0.011]).T
mpu.pl.text(tan_text_loc[0,0], tan_text_loc[1,0], s = '$\hat v_{tan}$', fontsize = 30)
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('four.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
wrist_color = '#A0A000'
wrist_force = -np.matrix(force_new.f_list[zoom_location]).T
frad = (wrist_force[0:2,:].T * radial_vec)[0,0] * radial_vec
mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],
[pts_2d_zoom[0,-1]],
wrist_force, scale=50., width = 0.002,
color=wrist_color)
#color='y')
wf_text = rad_text_loc + np.matrix([-0.06,0.015]).T
mpu.pl.text(wf_text[0,0], wf_text[1,0], color=wrist_color,
fontsize = 25, s = 'Total Force')
mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],
[pts_2d_zoom[0,-1]],
frad, scale=50., width = 0.002,
color=wrist_color)
frad_text = rad_text_loc + np.matrix([0.,0.015]).T
mpu.pl.text(frad_text[0,0], frad_text[1,0], color=wrist_color, s = '$\hat F_{rad}$', fontsize = 30)
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('five.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
frad = (wrist_force[0:2,:].T * radial_vec)[0,0]
hook_force_motion = -(frad - 5) * radial_vec * 0.001
tangential_motion = 0.01 * tangential_vec
total_cep_motion = hook_force_motion + tangential_motion
mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],
[cep_2d_zoom[0,-1]],
hook_force_motion, scale=0.1, width = 0.002)
hw_text = cep_2d_zoom[:,-1] + np.matrix([-0.002,-0.012]).T
mpu.pl.text(hw_text[0,0], hw_text[1,0], color='k', fontsize=20,
s = '$h[t]$')
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('six.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],
[cep_2d_zoom[0,-1]],
tangential_motion, scale=0.1, width = 0.002)
mw_text = cep_2d_zoom[:,-1] + np.matrix([-0.018,0.001]).T
mpu.pl.text(mw_text[0,0], mw_text[1,0], color='k', fontsize=20,
s = '$m[t]$')
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('seven.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],
[cep_2d_zoom[0,-1]],
total_cep_motion, scale=0.1, width = 0.002)
cep_text = cep_2d_zoom[:,-1] + np.matrix([-0.058,-0.023]).T
mpu.pl.text(cep_text[0,0], cep_text[1,0], color='k', fontsize=20,
s = '$x_{eq}[t]$ = &x_{eq}[t-1] + m[t] + h[t]$')
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('eight.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
new_cep = cep_2d_zoom[:,-1] + total_cep_motion
mpu.plot_yx(new_cep[1,:].A1, new_cep[0,:].A1, color='g',
axis = 'equal', alpha = 1.0,
scatter_size=10, linewidth=0, marker='+',
marker_edge_width = 1.5)
mpu.pl.xlim(0.28, 0.47)
mpu.legend()
#mpu.savefig('nine.png')
mpu.savefig(fig_name+'%d'%fig_number)
fig_number += 1
mpu.show()
if xy_flag:
st_pt = pts_2d[:,0]
end_pt = pts_2d[:,-1]
if expt_plot:
pl.subplot(233)
plot_cartesian(actual_cartesian, xaxis=0, yaxis=1, color='b',
label='FK', plot_velocity=False)
plot_cartesian(eq_cartesian, xaxis=0,yaxis=1,color='g',label='Eq Point')
elif yz_flag:
plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')
plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')
elif xz_flag:
plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')
plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')
if plot_forces_flag or plot_forces_error_flag or plot_ellipses_flag or plot_force_components_flag or plot_force_field_flag:
# arm_stiffness_list = d['stiffness'].stiffness_list
# scale = d['stiffness'].stiffness_scale
# asl = [min(scale*s,1.0) for s in arm_stiffness_list]
# ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'],
# d['torque'],asl)
if plot_forces_flag:
plot_forces_quiver(actual_cartesian,d['force'],color='k')
#plot_forces_quiver(actual_cartesian,ftraj_jinv,color='y')
#plot_forces_quiver(actual_cartesian,ftraj_stiff,color='y')
if plot_ellipses_flag:
#plot_stiff_ellipses(k_cart_list,actual_cartesian)
if expt_plot:
subplotnum=234
else:
pl.figure()
subplotnum=111
plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)
if plot_forces_error_flag:
plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)
#plot_error_forces(d['force'].f_list,ftraj_stiff.f_list)
if plot_force_components_flag:
p_list = actual_cartesian.p_list
#cx = 45.
#cy = -0.3
frad_list,ftan_list,_ = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)
#frad_list,ftan_list,_ = compute_radial_tangential_forces(d['force_raw'].f_list,p_list,cx,cy)
if expt_plot:
pl.subplot(235)
else:
pl.figure()
time_list = d['force'].time_list
time_list = [t-time_list[0] for t in time_list]
x_coord_list = np.matrix(p_list)[:,0].A1.tolist()
mpu.plot_yx(frad_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None)
pl.xlabel('x coord of end effector (m)')
pl.ylabel('magnitude of radial force (N)')
pl.title(d['info'])
if expt_plot:
pl.subplot(236)
else:
pl.figure()
mpu.plot_yx(ftan_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None)
pl.xlabel('x coord of end effector (m)')
pl.ylabel('magnitude of tangential force (N)')
pl.title(d['info'])
if plot_force_field_flag:
plot_stiffness_field(k_cart_list[0],plottitle='start')
plot_stiffness_field(k_cart_list[-1],plottitle='end')
str_parts = fname.split('.')
if d.has_key('strategy'):
addon = ''
if opt.xy:
addon = '_xy'
if opt.xz:
addon = '_xz'
fig_name = str_parts[0]+'_'+d['strategy']+addon+'.png'
else:
fig_name = str_parts[0]+'_res.png'
if expt_plot:
f = pl.gcf()
curr_size = f.get_size_inches()
f.set_size_inches(curr_size[0]*2,curr_size[1]*2)
f.savefig(fig_name)
if show_fig:
pl.show()
else:
print '################################'
print 'show_fig is FALSE'
if not(expt_plot):
pl.savefig(fig_name)
if xyz_flag:
plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)
mlab.show()
#--------------------- OLD, maybe useful functions -------------------
### compute the force that the arm would apply given the stiffness matrix
## @param q_actual_traj - Joint Trajectory (actual angles.)
## @param q_eq_traj - Joint Trajectory (equilibrium point angles.)
## @param torque_traj - JointTrajectory (torques measured at the joints.)
## @param rel_stiffness_list - list of 5 elements (stiffness numbers for the joints.)
## @return lots of things, look at the code.
#def compute_forces(q_actual_traj,q_eq_traj,torque_traj,rel_stiffness_list):
# firenze = hr.M3HrlRobot(connect=False)
#
# d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]
# d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]
#
# stiff_list_mNm_deg = [1800,1300,350,600,60]
# stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]
## stiffness_settings = [0.15,0.7,0.8,0.8,0.8]
## dia = np.array(stiffness_settings) * np.array(stiff_list_Nm_rad)
# dia = np.array(rel_stiffness_list) * np.array(stiff_list_Nm_rad)
# k_q = np.matrix(np.diag(dia))
# dia_inv = 1./dia
# k_q_inv = np.matrix(np.diag(dia_inv))
#
# actual_cart = joint_to_cartesian(q_actual_traj)
# eq_cart = joint_to_cartesian(q_eq_traj)
# force_traj_jacinv = ForceTrajectory()
# force_traj_stiff = ForceTrajectory()
# force_traj_torque = ForceTrajectory()
#
# k_cart_list = []
#
# for q_actual,q_dot,q_eq,actual_pos,eq_pos,t,tau_m in zip(q_actual_traj.q_list,q_actual_traj.qdot_list,q_eq_traj.q_list,actual_cart.p_list,eq_cart.p_list,q_actual_traj.time_list,torque_traj.q_list):
# q_eq = firenze.clamp_to_physical_joint_limits('right_arm',q_eq)
# q_delta = np.matrix(q_actual).T - np.matrix(q_eq).T
# tau = k_q * q_delta[0:5,0] - np.matrix(np.array(d_gains_list)*np.array(q_dot)[0:5]).T
#
# x_delta = np.matrix(actual_pos).T - np.matrix(eq_pos).T
#
# jac_full = firenze.Jac('right_arm',q_actual)
# jac = jac_full[0:3,0:5]
#
# jac_full_eq = firenze.Jac('right_arm',q_eq)
# jac_eq = jac_full_eq[0:3,0:5]
# k_cart = np.linalg.inv((jac_eq*k_q_inv*jac_eq.T)) # calculating stiff matrix using Jacobian for eq pt.
# k_cart_list.append(k_cart)
#
# pseudo_inv_jac = np.linalg.inv(jac_full*jac_full.T)*jac_full
#
# tau_full = np.row_stack((tau,np.matrix(tau_m[5:7]).T))
# #force = (-1*pseudo_inv_jac*tau_full)[0:3]
# force = -1*pseudo_inv_jac[0:3,0:5]*tau
# force_traj_jacinv.f_list.append(force.A1.tolist())
# force_traj_stiff.f_list.append((k_cart*x_delta).A1.tolist())
# force_traj_torque.f_list.append((pseudo_inv_jac*np.matrix(tau_m).T)[0:3].A1.tolist())
#
# return force_traj_jacinv,force_traj_stiff,force_traj_torque,k_cart_list
### def plot_error_forces(measured_list,calc_list):
### err_x, err_y = [],[]
### err_rel_x, err_rel_y = [],[]
### mag_x, mag_y = [],[]
### for m,c in zip(measured_list,calc_list):
### err_x.append(abs(m[0]-c[0]))
### err_rel_x.append(abs(m[0]-c[0])/abs(m[0])*100)
### #err_rel_x.append(ut.bound(abs(m[0]-c[0])/abs(m[0])*100,100,0))
### mag_x.append(abs(m[0]))
### err_y.append(abs(m[1]-c[1]))
### err_rel_y.append(abs(m[1]-c[1])/abs(m[1])*100)
### #err_rel_y.append(ut.bound(abs(m[1]-c[1])/abs(m[1])*100,100,0))
### mag_y.append(abs(m[1]))
###
### x_idx = range(len(err_x))
### zero = [0 for i in x_idx]
###
### fig = pl.figure()
### ax1 = fig.add_subplot(111)
### ax2 = ax1.twinx()
###
### ax1.plot(zero,c='k',linewidth=1,label='_nolegend_')
### l1 = ax1.plot(err_x,c='b',linewidth=1,label='absolute error')
### ax1.scatter(x_idx,err_x,c='b',s=10,label='_nolegend_', linewidths=0)
### l2 = ax1.plot(mag_x,c='g',linewidth=1,label='magnitude')
### ax1.scatter(x_idx,mag_x,c='g',s=10,label='_nolegend_', linewidths=0)
### l3 = ax2.plot(err_rel_x,c='r',linewidth=1,label='relative error %')
###
### ax1.set_ylim(0,15)
### ax2.set_ylim(0,100)
### ax1.set_xlabel('measurement number')
### ax1.set_ylabel('x component of force (N)')
### ax2.set_ylabel('percentage error')
### ax1.yaxis.set_label_coords(-0.3,0.5)
### ax2.yaxis.set_label_coords(-0.3,0.5)
### leg = pl.legend([l1,l2,l3],['absolute error','magnitude','rel error %'],loc='upper left',
### handletextsep=0.015,handlelen=0.003,labelspacing=0.003)
###
### fig = pl.figure()
### ax1 = fig.add_subplot(111)
### ax2 = ax1.twinx()
###
### ax1.plot(zero,c='k',linewidth=1)
### l1 = ax1.plot(err_y,c='b',linewidth=1)
### ax1.scatter(x_idx,err_y,c='b',s=10, linewidths=0)
### l2 = ax1.plot(mag_y,c='g',linewidth=1)
### ax1.scatter(x_idx,mag_y,c='g',s=10,linewidths=0)
### l3 = ax2.plot(err_rel_y,c='r',linewidth=1)
###
### ax1.set_ylim(0,15)
### ax2.set_ylim(0,100)
### ax1.yaxis.set_label_coords(-0.3,0.5)
### ax2.yaxis.set_label_coords(-0.3,0.5)
### ax1.set_xlabel('measurement number')
### ax1.set_ylabel('y component of force (N)')
### ax2.set_ylabel('percentage error')
### #pl.legend(loc='best')
### leg = pl.legend([l1,l2,l3],['absolute error','magnitude','rel error %'],loc='upper left',
### handletextsep=0.015,handlelen=0.003,labelspacing=0.003)
###
### # pl.figure()
### # pl.plot(zero,c='k',linewidth=0.5,label='_nolegend_')
### # pl.plot(err_y,c='b',linewidth=1,label='error')
### # pl.plot(err_rel_y,c='r',linewidth=1,label='relative error %')
### # pl.scatter(x_idx,err_y,c='b',s=10,label='_nolegend_', linewidths=0)
### # pl.plot(mag_y,c='g',linewidth=1,label='magnitude')
### # pl.scatter(x_idx,mag_y,c='g',s=10,label='_nolegend_', linewidths=0)
### #
### # pl.xlabel('measurement number')
### # pl.ylabel('y component of force (N)')
### # pl.legend(loc='best')
### # pl.axis('equal')
###
###
### def plot_stiff_ellipses(k_cart_list,pos_traj,skip=10,subplotnum=111):
### import arm_trajectories as at
### if isinstance(pos_traj,at.JointTrajectory):
### pos_traj = joint_to_cartesian(pos_traj)
###
### pts = np.matrix(pos_traj.p_list).T
### x_l = pts[0,:].A1.tolist()
### y_l = pts[1,:].A1.tolist()
###
### from pylab import figure, show, rand
### from matplotlib.patches import Ellipse
###
### ells = []
### scale = 25000.
### ratio_list = []
### for k_c,x,y in zip(k_cart_list[::skip],x_l[::skip],y_l[::skip]):
### w,v = np.linalg.eig(k_c[0:2,0:2])
### w_abs = np.abs(w)
### major_axis = np.max(w_abs)
### minor_axis = np.min(w_abs)
### print 'major, minor:',major_axis,minor_axis
### # print 'k_c:', k_c
### ratio_list.append(major_axis/minor_axis)
###
### ells.append(Ellipse(np.array([x,y]),width=w[0]/scale,height=w[1]/scale,angle=math.degrees(math.atan2(v[1,0],v[0,0]))))
### ells[-1].set_lw(2)
###
### #fig = pl.figure()
### #ax = fig.add_subplot(111, aspect='equal')
### ax = pl.subplot(subplotnum, aspect='equal')
###
### for e in ells:
### ax.add_artist(e)
### #e.set_clip_box(ax.bbox)
### #e.set_alpha(1.)
### e.set_facecolor(np.array([1,1,1]))
###
### plot_cartesian(pos_traj,xaxis=0,yaxis=1,color='b',
### linewidth=0.0,scatter_size=0)
### # plot_cartesian(pos_traj,xaxis=0,yaxis=1,color='b',label='Eq Point',
### # linewidth=1.5,scatter_size=0)
### # plot_cartesian(d['actual'],xaxis=0,yaxis=1,color='b',label='FK',
### # linewidth=1.5,scatter_size=0)
### # plot_cartesian(d['eq_pt'], xaxis=0,yaxis=1,color='g',label='Eq Point',
### # linewidth=1.5,scatter_size=0)
###
### mean_ratio = np.mean(np.array(ratio_list))
### std_ratio = np.std(np.array(ratio_list))
###
### return mean_ratio,std_ratio
###
### # plot the force field in the xy plane for the stiffness matrix k_cart.
### ## @param k_cart: 3x3 cartesian space stiffness matrix.
### def plot_stiffness_field(k_cart,plottitle=''):
### n_points = 20
### ang_step = math.radians(360)/n_points
### x_list = []
### y_list = []
### u_list = []
### v_list = []
### k_cart = k_cart[0:2,0:2]
###
### for i in range(n_points):
### ang = i*ang_step
### for r in [0.5,1.,1.5]:
### dx = r*math.cos(ang)
### dy = r*math.sin(ang)
### dtau = -k_cart*np.matrix([dx,dy]).T
### x_list.append(dx)
### y_list.append(dy)
### u_list.append(dtau[0,0])
### v_list.append(dtau[1,0])
###
### pl.figure()
### # mpu.plot_circle(0,0,1.0,0.,math.radians(360))
### mpu.plot_radii(0,0,1.5,0.,math.radians(360),interval=ang_step,color='r')
### pl.quiver(x_list,y_list,u_list,v_list,width=0.002,color='k',scale=None)
### pl.axis('equal')
### pl.title(plottitle)
###
### def plot_stiff_ellipse_map(stiffness_list,num):
### firenze = hr.M3HrlRobot(connect=False)
### hook_3dprint_angle = math.radians(20-2.54)
### rot_mat = tr.Rz(0.-hook_3dprint_angle)*tr.Ry(math.radians(-90))
###
### d_gains_list_mN_deg_sec = [-100,-120,-15,-25,-1.25]
### d_gains_list = [180./1000.*s/math.pi for s in d_gains_list_mN_deg_sec]
###
### stiff_list_mNm_deg = [1800,1300,350,600,60]
### stiff_list_Nm_rad = [180./1000.*s/math.pi for s in stiff_list_mNm_deg]
### dia = np.array(stiffness_list) * np.array(stiff_list_Nm_rad)
### k_q = np.matrix(np.diag(dia))
### dia_inv = 1./dia
### k_q_inv = np.matrix(np.diag(dia_inv))
###
### s0,s1,s2,s3 = stiffness_list[0],stiffness_list[1],stiffness_list[2],stiffness_list[3]
###
### i=0
### #for z in np.arange(-0.1,-0.36,-0.05):
### for z in np.arange(-0.23,-0.27,-0.05):
### pl.figure()
### k_cart_list = []
### pos_traj = CartesianTajectory()
### for x in np.arange(0.25,0.56,0.05):
### for y in np.arange(-0.15,-0.56,-0.05):
### if math.sqrt(x**2+y**2)>0.55:
### continue
### q = firenze.IK('right_arm',np.matrix([x,y,z]).T,rot_mat)
### if q == None:
### continue
### jac_full = firenze.Jac('right_arm',q)
### jac = jac_full[0:3,0:5]
### k_cart = np.linalg.inv((jac*k_q_inv*jac.T))
### k_cart_list.append(k_cart)
### pos_traj.p_list.append([x,y,z])
### pos_traj.time_list.append(0.1)
### if len(pos_traj.p_list)>0:
### ret = plot_stiff_ellipses(k_cart_list,pos_traj,skip=1)
### pl.axis('equal')
### pl.legend(loc='best')
### title_string = 'z: %.2f stiff:[%.1f,%.1f,%.1f,%.1f]'%(z,s0,s1,s2,s3)
### pl.title(title_string)
### i+=1
### pl.savefig('ellipses_%03d_%03d.png'%(num,i))
###
### return ret
###
### def diff_roll_angles():
### pl.subplot(211,aspect='equal')
| ajibawa-2023/Python-Code-Large/train/row_99207 | 516 | 1,144 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L2_C0", "label": "scipy.optimize import so", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0017, 0.0009, 0, 0.66, 0.0, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "scipy.optimize", "arg_names": [], "import_names": ["so"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.optimize as so"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L4_C0", "label": "math import math, np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 0.0009, 0, 0.66, 0.0333, 526, 0, 2, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math", "np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math, numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L5_C0", "label": "pylab import pl", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0044, 0.0009, 0, 0.66, 0.0667, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pl"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pylab as pl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L6_C0", "label": "sys import sys, optparse, time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0052, 0.0009, 0, 0.66, 0.1, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "optparse", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, optparse, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L7_C0", "label": "copy import copy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.0009, 0, 0.66, 0.1333, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ImportFrom_L9_C0", "label": "from enthought.mayavi import mlab", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.0009, 0, 0.66, 0.1667, 226, 0, 1, 0, 0, 226, 0, 0], "semantic": {"name": "enthought.mayavi", "arg_names": [], "import_names": ["mlab"], "rhs_call_name": "", "annotation": ""}, "snippet": "from enthought.mayavi import mlab"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L13_C0", "label": "roslib import roslib", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0009, 0, 0.66, 0.2, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('doors_forces_kinematics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L13_C15", "label": "load_manifest()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0114, 0.0009, 0, 0.66, 0.2333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('doors_forces_kinematics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L14_C0", "label": "load_manifest()", "type": "expression", "loc": [14, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0122, 0.0009, 0, 0.66, 0.2667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('epc_core')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L15_C0", "label": "cody_arms.arms import ca", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0131, 0.0009, 0, 0.66, 0.3, 970, 0, 1, 0, 0, 970, 0, 0], "semantic": {"name": "cody_arms.arms", "arg_names": [], "import_names": ["ca"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cody_arms.arms as ca"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L17_C0", "label": "cody_arms.coord_frames import mcf", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0149, 0.0009, 0, 0.66, 0.3333, 888, 0, 1, 0, 0, 888, 0, 0], "semantic": {"name": "cody_arms.coord_frames", "arg_names": [], "import_names": ["mcf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cody_arms.coord_frames as mcf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L19_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0166, 0.0009, 0, 0.66, 0.3667, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L21_C0", "label": "load_manifest()", "type": "expression", "loc": [21, 21], "level": 0, "parent": null, "vector": [8, 0, 0.0184, 0.0009, 0, 0.66, 0.4, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_tilting_hokuyo')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L22_C0", "label": "hrl_tilting_hokuyo.display_3d_mayavi import d3m", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0192, 0.0009, 0, 0.66, 0.4333, 181, 0, 1, 0, 0, 181, 0, 0], "semantic": {"name": "hrl_tilting_hokuyo.display_3d_mayavi", "arg_names": [], "import_names": ["d3m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_tilting_hokuyo.display_3d_mayavi as d3m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L24_C0", "label": "load_manifest()", "type": "expression", "loc": [24, 24], "level": 0, "parent": null, "vector": [8, 0, 0.021, 0.0009, 0, 0.66, 0.4667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('epc_door_opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L25_C0", "label": "epc_door_opening.segway_motion_calc import smc", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0219, 0.0009, 0, 0.66, 0.5, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "epc_door_opening.segway_motion_calc", "arg_names": [], "import_names": ["smc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import epc_door_opening.segway_motion_calc as smc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L27_C0", "label": "JointTrajectory", "type": "class", "loc": [27, 35], "level": 0, "parent": null, "vector": [3, 0, 0.0271, 0.0079, 0, 0.66, 0.5333, 302, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "JointTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointTrajectory():\n ''' class to store joint trajectories.\n data only - use for pickling.\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.q_list = [] #each element is a list of 7 joint angles.\n self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L28_C4", "label": "expression", "type": "expression", "loc": [28, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L27_C0", "vector": [8, 1, 0.0253, 0.0026, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store joint trajectories.\n data only - use for pickling.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L27_C0", "vector": [2, 1, 0.0288, 0.0044, 1, 0.93, 1.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.time_list = [] # time in seconds\n self.q_list = [] #each element is a list of 7 joint angles.\n self.qdot_list = [] #each element is a list of 7 joint angles.\n self.qdotdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L32_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "vector": [14, 2, 0.028, 0.0009, 2, 0.68, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L33_C8", "label": "self.q_list =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "vector": [14, 2, 0.0288, 0.0009, 2, 0.68, 0.3333, 339, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.q_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.q_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L34_C8", "label": "self.qdot_list =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "vector": [14, 2, 0.0297, 0.0009, 2, 0.68, 0.6667, 600, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.qdot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L35_C8", "label": "self.qdotdot_list =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "vector": [14, 2, 0.0306, 0.0009, 2, 0.68, 1.0, 972, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.qdotdot_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.qdotdot_list = [] #each element is a list of 7 joint angles."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L39_C0", "label": "PlanarTrajectory", "type": "class", "loc": [39, 44], "level": 0, "parent": null, "vector": [3, 0, 0.0363, 0.0052, 0, 0.66, 0.5667, 336, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "PlanarTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PlanarTrajectory():\n def __init__(self):\n self.time_list = [] # time in seconds\n self.x_list = []\n self.y_list = []\n self.a_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "label": "__init__", "type": "function", "loc": [40, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L39_C0", "vector": [2, 1, 0.0367, 0.0044, 1, 0.56, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.time_list = [] # time in seconds\n self.x_list = []\n self.y_list = []\n self.a_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L41_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "vector": [14, 2, 0.0358, 0.0009, 2, 0.88, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L42_C8", "label": "self.x_list =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "vector": [14, 2, 0.0367, 0.0009, 2, 0.88, 0.3333, 885, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.x_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L43_C8", "label": "self.y_list =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "vector": [14, 2, 0.0376, 0.0009, 2, 0.88, 0.6667, 291, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.y_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.y_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L44_C8", "label": "self.a_list =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "vector": [14, 2, 0.0385, 0.0009, 2, 0.88, 1.0, 427, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.a_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.a_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L46_C0", "label": "CartesianTajectory", "type": "class", "loc": [46, 53], "level": 0, "parent": null, "vector": [3, 0, 0.0433, 0.007, 0, 0.66, 0.6, 610, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "CartesianTajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CartesianTajectory():\n ''' class to store trajectory of cartesian points.\n data only - use for pickling\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.p_list = [] #each element is a list of 3 coordinates\n self.v_list = [] #each element is a list of 3 coordinates (velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L47_C4", "label": "expression", "type": "expression", "loc": [47, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L46_C0", "vector": [8, 1, 0.042, 0.0026, 1, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store trajectory of cartesian points.\n data only - use for pickling\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "label": "__init__", "type": "function", "loc": [50, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L46_C0", "vector": [2, 1, 0.045, 0.0035, 1, 0.87, 1.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.time_list = [] # time in seconds\n self.p_list = [] #each element is a list of 3 coordinates\n self.v_list = [] #each element is a list of 3 coordinates (velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L51_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "vector": [14, 2, 0.0446, 0.0009, 2, 0.95, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L52_C8", "label": "self.p_list =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "vector": [14, 2, 0.0455, 0.0009, 2, 0.95, 0.5, 789, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.p_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L53_C8", "label": "self.v_list =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "vector": [14, 2, 0.0463, 0.0009, 2, 0.95, 1.0, 74, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.v_list = [] #each element is a list of 3 coordinates (velocity)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L55_C0", "label": "ForceTrajectory", "type": "class", "loc": [55, 61], "level": 0, "parent": null, "vector": [3, 0, 0.0507, 0.0061, 0, 0.66, 0.6333, 306, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "ForceTrajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForceTrajectory():\n ''' class to store time evolution of the force at the end effector.\n data only - use for pickling\n '''\n def __init__(self):\n self.time_list = [] # time in seconds\n self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L56_C4", "label": "expression", "type": "expression", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L55_C0", "vector": [8, 1, 0.0498, 0.0026, 1, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' class to store time evolution of the force at the end effector.\n data only - use for pickling\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L59_C4", "label": "__init__", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L55_C0", "vector": [2, 1, 0.0524, 0.0026, 1, 0.93, 1.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.time_list = [] # time in seconds\n self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L60_C8", "label": "self.time_list =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L59_C4", "vector": [14, 2, 0.0524, 0.0009, 2, 0.83, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_list = [] # time in seconds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L61_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L59_C4", "vector": [14, 2, 0.0533, 0.0009, 2, 0.83, 1.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = [] #each element is a list of 3 coordinates"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "label": "joint_to_cartesian", "type": "function", "loc": [67, 88], "level": 0, "parent": null, "vector": [2, 0, 0.0677, 0.0192, 0, 0.66, 0.6667, 202, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "joint_to_cartesian", "arg_names": ["traj", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def joint_to_cartesian(traj, arm):\n firenze = ca.M3HrlRobot(end_effector_length = 0.17318)\n #firenze = ca.M3HrlRobot()\n pts = []\n cart_vel = []\n for i in range(len(traj.q_list)):\n q = traj.q_list[i]\n p = firenze.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L68_C4", "label": "firenze = M3HrlRobot()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0594, 0.0009, 1, 0.06, 0.0, 736, 3, 1, 0, 0, 305, 10, 1], "semantic": {"name": "firenze", "arg_names": [], "import_names": [], "rhs_call_name": "M3HrlRobot", "annotation": ""}, "snippet": " firenze = ca.M3HrlRobot(end_effector_length = 0.17318)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L70_C4", "label": "pts =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0612, 0.0009, 1, 0.06, 0.125, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L71_C4", "label": "cart_vel =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0621, 0.0009, 1, 0.06, 0.25, 848, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cart_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cart_vel = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "label": "for i", "type": "for", "loc": [72, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [6, 1, 0.0669, 0.0087, 1, 0.06, 0.375, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(traj.q_list)):\n q = traj.q_list[i]\n p = firenze.FK(arm, q)\n pts.append(p.A1.tolist())\n\n if traj.qdot_list != [] and traj.qdot_list[0] != None:\n qdot = traj.qdot_list[i]\n jac = firenze.Jac(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L73_C8", "label": "q =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "vector": [14, 2, 0.0638, 0.0009, 2, 0.92, 0.0, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = traj.q_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L74_C8", "label": "p = FK()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "vector": [14, 2, 0.0647, 0.0009, 2, 0.92, 0.3333, 491, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " p = firenze.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L75_C8", "label": "append()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "vector": [8, 2, 0.0656, 0.0009, 2, 0.92, 0.6667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "label": "if", "type": "if", "loc": [77, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "vector": [4, 2, 0.0691, 0.0044, 2, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if traj.qdot_list != [] and traj.qdot_list[0] != None:\n qdot = traj.qdot_list[i]\n jac = firenze.Jac(arm, q)\n vel = jac * np.matrix(qdot).T\n cart_vel.append(vel.A1[0:3].tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L78_C12", "label": "qdot =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "vector": [14, 3, 0.0682, 0.0009, 3, 0.9, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qdot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qdot = traj.qdot_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L79_C12", "label": "jac = Jac()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "vector": [14, 3, 0.0691, 0.0009, 3, 0.9, 0.3333, 812, 3, 2, 0, 0, 115, 10, 1], "semantic": {"name": "jac", "arg_names": [], "import_names": [], "rhs_call_name": "Jac", "annotation": ""}, "snippet": " jac = firenze.Jac(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L80_C12", "label": "vel =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "vector": [14, 3, 0.0699, 0.0009, 3, 0.9, 0.6667, 527, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = jac * np.matrix(qdot).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L81_C12", "label": "append()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "vector": [8, 3, 0.0708, 0.0009, 3, 0.9, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cart_vel.append(vel.A1[0:3].tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L83_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0726, 0.0009, 1, 0.06, 0.5, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L84_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0734, 0.0009, 1, 0.06, 0.625, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L85_C4", "label": "ct.p_list = copy()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0743, 0.0009, 1, 0.06, 0.75, 841, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.p_list = copy.copy(pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L86_C4", "label": "ct.v_list = copy()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [14, 1, 0.0752, 0.0009, 1, 0.06, 0.875, 871, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.v_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.v_list = copy.copy(cart_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "vector": [13, 1, 0.0769, 0.0009, 1, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "label": "plot_forces_quiver", "type": "function", "loc": [90, 106], "level": 0, "parent": null, "vector": [2, 0, 0.0857, 0.0149, 0, 0.66, 0.7, 539, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "plot_forces_quiver", "arg_names": ["pos_traj", "force_traj", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_forces_quiver(pos_traj,force_traj,color='k'):\n import arm_trajectories as at\n #if traj.__class__ == at.JointTrajectory:\n if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)\n\n pts = np.matrix(pos_traj.p_list).T\n label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L91_C4", "label": "arm_trajectories import at", "type": "import", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [1, 1, 0.0795, 0.0009, 1, 0.94, 0.0, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L93_C4", "label": "if", "type": "if", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [4, 1, 0.0817, 0.0017, 1, 0.94, 0.1, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(pos_traj,at.JointTrajectory):\n pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L94_C8", "label": "pos_traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L93_C4", "vector": [14, 2, 0.0822, 0.0009, 2, 0.85, 0.0, 521, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "pos_traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " pos_traj = joint_to_cartesian(pos_traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L96_C4", "label": "pts =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.0839, 0.0009, 1, 0.94, 0.2, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(pos_traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L97_C4", "label": "label_list =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.0848, 0.0009, 1, 0.94, 0.3, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L98_C4", "label": "x = tolist()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.0857, 0.0009, 1, 0.94, 0.4, 190, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x = pts[0,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L99_C4", "label": "y = tolist()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.0865, 0.0009, 1, 0.94, 0.5, 304, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y = pts[1,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L101_C4", "label": "forces =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.0883, 0.0009, 1, 0.94, 0.6, 817, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "forces", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forces = np.matrix(force_traj.f_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L102_C4", "label": "u = tolist()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.0892, 0.0009, 1, 0.94, 0.7, 609, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "u", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " u = (-1*forces[0,:]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L103_C4", "label": "v = tolist()", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [14, 1, 0.09, 0.0009, 1, 0.94, 0.8, 553, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " v = (-1*forces[1,:]).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L104_C4", "label": "quiver()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [8, 1, 0.0909, 0.0009, 1, 0.94, 0.9, 649, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "quiver", "arg_names": [], "import_names": [], "rhs_call_name": "quiver", "annotation": ""}, "snippet": " pl.quiver(x,y,u,v,width=0.002,color=color,scale=100.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L106_C4", "label": "axis()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "vector": [8, 1, 0.0927, 0.0009, 1, 0.94, 1.0, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pl.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "label": "plot_cartesian", "type": "function", "loc": [111, 158], "level": 0, "parent": null, "vector": [2, 0, 0.1176, 0.042, 0, 0.66, 0.7333, 991, 0, 9, 0, 0, 0, 0, 24], "semantic": {"name": "plot_cartesian", "arg_names": ["traj", "xaxis", "yaxis", "zaxis", "color", "label", "linewidth", "scatter_size", "plot_velocity"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_cartesian(traj, xaxis=None, yaxis=None, zaxis=None, color='b',label='_nolegend_',\n linewidth=2, scatter_size=10, plot_velocity=False):\n import matplotlib_util.util as mpu\n import arm_trajectories as at\n #if traj.__class__ == at.JointTrajectory:\n if isinstance(traj,at.JointTrajectory):\n traj = joint_to_cartesian(traj)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L113_C4", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [1, 1, 0.0988, 0.0009, 1, 0.08, 0.0, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": " import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L114_C4", "label": "arm_trajectories import at", "type": "import", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [1, 1, 0.0997, 0.0009, 1, 0.08, 0.125, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": " import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L116_C4", "label": "if", "type": "if", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [4, 1, 0.1018, 0.0017, 1, 0.08, 0.25, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(traj,at.JointTrajectory):\n traj = joint_to_cartesian(traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L117_C8", "label": "traj = joint_to_cartesian()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L116_C4", "vector": [14, 2, 0.1023, 0.0009, 2, 0.46, 0.0, 742, 3, 1, 0, 0, 202, 10, 1], "semantic": {"name": "traj", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " traj = joint_to_cartesian(traj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L119_C4", "label": "pts =", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [14, 1, 0.104, 0.0009, 1, 0.08, 0.375, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(traj.p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L120_C4", "label": "label_list =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [14, 1, 0.1049, 0.0009, 1, 0.08, 0.5, 887, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "label_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_list = ['X coord (m)', 'Y coord (m)', 'Z coord (m)']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L121_C4", "label": "x = tolist()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [14, 1, 0.1058, 0.0009, 1, 0.08, 0.625, 190, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x = pts[xaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L122_C4", "label": "y = tolist()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [14, 1, 0.1066, 0.0009, 1, 0.08, 0.75, 304, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " y = pts[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "label": "if", "type": "if", "loc": [124, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [4, 1, 0.1097, 0.0035, 1, 0.08, 0.875, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_velocity:\n vels = np.matrix(traj.v_list).T\n xvel = vels[xaxis,:].A1.tolist()\n yvel = vels[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L125_C8", "label": "vels =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "vector": [14, 2, 0.1093, 0.0009, 2, 0.05, 0.0, 813, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vels = np.matrix(traj.v_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L126_C8", "label": "xvel = tolist()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "vector": [14, 2, 0.1101, 0.0009, 2, 0.05, 0.5, 984, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "xvel", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " xvel = vels[xaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L127_C8", "label": "yvel = tolist()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "vector": [14, 2, 0.111, 0.0009, 2, 0.05, 1.0, 335, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "yvel", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " yvel = vels[yaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "label": "if", "type": "if", "loc": [129, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "vector": [4, 1, 0.1254, 0.0262, 1, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if zaxis == None:\n mpu.plot_yx(y, x, color, linewidth, '-', scatter_size, label,\n axis = 'equal', xlabel = label_list[xaxis],\n ylabel = label_list[yaxis],)\n if plot_velocity:\n mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),\n width = 0.001, scale = 1.)\n mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L130_C8", "label": "plot_yx()", "type": "expression", "loc": [130, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1145, 0.0026, 2, 0.49, 0.0, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(y, x, color, linewidth, '-', scatter_size, label,\n axis = 'equal', xlabel = label_list[xaxis],\n ylabel = label_list[yaxis],)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L133_C8", "label": "if", "type": "if", "loc": [133, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [4, 2, 0.1171, 0.0026, 2, 0.49, 0.0526, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_velocity:\n mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),\n width = 0.001, scale = 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L134_C12", "label": "plot_quiver_yxv()", "type": "expression", "loc": [134, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L133_C8", "vector": [8, 3, 0.1176, 0.0017, 3, 0.52, 0.0, 776, 3, 5, 0, 0, 0, 0, 2], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv(y, x, np.matrix([xvel,yvel]),\n width = 0.001, scale = 1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L136_C8", "label": "legend()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1189, 0.0009, 2, 0.49, 0.1053, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ImportFrom_L138_C8", "label": "from numpy import array", "type": "import", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [1, 2, 0.1206, 0.0009, 2, 0.49, 0.1579, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["array"], "rhs_call_name": "", "annotation": ""}, "snippet": " from numpy import array"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:ImportFrom_L139_C8", "label": "from enthought.mayavi.api import Engine", "type": "import", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [1, 2, 0.1215, 0.0009, 2, 0.49, 0.2105, 111, 0, 1, 0, 0, 111, 0, 0], "semantic": {"name": "enthought.mayavi.api", "arg_names": [], "import_names": ["Engine"], "rhs_call_name": "", "annotation": ""}, "snippet": " from enthought.mayavi.api import Engine"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L140_C8", "label": "engine = Engine()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1224, 0.0009, 2, 0.49, 0.2632, 3, 3, 0, 0, 0, 298, 10, 1], "semantic": {"name": "engine", "arg_names": [], "import_names": [], "rhs_call_name": "Engine", "annotation": ""}, "snippet": " engine = Engine()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L141_C8", "label": "start()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1233, 0.0009, 2, 0.49, 0.3158, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " engine.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L142_C8", "label": "if", "type": "if", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [4, 2, 0.1246, 0.0017, 2, 0.49, 0.3684, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(engine.scenes) == 0:\n engine.new_scene()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L143_C12", "label": "new_scene()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L142_C8", "vector": [8, 3, 0.125, 0.0009, 3, 0.75, 0.0, 16, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "new_scene", "arg_names": [], "import_names": [], "rhs_call_name": "new_scene", "annotation": ""}, "snippet": " engine.new_scene()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L145_C8", "label": "z = tolist()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1267, 0.0009, 2, 0.49, 0.4211, 859, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " z = pts[zaxis,:].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L146_C8", "label": "time_list =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1276, 0.0009, 2, 0.49, 0.4737, 941, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [t-traj.time_list[0] for t in traj.time_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L147_C8", "label": "plot3d()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1285, 0.0009, 2, 0.49, 0.5263, 290, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot3d", "arg_names": [], "import_names": [], "rhs_call_name": "plot3d", "annotation": ""}, "snippet": " mlab.plot3d(x,y,z,time_list,tube_radius=None,line_width=4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L148_C8", "label": "axes()", "type": "expression", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1294, 0.0009, 2, 0.49, 0.5789, 590, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "axes", "annotation": ""}, "snippet": " mlab.axes()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L149_C8", "label": "xlabel()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1302, 0.0009, 2, 0.49, 0.6316, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " mlab.xlabel(label_list[xaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L150_C8", "label": "ylabel()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1311, 0.0009, 2, 0.49, 0.6842, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " mlab.ylabel(label_list[yaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L151_C8", "label": "zlabel()", "type": "expression", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.132, 0.0009, 2, 0.49, 0.7368, 557, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "zlabel", "arg_names": [], "import_names": [], "rhs_call_name": "zlabel", "annotation": ""}, "snippet": " mlab.zlabel(label_list[zaxis])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L152_C8", "label": "colorbar()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [8, 2, 0.1329, 0.0009, 2, 0.49, 0.7895, 915, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "colorbar", "arg_names": [], "import_names": [], "rhs_call_name": "colorbar", "annotation": ""}, "snippet": " mlab.colorbar(title='Time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L155_C8", "label": "axes =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1355, 0.0009, 2, 0.49, 0.8421, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes = engine.scenes[0].children[0].children[0].children[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L156_C8", "label": "axes.axes.position = array()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1364, 0.0009, 2, 0.49, 0.8947, 929, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "axes.axes.position", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " axes.axes.position = array([ 0., 0.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L157_C8", "label": "axes.axes.label_format =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1372, 0.0009, 2, 0.49, 0.9474, 354, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "axes.axes.label_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes.axes.label_format = '%-#6.2g'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L158_C8", "label": "axes.title_text_property.font_size =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "vector": [14, 2, 0.1381, 0.0009, 2, 0.49, 1.0, 699, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "axes.title_text_property.font_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes.title_text_property.font_size=4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "label": "compute_radial_tangential_forces", "type": "function", "loc": [168, 187], "level": 0, "parent": null, "vector": [2, 0, 0.1552, 0.0175, 0, 0.66, 0.7667, 224, 0, 4, 1, 0, 0, 0, 14], "semantic": {"name": "compute_radial_tangential_forces", "arg_names": ["f_list", "p_list", "cx", "cy"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_radial_tangential_forces(f_list,p_list,cx,cy):\n f_rad_l,f_tan_l, f_res_l = [], [], []\n for f,p in zip(f_list,p_list):\n rad_vec = np.array([p[0]-cx,p[1]-cy])\n rad_vec = rad_vec/np.linalg.norm(rad_vec)\n tan_vec = (np.matrix([[0,-1],[1,0]]) * np.matrix(rad_vec).T).A1\n f_vec = np.array([f[0],f[1]])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L169_C4", "label": "f_rad_l, f_tan_l, f_res_l =", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "vector": [14, 1, 0.1477, 0.0009, 1, 0.41, 0.0, 672, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "f_rad_l, f_tan_l, f_res_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_rad_l,f_tan_l, f_res_l = [], [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "label": "for f, p", "type": "for", "loc": [170, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "vector": [6, 1, 0.1552, 0.014, 1, 0.41, 0.5, 749, 3, 0, 0, 0, 0, 0, 14], "semantic": {"name": "f, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f,p in zip(f_list,p_list):\n rad_vec = np.array([p[0]-cx,p[1]-cy])\n rad_vec = rad_vec/np.linalg.norm(rad_vec)\n tan_vec = (np.matrix([[0,-1],[1,0]]) * np.matrix(rad_vec).T).A1\n f_vec = np.array([f[0],f[1]])\n\n f_tan_mag = np.dot(f_vec, tan_vec)\n f_rad_mag = np.dot(f_vec, rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L171_C8", "label": "rad_vec = array()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1495, 0.0009, 2, 0.16, 0.0, 331, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " rad_vec = np.array([p[0]-cx,p[1]-cy])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L172_C8", "label": "rad_vec =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1503, 0.0009, 2, 0.16, 0.1, 331, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec = rad_vec/np.linalg.norm(rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L173_C8", "label": "tan_vec =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1512, 0.0009, 2, 0.16, 0.2, 651, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tan_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_vec = (np.matrix([[0,-1],[1,0]]) * np.matrix(rad_vec).T).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L174_C8", "label": "f_vec = array()", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1521, 0.0009, 2, 0.16, 0.3, 231, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " f_vec = np.array([f[0],f[1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L176_C8", "label": "f_tan_mag = dot()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1538, 0.0009, 2, 0.16, 0.4, 345, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_tan_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_tan_mag = np.dot(f_vec, tan_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L177_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1547, 0.0009, 2, 0.16, 0.5, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec, rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L180_C8", "label": "f_rad_mag = abs()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1573, 0.0009, 2, 0.16, 0.6, 421, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " f_rad_mag = abs(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L181_C8", "label": "f_tan_mag = abs()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [14, 2, 0.1582, 0.0009, 2, 0.16, 0.7, 345, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "f_tan_mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " f_tan_mag = abs(f_tan_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L183_C8", "label": "append()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [8, 2, 0.16, 0.0009, 2, 0.16, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_rad_l.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L184_C8", "label": "append()", "type": "expression", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [8, 2, 0.1608, 0.0009, 2, 0.16, 0.9, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_tan_l.append(f_tan_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L185_C8", "label": "append()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "vector": [8, 2, 0.1617, 0.0009, 2, 0.16, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_res_l.append(abs(f[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L187_C4", "label": "return", "type": "return", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "vector": [13, 1, 0.1635, 0.0009, 1, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f_rad_l, f_tan_l, f_res_l"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "label": "fit_circle_priors", "type": "function", "loc": [191, 220], "level": 0, "parent": null, "vector": [2, 0, 0.1796, 0.0262, 0, 0.66, 0.8, 342, 0, 8, 1, 0, 0, 0, 5], "semantic": {"name": "fit_circle_priors", "arg_names": ["rad_guess", "x_guess", "y_guess", "pts", "sigma_r", "sigma_xy", "sigma_pts", "verbose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fit_circle_priors(rad_guess, x_guess, y_guess, pts, sigma_r,\n sigma_xy, sigma_pts, verbose=True):\n global x_prior, y_prior\n x_prior = x_guess\n y_prior = y_guess\n def error_function(params):\n center = np.matrix((params[0],params[1])).T\n rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L194_C4", "label": "x_prior =", "type": "assigned_variable", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1696, 0.0009, 1, 0.49, 0.0, 960, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_prior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_prior = x_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L195_C4", "label": "y_prior =", "type": "assigned_variable", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1705, 0.0009, 1, 0.49, 0.1, 180, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_prior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_prior = y_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "label": "error_function", "type": "function", "loc": [196, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [2, 1, 0.1748, 0.0079, 1, 0.49, 0.2, 875, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n center = np.matrix((params[0],params[1])).T\n rad = params[2]\n err_pts = ut.norm(pts-center).A1 - rad\n lik = np.dot(err_pts, err_pts) / (sigma_pts * sigma_pts)\n pri = ((rad - rad_guess)**2) / (sigma_r * sigma_r)\n #pri += ((x_prior - center[0,0])**2) / (sigma_xy * sigma_xy)\n #pri += ((y_prior - center[1,0])**2) / (sigma_xy * sigma_xy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L197_C8", "label": "center =", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "vector": [14, 2, 0.1722, 0.0009, 2, 0.22, 0.0, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix((params[0],params[1])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L198_C8", "label": "rad =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "vector": [14, 2, 0.1731, 0.0009, 2, 0.22, 0.2, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L199_C8", "label": "err_pts =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "vector": [14, 2, 0.174, 0.0009, 2, 0.22, 0.4, 816, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "err_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err_pts = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L200_C8", "label": "lik =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "vector": [14, 2, 0.1748, 0.0009, 2, 0.22, 0.6, 945, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lik", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lik = np.dot(err_pts, err_pts) / (sigma_pts * sigma_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L201_C8", "label": "pri =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "vector": [14, 2, 0.1757, 0.0009, 2, 0.22, 0.8, 478, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pri", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pri = ((rad - rad_guess)**2) / (sigma_r * sigma_r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L204_C8", "label": "return", "type": "return", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "vector": [13, 2, 0.1783, 0.0009, 2, 0.22, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (lik + pri)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L206_C4", "label": "params_1 =", "type": "assigned_variable", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1801, 0.0009, 1, 0.49, 0.3, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_1 = [x_prior, y_prior, rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L207_C4", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [207, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1814, 0.0017, 1, 0.49, 0.4, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L209_C4", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1827, 0.0009, 1, 0.49, 0.5, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L211_C4", "label": "y_prior =", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1844, 0.0009, 1, 0.49, 0.6, 180, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_prior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_prior = y_guess + 2*rad_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L212_C4", "label": "params_2 =", "type": "assigned_variable", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1853, 0.0009, 1, 0.49, 0.7, 165, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_2 = [x_prior, y_prior, rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L213_C4", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [213, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1866, 0.0017, 1, 0.49, 0.8, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L215_C4", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [14, 1, 0.1879, 0.0009, 1, 0.49, 0.9, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L217_C4", "label": "if", "type": "if", "loc": [217, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "vector": [4, 1, 0.191, 0.0035, 1, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fopt_2<fopt_1:\n return opt_params_2[2],opt_params_2[0],opt_params_2[1]\n else:\n return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L218_C8", "label": "return", "type": "return", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L217_C4", "vector": [13, 2, 0.1906, 0.0009, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_2[2],opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L220_C8", "label": "return", "type": "return", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L217_C4", "vector": [13, 2, 0.1923, 0.0009, 2, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "label": "fit_circle", "type": "function", "loc": [233, 283], "level": 0, "parent": null, "vector": [2, 0, 0.2255, 0.0446, 0, 0.66, 0.8333, 441, 0, 7, 1, 0, 0, 0, 11], "semantic": {"name": "fit_circle", "arg_names": ["rad_guess", "x_guess", "y_guess", "pts", "method", "verbose", "rad_fix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fit_circle(rad_guess, x_guess, y_guess, pts, method, verbose=True,\n rad_fix = False):\n def error_function(params):\n center = np.matrix((params[0],params[1])).T\n if rad_fix:\n rad = rad_guess\n else:\n rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "label": "error_function", "type": "function", "loc": [235, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [2, 1, 0.2102, 0.0105, 1, 0.35, 0.0, 875, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n center = np.matrix((params[0],params[1])).T\n if rad_fix:\n rad = rad_guess\n else:\n rad = params[2]\n\n err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L236_C8", "label": "center =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "vector": [14, 2, 0.2063, 0.0009, 2, 0.41, 0.0, 546, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "center", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " center = np.matrix((params[0],params[1])).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L237_C8", "label": "if", "type": "if", "loc": [237, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "vector": [4, 2, 0.2085, 0.0035, 2, 0.41, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad_fix:\n rad = rad_guess\n else:\n rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L238_C12", "label": "rad =", "type": "assigned_variable", "loc": [238, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L237_C8", "vector": [14, 3, 0.208, 0.0009, 3, 0.56, 0.0, 439, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = rad_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L240_C12", "label": "rad =", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L237_C8", "vector": [14, 3, 0.2098, 0.0009, 3, 0.56, 1.0, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = params[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L242_C8", "label": "err =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "vector": [14, 2, 0.2115, 0.0009, 2, 0.41, 0.5, 541, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = ut.norm(pts-center).A1 - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L243_C8", "label": "res = dot()", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "vector": [14, 2, 0.2124, 0.0009, 2, 0.41, 0.75, 413, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " res = np.dot(err,err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L246_C8", "label": "return", "type": "return", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "vector": [13, 2, 0.215, 0.0009, 2, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L248_C4", "label": "params_1 =", "type": "assigned_variable", "loc": [248, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [14, 1, 0.2168, 0.0009, 1, 0.35, 0.1429, 908, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_1 = [x_guess,y_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L249_C4", "label": "if", "type": "if", "loc": [249, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [4, 1, 0.2181, 0.0017, 1, 0.35, 0.2857, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rad_fix:\n params_1.append(rad_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L250_C8", "label": "append()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L249_C4", "vector": [8, 2, 0.2185, 0.0009, 2, 0.5, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " params_1.append(rad_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "label": "if", "type": "if", "loc": [251, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [4, 1, 0.2229, 0.0079, 1, 0.35, 0.4286, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method == 'fmin':\n r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)\n opt_params_1,fopt_1 = r[0],r[1]\n elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_1,fopt_1 = r[0],r[1]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L252_C8", "label": "r = fmin()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "vector": [14, 2, 0.2203, 0.0009, 2, 0.07, 0.0, 436, 3, 6, 0, 0, 247, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin", "annotation": ""}, "snippet": " r = so.fmin(error_function,params_1,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L253_C8", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "vector": [14, 2, 0.2212, 0.0009, 2, 0.07, 0.5, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L254_C4", "label": "if", "type": "if", "loc": [254, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "vector": [4, 2, 0.2242, 0.0052, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_1,fopt_1 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L255_C8", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [255, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L254_C4", "vector": [14, 3, 0.2233, 0.0017, 3, 0.36, 0.0, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params_1, full_output=1,\n disp = verbose, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L257_C8", "label": "opt_params_1, fopt_1 =", "type": "assigned_variable", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L254_C4", "vector": [14, 3, 0.2247, 0.0009, 3, 0.36, 1.0, 75, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_1, fopt_1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_1,fopt_1 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L261_C4", "label": "params_2 =", "type": "assigned_variable", "loc": [261, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [14, 1, 0.2281, 0.0009, 1, 0.35, 0.5714, 165, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params_2 = [x_guess,y_guess+2*rad_guess]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L262_C4", "label": "if", "type": "if", "loc": [262, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [4, 1, 0.2295, 0.0017, 1, 0.35, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rad_fix:\n params_2.append(rad_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L263_C8", "label": "append()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L262_C4", "vector": [8, 2, 0.2299, 0.0009, 2, 0.81, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " params_2.append(rad_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "label": "if", "type": "if", "loc": [264, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [4, 1, 0.2343, 0.0079, 1, 0.35, 0.8571, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method == 'fmin':\n r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)\n opt_params_2,fopt_2 = r[0],r[1]\n elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_2,fopt_2 = r[0],r[1]\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L265_C8", "label": "r = fmin()", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "vector": [14, 2, 0.2316, 0.0009, 2, 0.74, 0.0, 436, 3, 6, 0, 0, 247, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin", "annotation": ""}, "snippet": " r = so.fmin(error_function,params_2,xtol=0.0002,ftol=0.000001,full_output=1,disp=verbose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L266_C8", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "vector": [14, 2, 0.2325, 0.0009, 2, 0.74, 0.5, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L267_C4", "label": "if", "type": "if", "loc": [267, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "vector": [4, 2, 0.2356, 0.0052, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif method == 'fmin_bfgs':\n r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)\n opt_params_2,fopt_2 = r[0],r[1]\n else:\n raise RuntimeError('unknown method: '+method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L268_C8", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [268, 269], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L267_C4", "vector": [14, 3, 0.2347, 0.0017, 3, 0.19, 0.0, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params_2, full_output=1,\n disp = verbose, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L270_C8", "label": "opt_params_2, fopt_2 =", "type": "assigned_variable", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L267_C4", "vector": [14, 3, 0.236, 0.0009, 3, 0.19, 1.0, 161, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "opt_params_2, fopt_2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opt_params_2,fopt_2 = r[0],r[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L274_C4", "label": "if", "type": "if", "loc": [274, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "vector": [4, 1, 0.2434, 0.0087, 1, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fopt_2<fopt_1:\n if rad_fix:\n return rad_guess,opt_params_2[0],opt_params_2[1]\n else:\n return opt_params_2[2],opt_params_2[0],opt_params_2[1]\n else:\n if rad_fix:\n return rad_guess,opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L275_C8", "label": "if", "type": "if", "loc": [275, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L274_C4", "vector": [4, 2, 0.2417, 0.0035, 2, 0.61, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad_fix:\n return rad_guess,opt_params_2[0],opt_params_2[1]\n else:\n return opt_params_2[2],opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L276_C12", "label": "return", "type": "return", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L275_C8", "vector": [13, 3, 0.2413, 0.0009, 3, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rad_guess,opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L278_C12", "label": "return", "type": "return", "loc": [278, 278], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L275_C8", "vector": [13, 3, 0.243, 0.0009, 3, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_2[2],opt_params_2[0],opt_params_2[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L280_C8", "label": "if", "type": "if", "loc": [280, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L274_C4", "vector": [4, 2, 0.2461, 0.0035, 2, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad_fix:\n return rad_guess,opt_params_1[0],opt_params_1[1]\n else:\n return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L281_C12", "label": "return", "type": "return", "loc": [281, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L280_C8", "vector": [13, 3, 0.2456, 0.0009, 3, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rad_guess,opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L283_C12", "label": "return", "type": "return", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L280_C8", "vector": [13, 3, 0.2474, 0.0009, 3, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return opt_params_1[2],opt_params_1[0],opt_params_1[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "label": "account_segway_motion", "type": "function", "loc": [292, 318], "level": 0, "parent": null, "vector": [2, 0, 0.2666, 0.0236, 0, 0.66, 0.8667, 119, 0, 3, 1, 0, 0, 0, 18], "semantic": {"name": "account_segway_motion", "arg_names": ["cart_traj", "force_traj", "st"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def account_segway_motion(cart_traj, force_traj, st):\n ct = CartesianTajectory()\n ft = ForceTrajectory()\n for i in range(len(cart_traj.p_list)):\n x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]\n p_tl = np.matrix(cart_traj.p_list[i]).T\n p_ts = smc.tsTtl(p_tl, x, y, a)\n p = p_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L293_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "vector": [14, 1, 0.2561, 0.0009, 1, 0.41, 0.0, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L294_C4", "label": "ft = ForceTrajectory()", "type": "assigned_variable", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "vector": [14, 1, 0.257, 0.0009, 1, 0.41, 0.2, 505, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "ft", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " ft = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "label": "for i", "type": "for", "loc": [295, 314], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "vector": [6, 1, 0.2662, 0.0175, 1, 0.41, 0.4, 826, 3, 0, 0, 0, 0, 0, 14], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(cart_traj.p_list)):\n x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]\n p_tl = np.matrix(cart_traj.p_list[i]).T\n p_ts = smc.tsTtl(p_tl, x, y, a)\n p = p_ts\n ct.p_list.append(p.A1.tolist())\n\n # transform forces to the world frame."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L296_C8", "label": "x, y, a =", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2587, 0.0009, 2, 0.84, 0.0, 465, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y, a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x,y,a = st.x_list[i], st.y_list[i], st.a_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L297_C8", "label": "p_tl =", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2596, 0.0009, 2, 0.84, 0.1111, 653, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_tl = np.matrix(cart_traj.p_list[i]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L298_C8", "label": "p_ts = tsTtl()", "type": "assigned_variable", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2605, 0.0009, 2, 0.84, 0.2222, 583, 3, 4, 0, 0, 370, 10, 1], "semantic": {"name": "p_ts", "arg_names": [], "import_names": [], "rhs_call_name": "tsTtl", "annotation": ""}, "snippet": " p_ts = smc.tsTtl(p_tl, x, y, a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L299_C8", "label": "p =", "type": "assigned_variable", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2614, 0.0009, 2, 0.84, 0.3333, 491, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = p_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L300_C8", "label": "append()", "type": "expression", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [8, 2, 0.2622, 0.0009, 2, 0.84, 0.4444, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.p_list.append(p.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L303_C8", "label": "f_tl =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2649, 0.0009, 2, 0.84, 0.5556, 410, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_tl = np.matrix(force_traj.f_list[i]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L304_C8", "label": "f_ts = tsRtl()", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2657, 0.0009, 2, 0.84, 0.6667, 911, 3, 2, 0, 0, 437, 10, 1], "semantic": {"name": "f_ts", "arg_names": [], "import_names": [], "rhs_call_name": "tsRtl", "annotation": ""}, "snippet": " f_ts = smc.tsRtl(f_tl, a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L305_C8", "label": "f =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [14, 2, 0.2666, 0.0009, 2, 0.84, 0.7778, 899, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L306_C8", "label": "append()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [8, 2, 0.2675, 0.0009, 2, 0.84, 0.8889, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ft.f_list.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "label": "if", "type": "if", "loc": [311, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "vector": [4, 2, 0.2732, 0.0035, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cart_traj.v_list != []:\n v_tl = np.matrix(cart_traj.v_list[i]).T\n v_ts = smc.tsRtl(v_tl, a)\n ct.v_list.append(v_ts.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L312_C12", "label": "v_tl =", "type": "assigned_variable", "loc": [312, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "vector": [14, 3, 0.2727, 0.0009, 3, 0.33, 0.0, 836, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "v_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v_tl = np.matrix(cart_traj.v_list[i]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L313_C12", "label": "v_ts = tsRtl()", "type": "assigned_variable", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "vector": [14, 3, 0.2736, 0.0009, 3, 0.33, 0.5, 95, 3, 2, 0, 0, 437, 10, 1], "semantic": {"name": "v_ts", "arg_names": [], "import_names": [], "rhs_call_name": "tsRtl", "annotation": ""}, "snippet": " v_ts = smc.tsRtl(v_tl, a)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L314_C12", "label": "append()", "type": "expression", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "vector": [8, 3, 0.2745, 0.0009, 3, 0.33, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.v_list.append(v_ts.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L316_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [316, 316], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "vector": [14, 1, 0.2762, 0.0009, 1, 0.41, 0.6, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(cart_traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L317_C4", "label": "ft.time_list = copy()", "type": "assigned_variable", "loc": [317, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "vector": [14, 1, 0.2771, 0.0009, 1, 0.41, 0.8, 603, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ft.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ft.time_list = copy.copy(force_traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L318_C4", "label": "return", "type": "return", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "vector": [13, 1, 0.278, 0.0009, 1, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct, ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "label": "account_zenithering", "type": "function", "loc": [323, 339], "level": 0, "parent": null, "vector": [2, 0, 0.2893, 0.0149, 0, 0.66, 0.9, 583, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "account_zenithering", "arg_names": ["cart_traj", "z_l"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def account_zenithering(cart_traj, z_l):\n ct = CartesianTajectory()\n h_start = z_l[0]\n for i in range(len(cart_traj.p_list)):\n h = z_l[i]\n p = cart_traj.p_list[i]\n p[2] += h - h_start\n ct.p_list.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L324_C4", "label": "ct = CartesianTajectory()", "type": "assigned_variable", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "vector": [14, 1, 0.2832, 0.0009, 1, 0.85, 0.0, 147, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L325_C4", "label": "h_start =", "type": "assigned_variable", "loc": [325, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "vector": [14, 1, 0.2841, 0.0009, 1, 0.85, 0.25, 804, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_start = z_l[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "label": "for i", "type": "for", "loc": [326, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "vector": [6, 1, 0.2893, 0.0096, 1, 0.85, 0.5, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(cart_traj.p_list)):\n h = z_l[i]\n p = cart_traj.p_list[i]\n p[2] += h - h_start\n ct.p_list.append(p)\n\n # this is incorrect. I also need to use the velocity of the\n # zenither. Unclear whether this is useful right now, so not"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L327_C8", "label": "h =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "vector": [14, 2, 0.2858, 0.0009, 2, 0.26, 0.0, 686, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h = z_l[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L328_C8", "label": "p =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "vector": [14, 2, 0.2867, 0.0009, 2, 0.26, 0.3333, 491, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = cart_traj.p_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L330_C8", "label": "append()", "type": "expression", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "vector": [8, 2, 0.2885, 0.0009, 2, 0.26, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.p_list.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L335_C8", "label": "if", "type": "if", "loc": [335, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "vector": [4, 2, 0.2933, 0.0017, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cart_traj.v_list != []:\n ct.v_list.append(cart_traj.v_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L336_C12", "label": "append()", "type": "expression", "loc": [336, 336], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L335_C8", "vector": [8, 3, 0.2937, 0.0009, 3, 0.88, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ct.v_list.append(cart_traj.v_list[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L338_C4", "label": "ct.time_list = copy()", "type": "assigned_variable", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "vector": [14, 1, 0.2955, 0.0009, 1, 0.85, 0.75, 654, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ct.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ct.time_list = copy.copy(cart_traj.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L339_C4", "label": "return", "type": "return", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "vector": [13, 1, 0.2963, 0.0009, 1, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "label": "filter_cartesian_trajectory", "type": "function", "loc": [345, 361], "level": 0, "parent": null, "vector": [2, 0, 0.3086, 0.0149, 0, 0.66, 0.9333, 996, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "filter_cartesian_trajectory", "arg_names": ["ct"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filter_cartesian_trajectory(ct):\n pts_list = ct.p_list\n ee_start_pos = pts_list[0]\n l = [pts_list[0]]\n\n for i, p in enumerate(pts_list[1:]):\n l.append(p)\n pts_2d = (np.matrix(l).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L346_C4", "label": "pts_list =", "type": "assigned_variable", "loc": [346, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "vector": [14, 1, 0.3024, 0.0009, 1, 0.85, 0.0, 713, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = ct.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L347_C4", "label": "ee_start_pos =", "type": "assigned_variable", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "vector": [14, 1, 0.3033, 0.0009, 1, 0.85, 0.2, 996, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ee_start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_start_pos = pts_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L348_C4", "label": "l =", "type": "assigned_variable", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "vector": [14, 1, 0.3042, 0.0009, 1, 0.85, 0.4, 810, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = [pts_list[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "label": "for i, p", "type": "for", "loc": [350, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "vector": [6, 1, 0.3094, 0.0079, 1, 0.85, 0.6, 816, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, p in enumerate(pts_list[1:]):\n l.append(p)\n pts_2d = (np.matrix(l).T)[0:2,:]\n st_pt = pts_2d[:,0]\n end_pt = pts_2d[:,-1]\n dist_moved = np.linalg.norm(st_pt-end_pt)\n #if dist_moved < 0.1:\n if dist_moved < 0.03:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L351_C8", "label": "append()", "type": "expression", "loc": [351, 351], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "vector": [8, 2, 0.3068, 0.0009, 2, 0.64, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " l.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L352_C8", "label": "pts_2d =", "type": "assigned_variable", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "vector": [14, 2, 0.3077, 0.0009, 2, 0.64, 0.2, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(l).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L353_C8", "label": "st_pt =", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "vector": [14, 2, 0.3086, 0.0009, 2, 0.64, 0.4, 515, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st_pt = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L354_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "vector": [14, 2, 0.3094, 0.0009, 2, 0.64, 0.6, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L355_C8", "label": "dist_moved = norm()", "type": "assigned_variable", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "vector": [14, 2, 0.3103, 0.0009, 2, 0.64, 0.8, 696, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist_moved = np.linalg.norm(st_pt-end_pt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L357_C8", "label": "if", "type": "if", "loc": [357, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "vector": [4, 2, 0.3125, 0.0017, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dist_moved < 0.03:\n reject_idx = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L358_C12", "label": "reject_idx =", "type": "assigned_variable", "loc": [358, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L357_C8", "vector": [14, 3, 0.3129, 0.0009, 3, 0.96, 0.0, 647, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "reject_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " reject_idx = i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L360_C4", "label": "pts_2d =", "type": "assigned_variable", "loc": [360, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "vector": [14, 1, 0.3147, 0.0009, 1, 0.85, 0.8, 945, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = pts_2d[:,reject_idx:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L361_C4", "label": "return", "type": "return", "loc": [361, 361], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "vector": [13, 1, 0.3156, 0.0009, 1, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pts_2d, reject_idx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "label": "filter_trajectory_force", "type": "function", "loc": [368, 402], "level": 0, "parent": null, "vector": [2, 0, 0.3365, 0.0306, 0, 0.66, 0.9667, 811, 0, 2, 1, 0, 0, 0, 20], "semantic": {"name": "filter_trajectory_force", "arg_names": ["ct", "ft"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def filter_trajectory_force(ct, ft):\n vel_list = copy.copy(ct.v_list)\n pts_list = copy.copy(ct.p_list)\n time_list = copy.copy(ct.time_list)\n ft_list = copy.copy(ft.f_list)\n f_mag_list = ut.norm(np.matrix(ft.f_list).T).A1.tolist()\n\n if len(pts_list) != len(f_mag_list):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L369_C4", "label": "vel_list = copy()", "type": "assigned_variable", "loc": [369, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3226, 0.0009, 1, 0.23, 0.0, 169, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "vel_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " vel_list = copy.copy(ct.v_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L370_C4", "label": "pts_list = copy()", "type": "assigned_variable", "loc": [370, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3234, 0.0009, 1, 0.23, 0.0588, 713, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " pts_list = copy.copy(ct.p_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L371_C4", "label": "time_list = copy()", "type": "assigned_variable", "loc": [371, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3243, 0.0009, 1, 0.23, 0.1176, 941, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " time_list = copy.copy(ct.time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L372_C4", "label": "ft_list = copy()", "type": "assigned_variable", "loc": [372, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3252, 0.0009, 1, 0.23, 0.1765, 147, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ft_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ft_list = copy.copy(ft.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L373_C4", "label": "f_mag_list = tolist()", "type": "assigned_variable", "loc": [373, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.326, 0.0009, 1, 0.23, 0.2353, 231, 3, 0, 0, 0, 185, 10, 3], "semantic": {"name": "f_mag_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " f_mag_list = ut.norm(np.matrix(ft.f_list).T).A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "label": "if", "type": "if", "loc": [375, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [4, 1, 0.3291, 0.0035, 1, 0.23, 0.2941, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pts_list) != len(f_mag_list):\n print('arm_trajectories.filter_trajectory_force: force and end effector lists are not of the same length.')\n print('Exiting ...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L376_C8", "label": "print()", "type": "expression", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "vector": [8, 2, 0.3287, 0.0009, 2, 0.95, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('arm_trajectories.filter_trajectory_force: force and end effector lists are not of the same length.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L377_C8", "label": "print()", "type": "expression", "loc": [377, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "vector": [8, 2, 0.3295, 0.0009, 2, 0.95, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Exiting ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L378_C8", "label": "exit()", "type": "expression", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "vector": [8, 2, 0.3304, 0.0009, 2, 0.95, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L380_C4", "label": "n_pts = len()", "type": "assigned_variable", "loc": [380, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3322, 0.0009, 1, 0.23, 0.3529, 156, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "n_pts", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " n_pts = len(pts_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L381_C4", "label": "i =", "type": "assigned_variable", "loc": [381, 381], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.333, 0.0009, 1, 0.23, 0.4118, 826, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = n_pts - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L382_C4", "label": "hook_slip_off_threshold =", "type": "assigned_variable", "loc": [382, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3339, 0.0009, 1, 0.23, 0.4706, 849, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "hook_slip_off_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_slip_off_threshold = 1.5 # from compliant_trajectories.py"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:While_L383_C4", "label": "while", "type": "while", "loc": [383, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [5, 1, 0.3387, 0.0087, 1, 0.23, 0.5294, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while i > 0:\n if f_mag_list[i] < hook_slip_off_threshold:\n pts_list.pop()\n time_list.pop()\n ft_list.pop()\n if vel_list != []:\n vel_list.pop()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "label": "if", "type": "if", "loc": [384, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:While_L383_C4", "vector": [4, 2, 0.3387, 0.007, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f_mag_list[i] < hook_slip_off_threshold:\n pts_list.pop()\n time_list.pop()\n ft_list.pop()\n if vel_list != []:\n vel_list.pop()\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L385_C12", "label": "pop()", "type": "expression", "loc": [385, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "vector": [8, 3, 0.3365, 0.0009, 3, 0.77, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " pts_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L386_C12", "label": "pop()", "type": "expression", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "vector": [8, 3, 0.3374, 0.0009, 3, 0.77, 0.3333, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " time_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L387_C12", "label": "pop()", "type": "expression", "loc": [387, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "vector": [8, 3, 0.3383, 0.0009, 3, 0.77, 0.6667, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " ft_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L388_C12", "label": "if", "type": "if", "loc": [388, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "vector": [4, 3, 0.3396, 0.0017, 3, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vel_list != []:\n vel_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L389_C16", "label": "pop()", "type": "expression", "loc": [389, 389], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L388_C12", "vector": [8, 4, 0.34, 0.0009, 4, 0.37, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " vel_list.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L394_C4", "label": "ct2 = CartesianTajectory()", "type": "assigned_variable", "loc": [394, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3444, 0.0009, 1, 0.23, 0.5882, 18, 3, 0, 0, 0, 610, 10, 1], "semantic": {"name": "ct2", "arg_names": [], "import_names": [], "rhs_call_name": "CartesianTajectory", "annotation": ""}, "snippet": " ct2 = CartesianTajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L395_C4", "label": "ct2.time_list =", "type": "assigned_variable", "loc": [395, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3453, 0.0009, 1, 0.23, 0.6471, 289, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct2.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct2.time_list = time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L396_C4", "label": "ct2.p_list =", "type": "assigned_variable", "loc": [396, 396], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3462, 0.0009, 1, 0.23, 0.7059, 109, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct2.p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct2.p_list = pts_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L397_C4", "label": "ct2.v_list =", "type": "assigned_variable", "loc": [397, 397], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.347, 0.0009, 1, 0.23, 0.7647, 722, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ct2.v_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ct2.v_list = vel_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L399_C4", "label": "ft2 = ForceTrajectory()", "type": "assigned_variable", "loc": [399, 399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3488, 0.0009, 1, 0.23, 0.8235, 396, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "ft2", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " ft2 = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L400_C4", "label": "ft2.time_list = copy()", "type": "assigned_variable", "loc": [400, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3497, 0.0009, 1, 0.23, 0.8824, 846, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "ft2.time_list", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " ft2.time_list = copy.copy(time_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L401_C4", "label": "ft2.f_list =", "type": "assigned_variable", "loc": [401, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [14, 1, 0.3505, 0.0009, 1, 0.23, 0.9412, 681, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft2.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft2.f_list = ft_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L402_C4", "label": "return", "type": "return", "loc": [402, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "vector": [13, 1, 0.3514, 0.0009, 1, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ct2, ft2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "label": "if", "type": "if", "loc": [405, 868], "level": 0, "parent": null, "vector": [4, 0, 0.5564, 0.4056, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 99], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import matplotlib_util.util as mpu\n\n p = optparse.OptionParser()\n p.add_option('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')\n p.add_option('--xy', action='store_true', dest='xy',\n help='plot the x and y coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L406_C4", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [406, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [1, 1, 0.3549, 0.0009, 1, 0.86, 0.0, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": " import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L408_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [408, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3566, 0.0009, 1, 0.86, 0.0189, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = optparse.OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L409_C4", "label": "add_option()", "type": "expression", "loc": [409, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.358, 0.0017, 1, 0.86, 0.0377, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L411_C4", "label": "add_option()", "type": "expression", "loc": [411, 412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3597, 0.0017, 1, 0.86, 0.0566, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--xy', action='store_true', dest='xy',\n help='plot the x and y coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L413_C4", "label": "add_option()", "type": "expression", "loc": [413, 414], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3615, 0.0017, 1, 0.86, 0.0755, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--yz', action='store_true', dest='yz',\n help='plot the y and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L415_C4", "label": "add_option()", "type": "expression", "loc": [415, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3632, 0.0017, 1, 0.86, 0.0943, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--xz', action='store_true', dest='xz',\n help='plot the x and z coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L417_C4", "label": "add_option()", "type": "expression", "loc": [417, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3649, 0.0017, 1, 0.86, 0.1132, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--plot_ellipses', action='store_true', dest='plot_ellipses',\n help='plot the stiffness ellipse in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L419_C4", "label": "add_option()", "type": "expression", "loc": [419, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3667, 0.0017, 1, 0.86, 0.1321, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--pfc', action='store_true', dest='pfc',\n help='plot the radial and tangential components of the force.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L421_C4", "label": "add_option()", "type": "expression", "loc": [421, 422], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3684, 0.0017, 1, 0.86, 0.1509, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--pff', action='store_true', dest='pff',\n help='plot the force field corresponding to a stiffness ellipse.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L423_C4", "label": "add_option()", "type": "expression", "loc": [423, 424], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3702, 0.0017, 1, 0.86, 0.1698, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--pev', action='store_true', dest='pev',\n help='plot the stiffness ellipses for different combinations of the rel stiffnesses.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L425_C4", "label": "add_option()", "type": "expression", "loc": [425, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3719, 0.0017, 1, 0.86, 0.1887, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--plot_forces', action='store_true', dest='plot_forces',\n help='plot the force in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L427_C4", "label": "add_option()", "type": "expression", "loc": [427, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3737, 0.0017, 1, 0.86, 0.2075, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--plot_forces_error', action='store_true', dest='plot_forces_error',\n help='plot the error between the computed and measured (ATI) forces in the x-y plane')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L429_C4", "label": "add_option()", "type": "expression", "loc": [429, 430], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3754, 0.0017, 1, 0.86, 0.2264, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--xyz', action='store_true', dest='xyz',\n help='plot in 3d the coordinates of the end effector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L431_C4", "label": "add_option()", "type": "expression", "loc": [431, 432], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3772, 0.0017, 1, 0.86, 0.2453, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-r', action='store', type='float', dest='rad',\n help='radius of the joint.', default=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L433_C4", "label": "add_option()", "type": "expression", "loc": [433, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3789, 0.0017, 1, 0.86, 0.2642, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--noshow', action='store_true', dest='noshow',\n help='do not display the figure (use while saving figures to disk)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L435_C4", "label": "add_option()", "type": "expression", "loc": [435, 436], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3807, 0.0017, 1, 0.86, 0.283, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--exptplot', action='store_true', dest='exptplot',\n help='put all the graphs of an experiment as subplots.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L437_C4", "label": "add_option()", "type": "expression", "loc": [437, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3824, 0.0017, 1, 0.86, 0.3019, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--sturm', action='store_true', dest='sturm',\n help='make log files to send to sturm')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L439_C4", "label": "add_option()", "type": "expression", "loc": [439, 441], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [8, 1, 0.3846, 0.0026, 1, 0.86, 0.3208, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--icra_presentation_plot', action='store_true',\n dest='icra_presentation_plot',\n help='plot explaining CEP update.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L443_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [443, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3872, 0.0009, 1, 0.86, 0.3396, 852, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opt, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L444_C4", "label": "fname =", "type": "assigned_variable", "loc": [444, 444], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3881, 0.0009, 1, 0.86, 0.3585, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = opt.fname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L445_C4", "label": "xy_flag =", "type": "assigned_variable", "loc": [445, 445], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.389, 0.0009, 1, 0.86, 0.3774, 813, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xy_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xy_flag = opt.xy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L446_C4", "label": "yz_flag =", "type": "assigned_variable", "loc": [446, 446], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3899, 0.0009, 1, 0.86, 0.3962, 102, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "yz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yz_flag = opt.yz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L447_C4", "label": "xz_flag =", "type": "assigned_variable", "loc": [447, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3907, 0.0009, 1, 0.86, 0.4151, 208, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xz_flag = opt.xz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L448_C4", "label": "plot_forces_flag =", "type": "assigned_variable", "loc": [448, 448], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3916, 0.0009, 1, 0.86, 0.434, 38, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_forces_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_forces_flag = opt.plot_forces"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L449_C4", "label": "plot_ellipses_flag =", "type": "assigned_variable", "loc": [449, 449], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3925, 0.0009, 1, 0.86, 0.4528, 873, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_ellipses_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_ellipses_flag = opt.plot_ellipses"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L450_C4", "label": "plot_forces_error_flag =", "type": "assigned_variable", "loc": [450, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3934, 0.0009, 1, 0.86, 0.4717, 344, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_forces_error_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_forces_error_flag = opt.plot_forces_error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L451_C4", "label": "plot_force_components_flag =", "type": "assigned_variable", "loc": [451, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3942, 0.0009, 1, 0.86, 0.4906, 77, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_force_components_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_force_components_flag = opt.pfc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L452_C4", "label": "plot_force_field_flag =", "type": "assigned_variable", "loc": [452, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3951, 0.0009, 1, 0.86, 0.5094, 364, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_force_field_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_force_field_flag = opt.pff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L453_C4", "label": "xyz_flag =", "type": "assigned_variable", "loc": [453, 453], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.396, 0.0009, 1, 0.86, 0.5283, 737, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "xyz_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xyz_flag = opt.xyz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L454_C4", "label": "rad =", "type": "assigned_variable", "loc": [454, 454], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3969, 0.0009, 1, 0.86, 0.5472, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = opt.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L455_C4", "label": "show_fig =", "type": "assigned_variable", "loc": [455, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3977, 0.0009, 1, 0.86, 0.566, 616, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "show_fig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_fig = not(opt.noshow)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L456_C4", "label": "plot_ellipses_vary_flag =", "type": "assigned_variable", "loc": [456, 456], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3986, 0.0009, 1, 0.86, 0.5849, 316, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "plot_ellipses_vary_flag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " plot_ellipses_vary_flag = opt.pev"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L457_C4", "label": "expt_plot =", "type": "assigned_variable", "loc": [457, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.3995, 0.0009, 1, 0.86, 0.6038, 687, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "expt_plot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expt_plot = opt.exptplot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L458_C4", "label": "sturm_output =", "type": "assigned_variable", "loc": [458, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4003, 0.0009, 1, 0.86, 0.6226, 219, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sturm_output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sturm_output = opt.sturm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "label": "if", "type": "if", "loc": [461, 498], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.4191, 0.0332, 1, 0.86, 0.6415, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_ellipses_vary_flag:\n show_fig=False\n i = 0\n ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search\n# ratio_list1 = [0.7,0.8,0.9,1.0]\n# ratio_list2 = [0.7,0.8,0.9,1.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L462_C8", "label": "show_fig =", "type": "assigned_variable", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4038, 0.0009, 2, 0.81, 0.0, 616, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "show_fig", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " show_fig=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L463_C8", "label": "i =", "type": "assigned_variable", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4047, 0.0009, 2, 0.81, 0.0769, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L464_C8", "label": "ratio_list1 =", "type": "assigned_variable", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4056, 0.0009, 2, 0.81, 0.1538, 316, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list1 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L465_C8", "label": "ratio_list2 =", "type": "assigned_variable", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4065, 0.0009, 2, 0.81, 0.2308, 320, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list2 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L466_C8", "label": "ratio_list3 =", "type": "assigned_variable", "loc": [466, 466], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4073, 0.0009, 2, 0.81, 0.3077, 19, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ratio_list3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ratio_list3 = [0.1,0.3,0.5,0.7,0.9] # coarse search"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L474_C8", "label": "inv_mean_list, std_list =", "type": "assigned_variable", "loc": [474, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4143, 0.0009, 2, 0.81, 0.3846, 618, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "inv_mean_list, std_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inv_mean_list,std_list = [],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L475_C8", "label": "x_l, y_l, z_l =", "type": "assigned_variable", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4152, 0.0009, 2, 0.81, 0.4615, 876, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x_l, y_l, z_l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_l,y_l,z_l = [],[],[]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L476_C8", "label": "s0 =", "type": "assigned_variable", "loc": [476, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [14, 2, 0.4161, 0.0009, 2, 0.81, 0.5385, 660, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "s0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s0 = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L478_C8", "label": "for s1", "type": "for", "loc": [478, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [6, 2, 0.4231, 0.0114, 2, 0.81, 0.6154, 745, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s1 in ratio_list1:\n for s2 in ratio_list2:\n for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L479_C12", "label": "for s2", "type": "for", "loc": [479, 490], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L478_C8", "vector": [6, 3, 0.4235, 0.0105, 3, 0.45, 0.0, 448, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s2 in ratio_list2:\n for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)\n inv_mean_list.append(1./m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "label": "for s3", "type": "for", "loc": [480, 490], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L479_C12", "vector": [6, 4, 0.424, 0.0096, 4, 0.62, 0.0, 626, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "s3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s3 in ratio_list3:\n i += 1\n s_list = [s0,s1,s2,s3,0.8]\n #s_list = [s1,s2,s3,s0,0.8]\n print('################## s_list:', s_list)\n m,s = plot_stiff_ellipse_map(s_list,i)\n inv_mean_list.append(1./m)\n std_list.append(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L482_C20", "label": "s_list =", "type": "assigned_variable", "loc": [482, 482], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [14, 5, 0.4213, 0.0009, 5, 0.09, 0.0, 363, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "s_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " s_list = [s0,s1,s2,s3,0.8]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L484_C20", "label": "print()", "type": "expression", "loc": [484, 484], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [8, 5, 0.4231, 0.0009, 5, 0.09, 0.1429, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('################## s_list:', s_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L485_C20", "label": "m, s = plot_stiff_ellipse_map()", "type": "assigned_variable", "loc": [485, 485], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [14, 5, 0.424, 0.0009, 5, 0.09, 0.2857, 483, 3, 2, 0, 0, 503, 10, 1], "semantic": {"name": "m, s", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipse_map", "annotation": ""}, "snippet": " m,s = plot_stiff_ellipse_map(s_list,i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L486_C20", "label": "append()", "type": "expression", "loc": [486, 486], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [8, 5, 0.4248, 0.0009, 5, 0.09, 0.4286, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " inv_mean_list.append(1./m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L487_C20", "label": "append()", "type": "expression", "loc": [487, 487], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [8, 5, 0.4257, 0.0009, 5, 0.09, 0.5714, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " std_list.append(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L488_C20", "label": "append()", "type": "expression", "loc": [488, 488], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [8, 5, 0.4266, 0.0009, 5, 0.09, 0.7143, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " x_l.append(s1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L489_C20", "label": "append()", "type": "expression", "loc": [489, 489], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [8, 5, 0.4274, 0.0009, 5, 0.09, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " y_l.append(s2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L490_C20", "label": "append()", "type": "expression", "loc": [490, 490], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "vector": [8, 5, 0.4283, 0.0009, 5, 0.09, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " z_l.append(s3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L492_C8", "label": "save_pickle()", "type": "expression", "loc": [492, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [8, 2, 0.4305, 0.0017, 2, 0.81, 0.6923, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle({'x_l':x_l,'y_l':y_l,'z_l':z_l,'inv_mean_list':inv_mean_list,'std_list':std_list},\n 'stiff_dict_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L494_C8", "label": "plot_points()", "type": "expression", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [8, 2, 0.4318, 0.0009, 2, 0.81, 0.7692, 111, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "plot_points", "arg_names": [], "import_names": [], "rhs_call_name": "plot_points", "annotation": ""}, "snippet": " d3m.plot_points(np.matrix([x_l,y_l,z_l]),scalar_list=inv_mean_list,mode='sphere')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L495_C8", "label": "axes()", "type": "expression", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [8, 2, 0.4327, 0.0009, 2, 0.81, 0.8462, 590, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "axes", "annotation": ""}, "snippet": " mlab.axes()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L496_C8", "label": "show()", "type": "expression", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [8, 2, 0.4336, 0.0009, 2, 0.81, 0.9231, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " d3m.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L498_C8", "label": "exit()", "type": "expression", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "vector": [8, 2, 0.4353, 0.0009, 2, 0.81, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "label": "if", "type": "if", "loc": [500, 503], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.4384, 0.0035, 1, 0.86, 0.6604, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname=='':\n print('please specify a pkl file (-f option)')\n print('Exiting...')\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L501_C8", "label": "print()", "type": "expression", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "vector": [8, 2, 0.4379, 0.0009, 2, 0.45, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('please specify a pkl file (-f option)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L502_C8", "label": "print()", "type": "expression", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "vector": [8, 2, 0.4388, 0.0009, 2, 0.45, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Exiting...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L503_C8", "label": "exit()", "type": "expression", "loc": [503, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "vector": [8, 2, 0.4397, 0.0009, 2, 0.45, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L505_C4", "label": "d = load_pickle()", "type": "assigned_variable", "loc": [505, 505], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4414, 0.0009, 1, 0.86, 0.6792, 355, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " d = ut.load_pickle(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L506_C4", "label": "actual_cartesian_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [506, 506], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4423, 0.0009, 1, 0.86, 0.6981, 396, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "actual_cartesian_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " actual_cartesian_tl = joint_to_cartesian(d['actual'], d['arm'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L507_C4", "label": "actual_cartesian, _ = account_segway_motion()", "type": "assigned_variable", "loc": [507, 507], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4432, 0.0009, 1, 0.86, 0.717, 144, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "actual_cartesian, _", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " actual_cartesian, _ = account_segway_motion(actual_cartesian_tl,d['force'], d['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L508_C4", "label": "if", "type": "if", "loc": [508, 510], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.4449, 0.0026, 1, 0.86, 0.7358, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('zenither_list'):\n actual_cartesian = account_zenithering(actual_cartesian,\n d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L509_C8", "label": "actual_cartesian = account_zenithering()", "type": "assigned_variable", "loc": [509, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L508_C4", "vector": [14, 2, 0.4454, 0.0017, 2, 0.93, 0.0, 824, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "actual_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "account_zenithering", "annotation": ""}, "snippet": " actual_cartesian = account_zenithering(actual_cartesian,\n d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L512_C4", "label": "eq_cartesian_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [512, 512], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4476, 0.0009, 1, 0.86, 0.7547, 715, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "eq_cartesian_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " eq_cartesian_tl = joint_to_cartesian(d['eq_pt'], d['arm'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L513_C4", "label": "eq_cartesian, _ = account_segway_motion()", "type": "assigned_variable", "loc": [513, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4484, 0.0009, 1, 0.86, 0.7736, 697, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "eq_cartesian, _", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " eq_cartesian, _ = account_segway_motion(eq_cartesian_tl, d['force'], d['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L514_C4", "label": "if", "type": "if", "loc": [514, 515], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.4497, 0.0017, 1, 0.86, 0.7925, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('zenither_list'):\n eq_cartesian = account_zenithering(eq_cartesian, d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L515_C8", "label": "eq_cartesian = account_zenithering()", "type": "assigned_variable", "loc": [515, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L514_C4", "vector": [14, 2, 0.4502, 0.0009, 2, 0.0, 0.0, 883, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "eq_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "account_zenithering", "annotation": ""}, "snippet": " eq_cartesian = account_zenithering(eq_cartesian, d['zenither_list'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L517_C4", "label": "cartesian_force_clean, _ = filter_trajectory_force()", "type": "assigned_variable", "loc": [517, 518], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4524, 0.0017, 1, 0.86, 0.8113, 298, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "cartesian_force_clean, _", "arg_names": [], "import_names": [], "rhs_call_name": "filter_trajectory_force", "annotation": ""}, "snippet": " cartesian_force_clean, _ = filter_trajectory_force(actual_cartesian,\n d['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L519_C4", "label": "pts_2d, reject_idx = filter_cartesian_trajectory()", "type": "assigned_variable", "loc": [519, 519], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.4537, 0.0009, 1, 0.86, 0.8302, 285, 3, 1, 0, 0, 996, 10, 1], "semantic": {"name": "pts_2d, reject_idx", "arg_names": [], "import_names": [], "rhs_call_name": "filter_cartesian_trajectory", "annotation": ""}, "snippet": " pts_2d, reject_idx = filter_cartesian_trajectory(cartesian_force_clean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "label": "if", "type": "if", "loc": [521, 559], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.472, 0.0341, 1, 0.86, 0.8491, 0, 0, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rad != None:\n #rad = 0.39 # lab cabinet recessed.\n #rad = 0.42 # kitchen cabinet\n #rad = 0.80 # lab glass door\n pts_list = actual_cartesian.p_list\n eq_pts_list = eq_cartesian.p_list\n ee_start_pos = pts_list[0]\n x_guess = ee_start_pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L525_C8", "label": "pts_list =", "type": "assigned_variable", "loc": [525, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4589, 0.0009, 2, 0.07, 0.0, 713, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L526_C8", "label": "eq_pts_list =", "type": "assigned_variable", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4598, 0.0009, 2, 0.07, 0.0714, 441, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "eq_pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " eq_pts_list = eq_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L527_C8", "label": "ee_start_pos =", "type": "assigned_variable", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4607, 0.0009, 2, 0.07, 0.1429, 996, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ee_start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ee_start_pos = pts_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L528_C8", "label": "x_guess =", "type": "assigned_variable", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4615, 0.0009, 2, 0.07, 0.2143, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = ee_start_pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L529_C8", "label": "y_guess =", "type": "assigned_variable", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4624, 0.0009, 2, 0.07, 0.2857, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = ee_start_pos[1] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L530_C8", "label": "print()", "type": "expression", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [8, 2, 0.4633, 0.0009, 2, 0.07, 0.3571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('before call to fit_rotary_joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L531_C8", "label": "force_list =", "type": "assigned_variable", "loc": [531, 531], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4642, 0.0009, 2, 0.07, 0.4286, 906, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_list = d['force'].f_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "label": "if", "type": "if", "loc": [533, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [4, 2, 0.472, 0.0131, 2, 0.07, 0.5, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sturm_output:\n str_parts = fname.split('.')\n sturm_file_name = str_parts[0]+'_sturm.log'\n print('Sturm file name:', sturm_file_name)\n sturm_file = open(sturm_file_name,'w')\n sturm_pts = cartesian_force_clean.p_list\n print('len(sturm_pts):', len(sturm_pts))\n print('len(pts_list):', len(pts_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L534_C12", "label": "str_parts = split()", "type": "assigned_variable", "loc": [534, 534], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [14, 3, 0.4668, 0.0009, 3, 0.87, 0.0, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L535_C12", "label": "sturm_file_name =", "type": "assigned_variable", "loc": [535, 535], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [14, 3, 0.4677, 0.0009, 3, 0.87, 0.1111, 200, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sturm_file_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sturm_file_name = str_parts[0]+'_sturm.log'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L536_C12", "label": "print()", "type": "expression", "loc": [536, 536], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [8, 3, 0.4685, 0.0009, 3, 0.87, 0.2222, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Sturm file name:', sturm_file_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L537_C12", "label": "sturm_file = open()", "type": "assigned_variable", "loc": [537, 537], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [14, 3, 0.4694, 0.0009, 3, 0.87, 0.3333, 666, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "sturm_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " sturm_file = open(sturm_file_name,'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L538_C12", "label": "sturm_pts =", "type": "assigned_variable", "loc": [538, 538], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [14, 3, 0.4703, 0.0009, 3, 0.87, 0.4444, 526, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sturm_pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sturm_pts = cartesian_force_clean.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L539_C12", "label": "print()", "type": "expression", "loc": [539, 539], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [8, 3, 0.4712, 0.0009, 3, 0.87, 0.5556, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len(sturm_pts):', len(sturm_pts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L540_C12", "label": "print()", "type": "expression", "loc": [540, 540], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [8, 3, 0.472, 0.0009, 3, 0.87, 0.6667, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('len(pts_list):', len(pts_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L542_C12", "label": "for i, p", "type": "for", "loc": [542, 544], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [6, 3, 0.4747, 0.0026, 3, 0.87, 0.7778, 816, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i,p in enumerate(sturm_pts[1:]):\n sturm_file.write(\" \".join(map(str,p)))\n sturm_file.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L543_C16", "label": "write()", "type": "expression", "loc": [543, 543], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L542_C12", "vector": [8, 4, 0.4747, 0.0009, 4, 0.92, 0.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sturm_file.write(\" \".join(map(str,p)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L544_C16", "label": "write()", "type": "expression", "loc": [544, 544], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L542_C12", "vector": [8, 4, 0.4755, 0.0009, 4, 0.92, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sturm_file.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L546_C12", "label": "write()", "type": "expression", "loc": [546, 546], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [8, 3, 0.4773, 0.0009, 3, 0.87, 0.8889, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sturm_file.write('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L547_C12", "label": "close()", "type": "expression", "loc": [547, 547], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "vector": [8, 3, 0.4781, 0.0009, 3, 0.87, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " sturm_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L549_C8", "label": "rad_guess =", "type": "assigned_variable", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4799, 0.0009, 2, 0.07, 0.5714, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L550_C8", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [550, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4812, 0.0017, 2, 0.07, 0.6429, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L552_C8", "label": "print()", "type": "expression", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [8, 2, 0.4825, 0.0009, 2, 0.07, 0.7143, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('rad, cx, cy:', rad, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L553_C8", "label": "c_ts =", "type": "assigned_variable", "loc": [553, 553], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4834, 0.0009, 2, 0.07, 0.7857, 123, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_ts = np.matrix([cx, cy, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L554_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [554, 555], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4847, 0.0017, 2, 0.07, 0.8571, 662, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,\n pts_2d[0,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L556_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [556, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [14, 2, 0.4865, 0.0017, 2, 0.07, 0.9286, 919, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,-1]-cy,\n pts_2d[0,-1]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L558_C8", "label": "plot_circle()", "type": "expression", "loc": [558, 559], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "vector": [8, 2, 0.4882, 0.0017, 2, 0.07, 1.0, 365, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, rad, start_angle, end_angle,\n label='Actual\\_opt', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "label": "if", "type": "if", "loc": [562, 764], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.5795, 0.1774, 1, 0.86, 0.8679, 0, 7, 0, 0, 0, 0, 0, 77], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.icra_presentation_plot:\n mpu.set_figure_size(30,20)\n rad = 1.0\n x_guess = pts_2d[0,0]\n y_guess = pts_2d[1,0] - rad\n\n rad_guess = rad\n rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L563_C8", "label": "set_figure_size()", "type": "expression", "loc": [563, 563], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.4921, 0.0009, 2, 0.33, 0.0, 342, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_figure_size", "arg_names": [], "import_names": [], "rhs_call_name": "set_figure_size", "annotation": ""}, "snippet": " mpu.set_figure_size(30,20)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L564_C8", "label": "rad =", "type": "assigned_variable", "loc": [564, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.493, 0.0009, 2, 0.33, 0.0109, 439, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L565_C8", "label": "x_guess =", "type": "assigned_variable", "loc": [565, 565], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.4939, 0.0009, 2, 0.33, 0.0217, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = pts_2d[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L566_C8", "label": "y_guess =", "type": "assigned_variable", "loc": [566, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.4948, 0.0009, 2, 0.33, 0.0326, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = pts_2d[1,0] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L568_C8", "label": "rad_guess =", "type": "assigned_variable", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.4965, 0.0009, 2, 0.33, 0.0435, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L569_C8", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [569, 570], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.4978, 0.0017, 2, 0.33, 0.0543, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L571_C8", "label": "print()", "type": "expression", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.4991, 0.0009, 2, 0.33, 0.0652, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Estimated rad, cx, cy:', rad, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L573_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [573, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5013, 0.0017, 2, 0.33, 0.0761, 662, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,\n pts_2d[0,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L575_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [575, 576], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5031, 0.0017, 2, 0.33, 0.087, 919, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,-1]-cy,\n pts_2d[0,-1]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L578_C8", "label": "subsample_ratio =", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5052, 0.0009, 2, 0.33, 0.0978, 521, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subsample_ratio", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subsample_ratio = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L579_C8", "label": "pts_2d_s =", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5061, 0.0009, 2, 0.33, 0.1087, 476, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d_s = pts_2d[:,::subsample_ratio]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L581_C8", "label": "cep_force_clean, force_new = filter_trajectory_force()", "type": "assigned_variable", "loc": [581, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5083, 0.0017, 2, 0.33, 0.1196, 292, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "cep_force_clean, force_new", "arg_names": [], "import_names": [], "rhs_call_name": "filter_trajectory_force", "annotation": ""}, "snippet": " cep_force_clean, force_new = filter_trajectory_force(eq_cartesian,\n d['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L583_C8", "label": "cep_2d =", "type": "assigned_variable", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5096, 0.0009, 2, 0.33, 0.1304, 817, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_2d = np.matrix(cep_force_clean.p_list).T[0:2,reject_idx:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L586_C8", "label": "figure()", "type": "expression", "loc": [586, 586], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5122, 0.0009, 2, 0.33, 0.1413, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L587_C8", "label": "plot_yx()", "type": "expression", "loc": [587, 590], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5144, 0.0035, 2, 0.33, 0.1522, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts_2d_s[1,:].A1, pts_2d_s[0,:].A1, color='b',\n label = '\\huge{End Effector Trajectory}', axis = 'equal', alpha = 1.0,\n scatter_size=7, linewidth=0, marker='x',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L592_C8", "label": "cep_2d_s =", "type": "assigned_variable", "loc": [592, 592], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5175, 0.0009, 2, 0.33, 0.163, 423, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_2d_s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_2d_s = cep_2d[:,::subsample_ratio]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L593_C8", "label": "plot_yx()", "type": "expression", "loc": [593, 596], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5197, 0.0035, 2, 0.33, 0.1739, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(cep_2d_s[1,:].A1, cep_2d_s[0,:].A1, color='g',\n label = '\\huge{Equilibrium Point Trajectory}', axis = 'equal', alpha = 1.0,\n scatter_size=10, linewidth=0, marker='+',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L598_C8", "label": "plot_circle()", "type": "expression", "loc": [598, 600], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5236, 0.0026, 2, 0.33, 0.1848, 365, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, rad, start_angle, end_angle,\n label='\\huge{Estimated Kinematics}', color='r',\n alpha=0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L601_C8", "label": "plot_radii()", "type": "expression", "loc": [601, 603], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5262, 0.0026, 2, 0.33, 0.1957, 459, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_radii", "arg_names": [], "import_names": [], "rhs_call_name": "plot_radii", "annotation": ""}, "snippet": " mpu.plot_radii(cx, cy, rad, start_angle, end_angle,\n interval=end_angle-start_angle, color='r',\n alpha=0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L604_C8", "label": "legend()", "type": "expression", "loc": [604, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.528, 0.0009, 2, 0.33, 0.2065, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L605_C8", "label": "fig_name =", "type": "assigned_variable", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5288, 0.0009, 2, 0.33, 0.2174, 219, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = 'epc'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L606_C8", "label": "fig_number =", "type": "assigned_variable", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5297, 0.0009, 2, 0.33, 0.2283, 171, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "fig_number", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_number = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L607_C8", "label": "savefig()", "type": "expression", "loc": [607, 607], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5306, 0.0009, 2, 0.33, 0.2391, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L612_C8", "label": "zoom_location =", "type": "assigned_variable", "loc": [612, 612], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.535, 0.0009, 2, 0.33, 0.25, 164, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "zoom_location", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zoom_location = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L613_C8", "label": "pts_2d_zoom =", "type": "assigned_variable", "loc": [613, 613], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5358, 0.0009, 2, 0.33, 0.2609, 352, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_2d_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d_zoom = pts_2d[:,:zoom_location]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L614_C8", "label": "cep_2d_zoom =", "type": "assigned_variable", "loc": [614, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5367, 0.0009, 2, 0.33, 0.2717, 184, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_2d_zoom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_2d_zoom = cep_2d[:,:zoom_location]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L635_C8", "label": "figure()", "type": "expression", "loc": [635, 635], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5551, 0.0009, 2, 0.33, 0.2826, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L636_C8", "label": "plot_yx()", "type": "expression", "loc": [636, 639], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5573, 0.0035, 2, 0.33, 0.2935, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(pts_2d_zoom[1,:].A1, pts_2d_zoom[0,:].A1, color='b',\n label = '\\huge{End Effector Trajectory}', axis = 'equal', alpha = 1.0,\n scatter_size=7, linewidth=0, marker='x',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L640_C8", "label": "plot_yx()", "type": "expression", "loc": [640, 643], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5608, 0.0035, 2, 0.33, 0.3043, 112, 3, 10, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(cep_2d_zoom[1,:].A1, cep_2d_zoom[0,:].A1, color='g',\n label = '\\huge{Equilibrium Point Trajectory}', axis = 'equal', alpha = 1.0,\n scatter_size=10, linewidth=0, marker='+',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L644_C8", "label": "xlim()", "type": "expression", "loc": [644, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5629, 0.0009, 2, 0.33, 0.3152, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L645_C8", "label": "legend()", "type": "expression", "loc": [645, 645], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5638, 0.0009, 2, 0.33, 0.3261, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L647_C8", "label": "savefig()", "type": "expression", "loc": [647, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5656, 0.0009, 2, 0.33, 0.337, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L650_C8", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [650, 651], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5686, 0.0017, 2, 0.33, 0.3478, 693, 3, 6, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = fit_circle(1.0,x_guess,y_guess,pts_2d_zoom,\n method='fmin_bfgs',verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L652_C8", "label": "print()", "type": "expression", "loc": [652, 652], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5699, 0.0009, 2, 0.33, 0.3587, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Estimated rad, cx, cy:', rad, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L653_C8", "label": "start_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [653, 654], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5712, 0.0017, 2, 0.33, 0.3696, 662, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "start_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " start_angle = tr.angle_within_mod180(math.atan2(pts_2d[1,0]-cy,\n pts_2d[0,0]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L655_C8", "label": "end_angle = angle_within_mod180()", "type": "assigned_variable", "loc": [655, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.573, 0.0017, 2, 0.33, 0.3804, 919, 3, 1, 0, 0, 694, 10, 2], "semantic": {"name": "end_angle", "arg_names": [], "import_names": [], "rhs_call_name": "angle_within_mod180", "annotation": ""}, "snippet": " end_angle = tr.angle_within_mod180(math.atan2(pts_2d_zoom[1,-1]-cy,\n pts_2d_zoom[0,-1]-cx) - math.pi/2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L657_C8", "label": "plot_circle()", "type": "expression", "loc": [657, 659], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5752, 0.0026, 2, 0.33, 0.3913, 365, 3, 8, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, rad, start_angle, end_angle,\n label='\\huge{Estimated Kinematics}', color='r',\n alpha=0.7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L660_C8", "label": "xlim()", "type": "expression", "loc": [660, 660], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5769, 0.0009, 2, 0.33, 0.4022, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L661_C8", "label": "legend()", "type": "expression", "loc": [661, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5778, 0.0009, 2, 0.33, 0.413, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L663_C8", "label": "savefig()", "type": "expression", "loc": [663, 663], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5795, 0.0009, 2, 0.33, 0.4239, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L666_C8", "label": "current_pos =", "type": "assigned_variable", "loc": [666, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5822, 0.0009, 2, 0.33, 0.4348, 863, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "current_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_pos = pts_2d_zoom[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L667_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [667, 667], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.583, 0.0009, 2, 0.33, 0.4457, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = current_pos - np.matrix([cx,cy]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L668_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [668, 668], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5839, 0.0009, 2, 0.33, 0.4565, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec / np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L669_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [669, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5848, 0.0009, 2, 0.33, 0.4674, 367, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix([[0,-1],[1,0]]) * radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L670_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [670, 672], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5865, 0.0026, 2, 0.33, 0.4783, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n radial_vec, scale=10., width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L673_C8", "label": "rad_text_loc =", "type": "assigned_variable", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5883, 0.0009, 2, 0.33, 0.4891, 597, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_text_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_text_loc = pts_2d_zoom[:,-1] + np.matrix([0.001,0.01]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L674_C8", "label": "text()", "type": "expression", "loc": [674, 674], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5892, 0.0009, 2, 0.33, 0.5, 439, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(rad_text_loc[0,0], rad_text_loc[1,0], '$\\hat v_{rad}$', fontsize = 30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L675_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [675, 677], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5909, 0.0026, 2, 0.33, 0.5109, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n tangential_vec, scale=10., width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L679_C8", "label": "tan_text_loc =", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.5935, 0.0009, 2, 0.33, 0.5217, 444, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tan_text_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_text_loc = pts_2d_zoom[:,-1] + np.matrix([-0.012, -0.011]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L680_C8", "label": "text()", "type": "expression", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5944, 0.0009, 2, 0.33, 0.5326, 439, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(tan_text_loc[0,0], tan_text_loc[1,0], s = '$\\hat v_{tan}$', fontsize = 30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L681_C8", "label": "xlim()", "type": "expression", "loc": [681, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5953, 0.0009, 2, 0.33, 0.5435, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L682_C8", "label": "legend()", "type": "expression", "loc": [682, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5962, 0.0009, 2, 0.33, 0.5543, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L684_C8", "label": "savefig()", "type": "expression", "loc": [684, 684], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.5979, 0.0009, 2, 0.33, 0.5652, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L687_C8", "label": "wrist_color =", "type": "assigned_variable", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6005, 0.0009, 2, 0.33, 0.5761, 646, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "wrist_color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wrist_color = '#A0A000'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L688_C8", "label": "wrist_force =", "type": "assigned_variable", "loc": [688, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6014, 0.0009, 2, 0.33, 0.587, 483, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wrist_force = -np.matrix(force_new.f_list[zoom_location]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L689_C8", "label": "frad =", "type": "assigned_variable", "loc": [689, 689], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6023, 0.0009, 2, 0.33, 0.5978, 209, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad = (wrist_force[0:2,:].T * radial_vec)[0,0] * radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L690_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [690, 693], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6045, 0.0035, 2, 0.33, 0.6087, 776, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n wrist_force, scale=50., width = 0.002,\n color=wrist_color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L695_C8", "label": "wf_text =", "type": "assigned_variable", "loc": [695, 695], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6075, 0.0009, 2, 0.33, 0.6196, 613, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wf_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wf_text = rad_text_loc + np.matrix([-0.06,0.015]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L696_C8", "label": "text()", "type": "expression", "loc": [696, 697], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6088, 0.0017, 2, 0.33, 0.6304, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(wf_text[0,0], wf_text[1,0], color=wrist_color,\n fontsize = 25, s = 'Total Force')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L699_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [699, 702], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6123, 0.0035, 2, 0.33, 0.6413, 776, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([pts_2d_zoom[1,-1]],\n [pts_2d_zoom[0,-1]],\n frad, scale=50., width = 0.002,\n color=wrist_color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L703_C8", "label": "frad_text =", "type": "assigned_variable", "loc": [703, 703], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6145, 0.0009, 2, 0.33, 0.6522, 706, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "frad_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad_text = rad_text_loc + np.matrix([0.,0.015]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L704_C8", "label": "text()", "type": "expression", "loc": [704, 704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6154, 0.0009, 2, 0.33, 0.663, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(frad_text[0,0], frad_text[1,0], color=wrist_color, s = '$\\hat F_{rad}$', fontsize = 30)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L706_C8", "label": "xlim()", "type": "expression", "loc": [706, 706], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6171, 0.0009, 2, 0.33, 0.6739, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L707_C8", "label": "legend()", "type": "expression", "loc": [707, 707], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.618, 0.0009, 2, 0.33, 0.6848, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L709_C8", "label": "savefig()", "type": "expression", "loc": [709, 709], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6198, 0.0009, 2, 0.33, 0.6957, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L712_C8", "label": "frad =", "type": "assigned_variable", "loc": [712, 712], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6224, 0.0009, 2, 0.33, 0.7065, 209, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frad = (wrist_force[0:2,:].T * radial_vec)[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L713_C8", "label": "hook_force_motion =", "type": "assigned_variable", "loc": [713, 713], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6233, 0.0009, 2, 0.33, 0.7174, 550, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "hook_force_motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hook_force_motion = -(frad - 5) * radial_vec * 0.001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L714_C8", "label": "tangential_motion =", "type": "assigned_variable", "loc": [714, 714], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6241, 0.0009, 2, 0.33, 0.7283, 632, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_motion = 0.01 * tangential_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L715_C8", "label": "total_cep_motion =", "type": "assigned_variable", "loc": [715, 715], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.625, 0.0009, 2, 0.33, 0.7391, 240, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total_cep_motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_cep_motion = hook_force_motion + tangential_motion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L717_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [717, 719], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6276, 0.0026, 2, 0.33, 0.75, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],\n [cep_2d_zoom[0,-1]],\n hook_force_motion, scale=0.1, width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L720_C8", "label": "hw_text =", "type": "assigned_variable", "loc": [720, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6294, 0.0009, 2, 0.33, 0.7609, 318, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "hw_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hw_text = cep_2d_zoom[:,-1] + np.matrix([-0.002,-0.012]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L721_C8", "label": "text()", "type": "expression", "loc": [721, 722], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6307, 0.0017, 2, 0.33, 0.7717, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(hw_text[0,0], hw_text[1,0], color='k', fontsize=20,\n s = '$h[t]$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L723_C8", "label": "xlim()", "type": "expression", "loc": [723, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.632, 0.0009, 2, 0.33, 0.7826, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L724_C8", "label": "legend()", "type": "expression", "loc": [724, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6329, 0.0009, 2, 0.33, 0.7935, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L726_C8", "label": "savefig()", "type": "expression", "loc": [726, 726], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6346, 0.0009, 2, 0.33, 0.8043, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L729_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [729, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6381, 0.0026, 2, 0.33, 0.8152, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],\n [cep_2d_zoom[0,-1]],\n tangential_motion, scale=0.1, width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L732_C8", "label": "mw_text =", "type": "assigned_variable", "loc": [732, 732], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6399, 0.0009, 2, 0.33, 0.8261, 189, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mw_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mw_text = cep_2d_zoom[:,-1] + np.matrix([-0.018,0.001]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L733_C8", "label": "text()", "type": "expression", "loc": [733, 734], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6412, 0.0017, 2, 0.33, 0.837, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(mw_text[0,0], mw_text[1,0], color='k', fontsize=20,\n s = '$m[t]$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L735_C8", "label": "xlim()", "type": "expression", "loc": [735, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6425, 0.0009, 2, 0.33, 0.8478, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L736_C8", "label": "legend()", "type": "expression", "loc": [736, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6434, 0.0009, 2, 0.33, 0.8587, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L738_C8", "label": "savefig()", "type": "expression", "loc": [738, 738], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6451, 0.0009, 2, 0.33, 0.8696, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L741_C8", "label": "plot_quiver_yxv()", "type": "expression", "loc": [741, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6486, 0.0026, 2, 0.33, 0.8804, 776, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_quiver_yxv", "arg_names": [], "import_names": [], "rhs_call_name": "plot_quiver_yxv", "annotation": ""}, "snippet": " mpu.plot_quiver_yxv([cep_2d_zoom[1,-1]],\n [cep_2d_zoom[0,-1]],\n total_cep_motion, scale=0.1, width = 0.002)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L744_C8", "label": "cep_text =", "type": "assigned_variable", "loc": [744, 744], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6503, 0.0009, 2, 0.33, 0.8913, 424, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_text = cep_2d_zoom[:,-1] + np.matrix([-0.058,-0.023]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L745_C8", "label": "text()", "type": "expression", "loc": [745, 746], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6517, 0.0017, 2, 0.33, 0.9022, 439, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "text", "annotation": ""}, "snippet": " mpu.pl.text(cep_text[0,0], cep_text[1,0], color='k', fontsize=20,\n s = '$x_{eq}[t]$ = &x_{eq}[t-1] + m[t] + h[t]$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L747_C8", "label": "xlim()", "type": "expression", "loc": [747, 747], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.653, 0.0009, 2, 0.33, 0.913, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L748_C8", "label": "legend()", "type": "expression", "loc": [748, 748], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6538, 0.0009, 2, 0.33, 0.9239, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L750_C8", "label": "savefig()", "type": "expression", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6556, 0.0009, 2, 0.33, 0.9348, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L753_C8", "label": "new_cep =", "type": "assigned_variable", "loc": [753, 753], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [14, 2, 0.6582, 0.0009, 2, 0.33, 0.9457, 483, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_cep", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_cep = cep_2d_zoom[:,-1] + total_cep_motion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L754_C8", "label": "plot_yx()", "type": "expression", "loc": [754, 757], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6604, 0.0035, 2, 0.33, 0.9565, 112, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(new_cep[1,:].A1, new_cep[0,:].A1, color='g',\n axis = 'equal', alpha = 1.0,\n scatter_size=10, linewidth=0, marker='+',\n marker_edge_width = 1.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L758_C8", "label": "xlim()", "type": "expression", "loc": [758, 758], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6626, 0.0009, 2, 0.33, 0.9674, 907, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "xlim", "arg_names": [], "import_names": [], "rhs_call_name": "xlim", "annotation": ""}, "snippet": " mpu.pl.xlim(0.28, 0.47)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L759_C8", "label": "legend()", "type": "expression", "loc": [759, 759], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6635, 0.0009, 2, 0.33, 0.9783, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " mpu.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L761_C8", "label": "savefig()", "type": "expression", "loc": [761, 761], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6652, 0.0009, 2, 0.33, 0.9891, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " mpu.savefig(fig_name+'%d'%fig_number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L764_C8", "label": "show()", "type": "expression", "loc": [764, 764], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "vector": [8, 2, 0.6678, 0.0009, 2, 0.33, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mpu.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "label": "if", "type": "if", "loc": [766, 782], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.6766, 0.0149, 1, 0.86, 0.8868, 0, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xy_flag:\n st_pt = pts_2d[:,0]\n end_pt = pts_2d[:,-1]\n\n if expt_plot:\n pl.subplot(233)\n\n plot_cartesian(actual_cartesian, xaxis=0, yaxis=1, color='b',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L767_C8", "label": "st_pt =", "type": "assigned_variable", "loc": [767, 767], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "vector": [14, 2, 0.6705, 0.0009, 2, 0.28, 0.0, 515, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "st_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " st_pt = pts_2d[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L768_C8", "label": "end_pt =", "type": "assigned_variable", "loc": [768, 768], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "vector": [14, 2, 0.6713, 0.0009, 2, 0.28, 0.2, 292, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "end_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " end_pt = pts_2d[:,-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L770_C8", "label": "if", "type": "if", "loc": [770, 771], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "vector": [4, 2, 0.6735, 0.0017, 2, 0.28, 0.4, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(233)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L771_C12", "label": "subplot()", "type": "expression", "loc": [771, 771], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L770_C8", "vector": [8, 3, 0.674, 0.0009, 3, 0.51, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(233)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L773_C8", "label": "plot_cartesian()", "type": "expression", "loc": [773, 774], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "vector": [8, 2, 0.6761, 0.0017, 2, 0.28, 0.6, 991, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian, xaxis=0, yaxis=1, color='b',\n label='FK', plot_velocity=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L775_C8", "label": "plot_cartesian()", "type": "expression", "loc": [775, 775], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "vector": [8, 2, 0.6774, 0.0009, 2, 0.28, 0.8, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=0,yaxis=1,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "label": "if", "type": "if", "loc": [777, 782], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "vector": [4, 2, 0.6814, 0.0052, 2, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif yz_flag:\n plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')\n elif xz_flag:\n plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L778_C8", "label": "plot_cartesian()", "type": "expression", "loc": [778, 778], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "vector": [8, 3, 0.6801, 0.0009, 3, 0.89, 0.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=1,yaxis=2,color='b',label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L779_C8", "label": "plot_cartesian()", "type": "expression", "loc": [779, 779], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "vector": [8, 3, 0.6809, 0.0009, 3, 0.89, 0.5, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=1,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L780_C4", "label": "if", "type": "if", "loc": [780, 782], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "vector": [4, 3, 0.6827, 0.0026, 3, 0.89, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif xz_flag:\n plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')\n plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L781_C8", "label": "plot_cartesian()", "type": "expression", "loc": [781, 781], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L780_C4", "vector": [8, 4, 0.6827, 0.0009, 4, 0.93, 0.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(actual_cartesian,xaxis=0,yaxis=2,color='b',label='FK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L782_C8", "label": "plot_cartesian()", "type": "expression", "loc": [782, 782], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L780_C4", "vector": [8, 4, 0.6836, 0.0009, 4, 0.93, 1.0, 991, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(eq_cartesian, xaxis=0,yaxis=2,color='g',label='Eq Point')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "label": "if", "type": "if", "loc": [785, 838], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.7094, 0.0472, 1, 0.86, 0.9057, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_flag or plot_forces_error_flag or plot_ellipses_flag or plot_force_components_flag or plot_force_field_flag:\n # arm_stiffness_list = d['stiffness'].stiffness_list\n # scale = d['stiffness'].stiffness_scale\n # asl = [min(scale*s,1.0) for s in arm_stiffness_list]\n # ftraj_jinv,ftraj_stiff,ftraj_torque,k_cart_list=compute_forces(d['actual'],d['eq_pt'],\n # d['torque'],asl)\n if plot_forces_flag:\n plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L791_C8", "label": "if", "type": "if", "loc": [791, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "vector": [4, 2, 0.6919, 0.0017, 2, 0.61, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_flag:\n plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L792_C12", "label": "plot_forces_quiver()", "type": "expression", "loc": [792, 792], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L791_C8", "vector": [8, 3, 0.6923, 0.0009, 3, 0.55, 0.0, 539, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_forces_quiver", "arg_names": [], "import_names": [], "rhs_call_name": "plot_forces_quiver", "annotation": ""}, "snippet": " plot_forces_quiver(actual_cartesian,d['force'],color='k')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L796_C8", "label": "if", "type": "if", "loc": [796, 803], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "vector": [4, 2, 0.6989, 0.007, 2, 0.61, 0.25, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_ellipses_flag:\n #plot_stiff_ellipses(k_cart_list,actual_cartesian)\n if expt_plot:\n subplotnum=234\n else:\n pl.figure()\n subplotnum=111\n plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "label": "if", "type": "if", "loc": [798, 802], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L796_C8", "vector": [4, 3, 0.6993, 0.0044, 3, 0.15, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n subplotnum=234\n else:\n pl.figure()\n subplotnum=111"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L799_C16", "label": "subplotnum =", "type": "assigned_variable", "loc": [799, 799], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "vector": [14, 4, 0.6984, 0.0009, 4, 0.72, 0.0, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subplotnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subplotnum=234"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L801_C16", "label": "figure()", "type": "expression", "loc": [801, 801], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "vector": [8, 4, 0.7002, 0.0009, 4, 0.72, 0.5, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L802_C16", "label": "subplotnum =", "type": "assigned_variable", "loc": [802, 802], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "vector": [14, 4, 0.701, 0.0009, 4, 0.72, 1.0, 279, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "subplotnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subplotnum=111"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L803_C12", "label": "plot_stiff_ellipses()", "type": "expression", "loc": [803, 803], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L796_C8", "vector": [8, 3, 0.7019, 0.0009, 3, 0.15, 1.0, 370, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiff_ellipses", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiff_ellipses", "annotation": ""}, "snippet": " plot_stiff_ellipses(k_cart_list,eq_cartesian,subplotnum=subplotnum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L805_C8", "label": "if", "type": "if", "loc": [805, 806], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "vector": [4, 2, 0.7041, 0.0017, 2, 0.61, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_forces_error_flag:\n plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L806_C12", "label": "plot_error_forces()", "type": "expression", "loc": [806, 806], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L805_C8", "vector": [8, 3, 0.7045, 0.0009, 3, 0.69, 0.0, 432, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_error_forces", "arg_names": [], "import_names": [], "rhs_call_name": "plot_error_forces", "annotation": ""}, "snippet": " plot_error_forces(d['force'].f_list,ftraj_jinv.f_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "label": "if", "type": "if", "loc": [809, 834], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "vector": [4, 2, 0.7181, 0.0227, 2, 0.61, 0.75, 0, 2, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_force_components_flag:\n p_list = actual_cartesian.p_list\n #cx = 45.\n #cy = -0.3\n frad_list,ftan_list,_ = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)\n #frad_list,ftan_list,_ = compute_radial_tangential_forces(d['force_raw'].f_list,p_list,cx,cy)\n if expt_plot:\n pl.subplot(235)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L810_C12", "label": "p_list =", "type": "assigned_variable", "loc": [810, 810], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [14, 3, 0.708, 0.0009, 3, 0.35, 0.0, 98, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L813_C12", "label": "frad_list, ftan_list, _ = compute_radial_tangential_forces()", "type": "assigned_variable", "loc": [813, 813], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [14, 3, 0.7107, 0.0009, 3, 0.35, 0.0714, 300, 3, 4, 0, 0, 224, 10, 1], "semantic": {"name": "frad_list, ftan_list, _", "arg_names": [], "import_names": [], "rhs_call_name": "compute_radial_tangential_forces", "annotation": ""}, "snippet": " frad_list,ftan_list,_ = compute_radial_tangential_forces(d['force'].f_list,p_list,cx,cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L815_C12", "label": "if", "type": "if", "loc": [815, 818], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [4, 3, 0.7137, 0.0035, 3, 0.35, 0.1429, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(235)\n else:\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L816_C16", "label": "subplot()", "type": "expression", "loc": [816, 816], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L815_C12", "vector": [8, 4, 0.7133, 0.0009, 4, 0.66, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(235)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L818_C16", "label": "figure()", "type": "expression", "loc": [818, 818], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L815_C12", "vector": [8, 4, 0.715, 0.0009, 4, 0.66, 1.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L820_C12", "label": "time_list =", "type": "assigned_variable", "loc": [820, 820], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [14, 3, 0.7168, 0.0009, 3, 0.35, 0.2143, 941, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = d['force'].time_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L821_C12", "label": "time_list =", "type": "assigned_variable", "loc": [821, 821], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [14, 3, 0.7177, 0.0009, 3, 0.35, 0.2857, 941, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_list = [t-time_list[0] for t in time_list]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L822_C12", "label": "x_coord_list = tolist()", "type": "assigned_variable", "loc": [822, 822], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [14, 3, 0.7185, 0.0009, 3, 0.35, 0.3571, 243, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "x_coord_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " x_coord_list = np.matrix(p_list)[:,0].A1.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L823_C12", "label": "plot_yx()", "type": "expression", "loc": [823, 823], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.7194, 0.0009, 3, 0.35, 0.4286, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(frad_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L824_C12", "label": "xlabel()", "type": "expression", "loc": [824, 824], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.7203, 0.0009, 3, 0.35, 0.5, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('x coord of end effector (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L825_C12", "label": "ylabel()", "type": "expression", "loc": [825, 825], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.7212, 0.0009, 3, 0.35, 0.5714, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('magnitude of radial force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L826_C12", "label": "title()", "type": "expression", "loc": [826, 826], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.722, 0.0009, 3, 0.35, 0.6429, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L827_C12", "label": "if", "type": "if", "loc": [827, 830], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [4, 3, 0.7242, 0.0035, 3, 0.35, 0.7143, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n pl.subplot(236)\n else:\n pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L828_C16", "label": "subplot()", "type": "expression", "loc": [828, 828], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L827_C12", "vector": [8, 4, 0.7238, 0.0009, 4, 0.29, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "subplot", "arg_names": [], "import_names": [], "rhs_call_name": "subplot", "annotation": ""}, "snippet": " pl.subplot(236)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L830_C16", "label": "figure()", "type": "expression", "loc": [830, 830], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L827_C12", "vector": [8, 4, 0.7255, 0.0009, 4, 0.29, 1.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pl.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L831_C12", "label": "plot_yx()", "type": "expression", "loc": [831, 831], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.7264, 0.0009, 3, 0.35, 0.7857, 112, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "plot_yx", "arg_names": [], "import_names": [], "rhs_call_name": "plot_yx", "annotation": ""}, "snippet": " mpu.plot_yx(ftan_list,x_coord_list,scatter_size=50,color=time_list,cb_label='time',axis=None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L832_C12", "label": "xlabel()", "type": "expression", "loc": [832, 832], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.7273, 0.0009, 3, 0.35, 0.8571, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pl.xlabel('x coord of end effector (m)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L833_C12", "label": "ylabel()", "type": "expression", "loc": [833, 833], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.7281, 0.0009, 3, 0.35, 0.9286, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pl.ylabel('magnitude of tangential force (N)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L834_C12", "label": "title()", "type": "expression", "loc": [834, 834], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "vector": [8, 3, 0.729, 0.0009, 3, 0.35, 1.0, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " pl.title(d['info'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L836_C8", "label": "if", "type": "if", "loc": [836, 838], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "vector": [4, 2, 0.7316, 0.0026, 2, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if plot_force_field_flag:\n plot_stiffness_field(k_cart_list[0],plottitle='start')\n plot_stiffness_field(k_cart_list[-1],plottitle='end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L837_C12", "label": "plot_stiffness_field()", "type": "expression", "loc": [837, 837], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L836_C8", "vector": [8, 3, 0.7316, 0.0009, 3, 0.16, 0.0, 136, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiffness_field", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiffness_field", "annotation": ""}, "snippet": " plot_stiffness_field(k_cart_list[0],plottitle='start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L838_C12", "label": "plot_stiffness_field()", "type": "expression", "loc": [838, 838], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L836_C8", "vector": [8, 3, 0.7325, 0.0009, 3, 0.16, 1.0, 136, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot_stiffness_field", "arg_names": [], "import_names": [], "rhs_call_name": "plot_stiffness_field", "annotation": ""}, "snippet": " plot_stiffness_field(k_cart_list[-1],plottitle='end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L841_C4", "label": "str_parts = split()", "type": "assigned_variable", "loc": [841, 841], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [14, 1, 0.7351, 0.0009, 1, 0.86, 0.9245, 705, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "str_parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " str_parts = fname.split('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "label": "if", "type": "if", "loc": [842, 850], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.7395, 0.0079, 1, 0.86, 0.9434, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if d.has_key('strategy'):\n addon = ''\n if opt.xy:\n addon = '_xy'\n if opt.xz:\n addon = '_xz'\n fig_name = str_parts[0]+'_'+d['strategy']+addon+'.png'\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L843_C8", "label": "addon =", "type": "assigned_variable", "loc": [843, 843], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "vector": [14, 2, 0.7369, 0.0009, 2, 0.12, 0.0, 968, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "addon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addon = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L844_C8", "label": "if", "type": "if", "loc": [844, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "vector": [4, 2, 0.7382, 0.0017, 2, 0.12, 0.25, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.xy:\n addon = '_xy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L845_C12", "label": "addon =", "type": "assigned_variable", "loc": [845, 845], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L844_C8", "vector": [14, 3, 0.7386, 0.0009, 3, 0.44, 0.0, 968, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "addon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addon = '_xy'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L846_C8", "label": "if", "type": "if", "loc": [846, 847], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "vector": [4, 2, 0.7399, 0.0017, 2, 0.12, 0.5, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.xz:\n addon = '_xz'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L847_C12", "label": "addon =", "type": "assigned_variable", "loc": [847, 847], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L846_C8", "vector": [14, 3, 0.7404, 0.0009, 3, 0.0, 0.0, 968, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "addon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " addon = '_xz'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L848_C8", "label": "fig_name =", "type": "assigned_variable", "loc": [848, 848], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "vector": [14, 2, 0.7413, 0.0009, 2, 0.12, 0.75, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_'+d['strategy']+addon+'.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L850_C8", "label": "fig_name =", "type": "assigned_variable", "loc": [850, 850], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "vector": [14, 2, 0.743, 0.0009, 2, 0.12, 1.0, 219, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fig_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fig_name = str_parts[0]+'_res.png'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "label": "if", "type": "if", "loc": [852, 856], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.7465, 0.0044, 1, 0.86, 0.9623, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expt_plot:\n f = pl.gcf()\n curr_size = f.get_size_inches()\n f.set_size_inches(curr_size[0]*2,curr_size[1]*2)\n f.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L853_C8", "label": "f = gcf()", "type": "assigned_variable", "loc": [853, 853], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "vector": [14, 2, 0.7456, 0.0009, 2, 0.47, 0.0, 899, 3, 0, 0, 0, 274, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "gcf", "annotation": ""}, "snippet": " f = pl.gcf()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L854_C8", "label": "curr_size = get_size_inches()", "type": "assigned_variable", "loc": [854, 854], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "vector": [14, 2, 0.7465, 0.0009, 2, 0.47, 0.3333, 156, 3, 0, 0, 0, 444, 10, 1], "semantic": {"name": "curr_size", "arg_names": [], "import_names": [], "rhs_call_name": "get_size_inches", "annotation": ""}, "snippet": " curr_size = f.get_size_inches()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L855_C8", "label": "set_size_inches()", "type": "expression", "loc": [855, 855], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "vector": [8, 2, 0.7474, 0.0009, 2, 0.47, 0.6667, 620, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_size_inches", "arg_names": [], "import_names": [], "rhs_call_name": "set_size_inches", "annotation": ""}, "snippet": " f.set_size_inches(curr_size[0]*2,curr_size[1]*2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L856_C8", "label": "savefig()", "type": "expression", "loc": [856, 856], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "vector": [8, 2, 0.7483, 0.0009, 2, 0.47, 1.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " f.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "label": "if", "type": "if", "loc": [858, 864], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.7526, 0.0061, 1, 0.86, 0.9811, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if show_fig:\n pl.show()\n else:\n print('################################')\n print('show_fig is FALSE')\n if not(expt_plot):\n pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L859_C8", "label": "show()", "type": "expression", "loc": [859, 859], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "vector": [8, 2, 0.7509, 0.0009, 2, 0.57, 0.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pl.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L861_C8", "label": "print()", "type": "expression", "loc": [861, 861], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "vector": [8, 2, 0.7526, 0.0009, 2, 0.57, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('################################')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L862_C8", "label": "print()", "type": "expression", "loc": [862, 862], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "vector": [8, 2, 0.7535, 0.0009, 2, 0.57, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('show_fig is FALSE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L863_C8", "label": "if", "type": "if", "loc": [863, 864], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "vector": [4, 2, 0.7548, 0.0017, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not(expt_plot):\n pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L864_C12", "label": "savefig()", "type": "expression", "loc": [864, 864], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L863_C8", "vector": [8, 3, 0.7552, 0.0009, 3, 0.93, 0.0, 677, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "savefig", "arg_names": [], "import_names": [], "rhs_call_name": "savefig", "annotation": ""}, "snippet": " pl.savefig(fig_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L866_C4", "label": "if", "type": "if", "loc": [866, 868], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "vector": [4, 1, 0.7579, 0.0026, 1, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if xyz_flag:\n plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)\n mlab.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L867_C8", "label": "plot_cartesian()", "type": "expression", "loc": [867, 867], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L866_C4", "vector": [8, 2, 0.7579, 0.0009, 2, 0.25, 0.0, 991, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "plot_cartesian", "annotation": ""}, "snippet": " plot_cartesian(traj, xaxis=0,yaxis=1,zaxis=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L868_C8", "label": "show()", "type": "expression", "loc": [868, 868], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L866_C4", "vector": [8, 2, 0.7587, 0.0009, 2, 0.25, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " mlab.show()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:ClassDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L133_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:ImportFrom_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:ImportFrom_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L168_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L237_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L237_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L249_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L249_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L262_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L264_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L280_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L295_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L313_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L311_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L317_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L335_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L336_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L323_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L357_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L345_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L373_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L380_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L381_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:While_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:While_L383_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L384_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L388_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L388_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L389_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:FunctionDef_L368_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Return_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Import_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L413_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L415_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L417_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L435_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L439_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L447_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L452_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L455_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L456_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L478_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L482_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L484_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L485_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L486_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L487_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L488_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L489_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L480_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L490_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L502_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L500_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L503_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L506_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L507_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L508_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L508_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L512_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L513_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L514_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L514_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L517_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L519_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L531_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L534_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L535_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L536_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L537_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L538_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L539_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L540_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L542_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L542_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L543_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:For_L542_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L544_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L546_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L533_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L547_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L556_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L558_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L565_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L566_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L575_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L587_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L598_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L601_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L604_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L612_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L613_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L614_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L635_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L645_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L652_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L653_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L655_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L660_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L661_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L663_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L666_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L667_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L668_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L669_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L673_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L674_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L675_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L684_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L689_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L690_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L695_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L696_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L699_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L703_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L704_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L706_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L707_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L709_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L713_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L714_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L715_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L717_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L720_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L721_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L723_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L724_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L726_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L732_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L733_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L735_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L736_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L738_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L741_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L744_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L747_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L748_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L753_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L758_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L759_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L761_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L562_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L764_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L767_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L768_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L770_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L770_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L771_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L773_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L775_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L766_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L778_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L779_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L777_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L780_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L781_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L780_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L782_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L791_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L792_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L796_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L796_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L799_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L801_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L798_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L802_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L796_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L803_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L805_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L805_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L806_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L810_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L813_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L815_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L815_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L816_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L815_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L818_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L820_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L821_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L822_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L823_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L824_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L825_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L826_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L827_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L827_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L828_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L827_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L830_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L831_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L832_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L833_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L834_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L785_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L836_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L836_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L837_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L836_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L838_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L841_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L843_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L844_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L844_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L845_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L846_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L846_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L847_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L848_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L842_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L850_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L853_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Assign_L854_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L855_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L856_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L859_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L861_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L862_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L858_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L863_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L863_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L864_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L405_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L866_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L866_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L867_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99207:If_L866_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99207:Expr_L868_C8"}] |
import scipy.optimize as so
import matplotlib.pyplot as pp
import matplotlib_util.util as mpu
import numpy as np, math
import sys, os, time
sys.path.append(os.environ['HRLBASEPATH']+'/src/projects/modeling_forces/handheld_hook')
import ram_db as rd
import mechanism_analyse_RAM as mar
import mechanism_analyse_advait as maa
import arm_trajectories as at
import tangential_force_monitor as tfm
import roslib; roslib.load_manifest('equilibrium_point_control')
import hrl_lib.util as ut, hrl_lib.transforms as tr
## assuming that the mechnism is rotary.
# @return r, cx, cy
def estimate_mechanism_kinematics(pull_dict, pr2_log):
if not pr2_log:
act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])
force_tl = pull_dict['force']
actual_cartesian, force_ts = at.account_segway_motion(act_tl,
force_tl, pull_dict['segway'])
cartesian_force_clean, _ = at.filter_trajectory_force(actual_cartesian,
pull_dict['force'])
pts_list = actual_cartesian.p_list
pts_2d, reject_idx = at.filter_cartesian_trajectory(cartesian_force_clean)
else:
# not performing force filtering for PR2 trajectories.
# might have to add that in later.
p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']
p_list = p_list[::2]
f_list = f_list[::2]
pts = np.matrix(p_list).T
px = pts[0,:].A1
py = pts[1,:].A1
pts_2d = np.matrix(np.row_stack((px, py)))
#rad = 0.4
rad = 1.1
x_guess = pts_2d[0,0]
y_guess = pts_2d[1,0] - rad
rad_guess = rad
rad, cx, cy = at.fit_circle(rad_guess,x_guess,y_guess,pts_2d,
method='fmin_bfgs',verbose=False,
rad_fix=False)
#rad, cx, cy = rad_guess, x_guess, y_guess
return rad, cx, cy
def force_trajectory_in_hindsight(pull_dict, mechanism_type, pr2_log):
print '_________________________________________________'
print 'starting force_trajectory_in_hindsight'
print '_________________________________________________'
if not pr2_log:
arm = pull_dict['arm']
act_tl = at.joint_to_cartesian(pull_dict['actual'], arm)
force_tl = pull_dict['force']
actual_cartesian, force_ts = at.account_segway_motion(act_tl,
force_tl, pull_dict['segway'])
p_list = actual_cartesian.p_list
f_list = force_ts.f_list
else:
p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']
p_list = p_list[::2]
f_list = f_list[::2]
if mechanism_type == 'rotary':
r, cx, cy = estimate_mechanism_kinematics(pull_dict, pr2_log)
print 'rad, cx, cy:', r, cx, cy
frad_list,ftan_list,_ = at.compute_radial_tangential_forces(f_list,
p_list,cx,cy)
p0 = p_list[0]
rad_vec_init = np.matrix((p0[0]-cx, p0[1]-cy)).T
rad_vec_init = rad_vec_init / np.linalg.norm(rad_vec_init)
config_list = []
for p in p_list:
rvec = np.matrix((p[0]-cx, p[1]-cy)).T
rvec = rvec / np.linalg.norm(rvec)
ang = np.arccos((rvec.T*rad_vec_init)[0,0])
if np.isnan(ang):
ang = 0
config_list.append(ang)
else:
p0 = p_list[0]
ftan_list, config_list = [], []
for f, p in zip(f_list, p_list):
config_list.append(p0[0] - p[0])
ftan_list.append(abs(f[0]))
return config_list, ftan_list
def online_force_with_radius(pull_dict, pr2_log, radius_err = 0.,
with_prior = True):
if not pr2_log:
act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])
force_tl = pull_dict['force']
actual_cartesian, force_ts = at.account_segway_motion(act_tl,
force_tl, pull_dict['segway'])
p_list = actual_cartesian.p_list
f_list = force_ts.f_list
else:
p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']
p_list = p_list[::2]
f_list = f_list[::2]
radius, _, _ = estimate_mechanism_kinematics(pull_dict, pr2_log)
radius += radius_err
print '_________________________________________________'
print 'using radius:', radius
print '_________________________________________________'
pts_list = []
ftan_list = []
config_list = []
for f,p in zip(f_list, p_list):
pts_list.append(p)
pts_2d = (np.matrix(pts_list).T)[0:2,:]
x_guess = pts_list[0][0]
y_guess = pts_list[0][1] - radius
rad_guess = radius
if with_prior:
rad, cx, cy = at.fit_circle_priors(rad_guess, x_guess,
y_guess, pts_2d, sigma_r = 0.2, sigma_xy = 0.2,
sigma_pts = 0.01, verbose=False)
else:
rad, cx, cy = at.fit_circle(rad_guess,x_guess,y_guess,pts_2d,
method='fmin_bfgs',verbose=False,
rad_fix=True)
print 'rad, cx, cy:', rad, cx, cy
p0 = p_list[0]
rad_vec_init = np.matrix((p0[0]-cx, p0[1]-cy)).T
rad_vec_init = rad_vec_init / np.linalg.norm(rad_vec_init)
rad_vec = np.array([p[0]-cx,p[1]-cy])
rad_vec = rad_vec/np.linalg.norm(rad_vec)
ang = np.arccos((rad_vec.T*rad_vec_init)[0,0])
config_list.append(ang)
tan_vec = (np.matrix([[0,-1],[1,0]]) * np.matrix(rad_vec).T).A1
f_vec = np.array([f[0],f[1]])
f_tan_mag = abs(np.dot(f_vec, tan_vec))
ftan_list.append(f_tan_mag)
return config_list, ftan_list
def load_ref_traj(nm):
if 'kitchen_cabinet' in nm:
#has_tags = ['HSI_kitchen_cabinet_left']
has_tags = ['HSI_kitchen_cabinet_right']
elif 'lab_cabinet_recessed_left' in nm:
has_tags = ['HSI_lab_cabinet_recessed_left']
elif 'lab_cabinet_recessed_right' in nm:
has_tags = ['HRL_lab_cabinet_recessed_right']
elif 'spring_loaded_door' in nm:
has_tags = ['HSI_Glass_Door']
elif 'hrl_toolchest' in nm:
has_tags = ['HRL_toolchest_drawer_empty']
elif 'ikea_cabinet' in nm:
has_tags = ['HSI_kitchen_cabinet_right']
#has_tags[rd.o, rd.c]
elif 'refrigerator' in nm:
has_tags = ['naveen_refrigerator']
#has_tags = [rd.r]
else:
#has_tags = [rd.r]
return None
mn, std, config, typ = rd.get_mean_std_config(has_tags)
return mn, std, config, typ
def error_lists(ftan_l, config_l, ref_dict):
# matching the dict expected in tangential_force_monitor.py
ref_force_dict = {}
ref_force_dict['tangential'] = ref_dict['mean']
ref_force_dict['configuration'] = ref_dict['config']
ref_force_dict['type'] = ref_dict['typ']
ref_force_dict['name'] = ref_dict['name']
rel_err_list = []
abs_err_list = []
for f,c in zip(ftan_l, config_l):
hi, lo, ref_hi, ref_lo = tfm.error_from_reference(ref_force_dict, f, c)
# if ref_hi < 5.:
# # only consider configs where ref force is greater than 3N
# continue
if lo > hi:
err = -lo
ref = ref_lo
else:
err = hi
ref = ref_hi
if ref == 0:
continue
# if abs(err) < 3.:
# continue
rel_err_list.append(err/ref)
abs_err_list.append(err)
return rel_err_list, abs_err_list
def plot_err_histogram(rel_list, abs_list, title):
# plot relative error histogram.
max_err = 1.0
bin_width = 0.05 # relative err.
bins = np.arange(0.-bin_width/2.-max_err, max_err+2*bin_width, bin_width)
hist, bin_edges = np.histogram(np.array(rel_list), bins)
mpu.figure()
mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,
width=bin_width*0.8, xlabel='Relative Error',
plot_title=title)
# plot relative error histogram.
max_err = 20
bin_width = 2 # relative err.
bins = np.arange(0.-bin_width/2.-max_err, max_err+2*bin_width, bin_width)
hist, bin_edges = np.histogram(np.array(abs_list), bins)
mpu.figure()
mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,
width=bin_width*0.8, xlabel='Absolute Error',
plot_title=title)
def truncate_to_config(ftan_l, config_l, config):
idxs = np.where(np.array(config_l)<config)[0]
idx = idxs[-1]
return ftan_l[:idx+1], config_l[:idx+1]
def plot_pkl(pkl_nm):
pull_dict = ut.load_pickle(pkl_nm)
if 'pr2' in pkl_nm:
pr2_log = True
h_color = 'y'
else:
pr2_log = False
h_color = 'r'
t = load_ref_traj(pkl_nm)
if t !=None:
ref_mean, ref_std, ref_config, typ = t
mar.plot_reference_trajectory(ref_config, ref_mean, ref_std, typ, 'Hello')
ref_config = np.degrees(ref_config)
max_config = np.max(ref_config)
else:
typ = 'rotary'
max_config = 60.
if pr2_log:
o_ftan = pull_dict['ftan_list']
o_config = pull_dict['config_list']
else:
o_ftan = pull_dict['online_ftan']
o_config = pull_dict['online_ang']
h_config, h_ftan = force_trajectory_in_hindsight(pull_dict,
typ, pr2_log)
if typ == 'rotary':
if opt.prior:
r_config, r_ftan = online_force_with_radius(pull_dict,
pr2_log)
r_config = np.degrees(r_config)
o_config = np.degrees(o_config)
h_config = np.degrees(h_config)
o_ftan, o_config = truncate_to_config(o_ftan, o_config, max_config)
h_ftan, h_config = truncate_to_config(h_ftan, h_config, max_config)
if typ == 'rotary':
if opt.prior:
r_ftan, r_config = truncate_to_config(r_ftan, r_config, max_config)
bin_size = 1.
else:
bin_size = 0.01
#o_config, o_ftan = maa.bin(o_config, o_ftan, bin_size, np.mean, True)
#h_config, h_ftan = maa.bin(h_config, h_ftan, bin_size, np.mean, True)
# non_nans = ~np.isnan(h_ftan)
# h_ftan = np.array(h_ftan)[non_nans]
# h_config = np.array(h_config)[non_nans]
#
# non_nans = ~np.isnan(o_ftan)
# o_ftan = np.array(o_ftan)[non_nans]
# o_config = np.array(o_config)[non_nans]
# h_config = h_config[:-1]
# h_ftan = h_ftan[1:]
if not pr2_log:
m,c = get_cody_calibration()
o_ftan = (np.array(o_ftan) - c) / m
h_ftan = (np.array(h_ftan) - c) / m
pp.plot(o_config, o_ftan, 'bo-', ms=5, label='online')
pp.plot(h_config, h_ftan, h_color+'o-', ms=5, label='hindsight')
if typ == 'rotary':
if opt.prior:
r_config, r_ftan = maa.bin(r_config, r_ftan, bin_size, max, True)
pp.plot(r_config, r_ftan, 'go-', ms=5, label='online with priors')
pp.xlabel('Configuration')
pp.ylabel('Tangential Force')
if pr2_log:
pp.figure()
p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']
p_list = p_list[::2]
f_list = f_list[::2]
x_l, y_l, z_l = zip(*p_list)
pp.plot(x_l, y_l)
r, cx, cy = estimate_mechanism_kinematics(pull_dict, pr2_log)
mpu.plot_circle(cx, cy, r, 0., math.pi/2,
label='Actual\_opt', color='r')
pp.axis('equal')
def compute_mean_std(pkls, bin_size):
c_list = []
f_list = []
max_config = math.radians(100.)
typ = 'rotary'
for pkl_nm in pkls:
pull_dict = ut.load_pickle(pkl_nm)
pr2_log = 'pr2' in pkl_nm
h_config, h_ftan = force_trajectory_in_hindsight(pull_dict,
typ, pr2_log)
#h_config, h_ftan = online_force_with_radius(pull_dict, pr2_log)
c_list.append(h_config)
f_list.append(h_ftan)
max_config = min(max_config, np.max(h_config))
leng = int (max_config / bin_size) - 1
ff = []
for c, f in zip(c_list, f_list):
#c, f = maa.bin(c, f, bin_size, max, True)
c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)
f, c = truncate_to_config(f, c, max_config)
f = np.ma.masked_array(f, np.isnan(f))
f = f[:leng]
c = c[:leng]
ff.append(f)
arr = np.array(ff)
mean = arr.mean(0)
std = arr.std(0)
return mean, std, c, arr
def calibrate_least_squares(ref_mean, sensor_mean):
ref_mean = np.array(ref_mean)
length = min(ref_mean.shape[0], sensor_mean.shape[0])
ref_mean = ref_mean[:length]
sensor_mean = sensor_mean[:length]
def error_function(params):
m, c = params[0], params[1]
sensor_predict = m * ref_mean + c
err = (sensor_predict - sensor_mean)
return np.sum((err * err) * np.abs(ref_mean))
#return np.sum(err * err)
params = [1., 0.]
r = so.fmin_bfgs(error_function, params, full_output=1,
disp = False, gtol=1e-5)
print 'Optimization result:', r[0]
def get_cody_calibration():
m = 1.13769405
c = 2.22946475
# sensor = m * ref + c
m, c = 1., 0.
return m, c
def convert_to_ram_db(pkls, name):
if pkls == []:
return
bin_size = math.radians(1.)
mean, std, c, arr = compute_mean_std(pkls, bin_size)
d = {}
d['std'] = std
d['mean'] = mean
d['rad'] = -3.141592
d['name'] = name
d['config'] = c
d['vec_list'] = arr.tolist()
d['typ'] = 'rotary'
ut.save_pickle(d, name+'.pkl')
def simulate_perception(pkls, percep_std, name):
c_list = []
f_list = []
trials_per_pkl = 5
bin_size = math.radians(1.)
max_config = math.radians(100.)
for pkl_nm in pkls:
pull_dict = ut.load_pickle(pkl_nm)
pr2_log = 'pr2' in pkl_nm
for t in range(trials_per_pkl):
radius_err = np.random.normal(scale=percep_std)
#radius_err = np.random.uniform(-percep_std, percep_std)
h_config, h_ftan = online_force_with_radius(pull_dict, pr2_log, radius_err)
c_list.append(h_config)
f_list.append(h_ftan)
max_config = min(max_config, np.max(h_config))
leng = int (max_config / bin_size) - 1
ff = []
for c, f in zip(c_list, f_list):
c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)
f, c = truncate_to_config(f, c, max_config)
f = np.ma.masked_array(f, np.isnan(f))
f = f[:leng]
c = c[:leng]
ff.append(f)
arr = np.array(ff)
mean = arr.mean(0)
std = arr.std(0)
d = {}
d['std'] = std
d['mean'] = mean
d['rad'] = -3.141592
d['name'] = name
d['config'] = c
d['vec_list'] = arr.tolist()
d['typ'] = 'rotary'
ut.save_pickle(d, name+'.pkl')
def known_radius(pkls, name):
c_list = []
f_list = []
trials_per_pkl = 1
bin_size = math.radians(1.)
max_config = math.radians(100.)
for pkl_nm in pkls:
pull_dict = ut.load_pickle(pkl_nm)
pr2_log = 'pr2' in pkl_nm
for t in range(trials_per_pkl):
h_config, h_ftan = online_force_with_radius(pull_dict,
pr2_log, with_prior = False)
c_list.append(h_config)
f_list.append(h_ftan)
max_config = min(max_config, np.max(h_config))
leng = int (max_config / bin_size) - 1
ff = []
for c, f in zip(c_list, f_list):
c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)
f, c = truncate_to_config(f, c, max_config)
f = np.ma.masked_array(f, np.isnan(f))
f = f[:leng]
c = c[:leng]
ff.append(f)
arr = np.array(ff)
mean = arr.mean(0)
std = arr.std(0)
d = {}
d['std'] = std
d['mean'] = mean
d['rad'] = -3.141592
d['name'] = name
d['config'] = c
d['vec_list'] = arr.tolist()
d['typ'] = 'rotary'
ut.save_pickle(d, name+'.pkl')
if __name__ == '__main__':
import optparse
import glob
p = optparse.OptionParser()
p.add_option('-d', action='store', type='string', dest='dir_nm',
help='plot all the pkls in the directory.', default='')
p.add_option('-f', action='store', type='string', dest='fname',
help='pkl file to use.', default='')
p.add_option('--prior', action='store_true', dest='prior',
help='estimate tangential force using prior.')
p.add_option('--calibrate', action='store_true', dest='calibrate',
help='calibrate the sensor using the ref trajectory.')
p.add_option('--ram_db', action='store_true', dest='ram_db',
help='convert trials to ram_db format.')
p.add_option('--nm', action='store', dest='name', default='',
help='name for the ram_db dict.')
p.add_option('--simulate_percep', action='store_true', dest='simulate_percep',
help='simulate perception.')
opt, args = p.parse_args()
if opt.calibrate:
pkls_nm = glob.glob(opt.dir_nm+'/*pull*.pkl')
ref_mean, ref_std, ref_config, typ = load_ref_traj(pkls_nm[0])
cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')
cody_mn, cody_std, cody_config, _ = compute_mean_std(cody_pkls, math.radians(1.))
calibrate_least_squares(ref_mean, cody_mn)
sys.exit()
if opt.simulate_percep:
percep_std = 0.1
if opt.name == '':
name = opt.dir_nm.split('/')[0]
else:
name = opt.name
cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')
if cody_pkls != []:
simulate_perception(cody_pkls, percep_std, name+'_noisy_cody')
known_radius(cody_pkls, name+'_known_rad_cody')
pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')
if pr2_pkls != []:
simulate_perception(pr2_pkls, percep_std, name+'_noisy_pr2')
known_radius(pr2_pkls, name+'_known_rad_pr2')
sys.exit()
if opt.ram_db:
if opt.name == '':
name = opt.dir_nm.split('/')[0]
else:
name = opt.name
cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')
convert_to_ram_db(cody_pkls, name+'_cody')
pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')
convert_to_ram_db(pr2_pkls, name+'_pr2')
sys.exit()
if opt.dir_nm != '':
pkls_nm = glob.glob(opt.dir_nm+'/*pull*.pkl')
pp.figure()
ref_mean, ref_std, ref_config, typ = load_ref_traj(pkls_nm[0])
mar.plot_reference_trajectory(ref_config, ref_mean, ref_std, typ, 'Hello')
pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')
if pr2_pkls != []:
pr2_mn, pr2_std, pr2_config, _ = compute_mean_std(pr2_pkls, math.radians(1.))
c1 = 'b'
pr2_config = np.degrees(pr2_config)
pp.plot(pr2_config, pr2_mn, color=c1, label='PR2')
pp.fill_between(pr2_config, np.array(pr2_mn)+np.array(pr2_std),
np.array(pr2_mn)-np.array(pr2_std), color=c1, alpha=0.5)
cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')
if cody_pkls != []:
cody_mn, cody_std, cody_config, _ = compute_mean_std(cody_pkls, math.radians(1.))
m,c = get_cody_calibration()
cody_mn = (cody_mn - c) / m
cody_mn = cody_mn[1:]
cody_std = cody_std[1:]
cody_config = cody_config[:-1]
c1 = 'r'
cody_config = np.degrees(cody_config)
pp.plot(cody_config, cody_mn, color=c1, label='Cody')
pp.fill_between(cody_config, np.array(cody_mn)+np.array(cody_std),
np.array(cody_mn)-np.array(cody_std), color=c1, alpha=0.5)
pp.legend()
pp.show()
if opt.fname:
plot_pkl(opt.fname)
pp.legend()
pp.show()
| ajibawa-2023/Python-Code-Large/train/row_99208 | 419 | 571 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L2_C0", "label": "scipy.optimize import so", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0035, 0.0018, 0, 0.66, 0.0, 359, 0, 1, 0, 0, 359, 0, 0], "semantic": {"name": "scipy.optimize", "arg_names": [], "import_names": ["so"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.optimize as so"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L3_C0", "label": "matplotlib.pyplot import pp", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0053, 0.0018, 0, 0.66, 0.0357, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": ["pp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib.pyplot as pp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L4_C0", "label": "matplotlib_util.util import mpu", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.007, 0.0018, 0, 0.66, 0.0714, 781, 0, 1, 0, 0, 781, 0, 0], "semantic": {"name": "matplotlib_util.util", "arg_names": [], "import_names": ["mpu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib_util.util as mpu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L5_C0", "label": "numpy import np, math", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0018, 0, 0.66, 0.1071, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L6_C0", "label": "sys import sys, os, time", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0105, 0.0018, 0, 0.66, 0.1429, 509, 0, 3, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys", "os", "time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys, os, time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L7_C0", "label": "append()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0123, 0.0018, 0, 0.66, 0.1786, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "sys.path.append(os.environ['HRLBASEPATH']+'/src/projects/modeling_forces/handheld_hook')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L8_C0", "label": "ram_db import rd", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.014, 0.0018, 0, 0.66, 0.2143, 61, 0, 1, 0, 0, 61, 0, 0], "semantic": {"name": "ram_db", "arg_names": [], "import_names": ["rd"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ram_db as rd"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L9_C0", "label": "mechanism_analyse_RAM import mar", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0158, 0.0018, 0, 0.66, 0.25, 17, 0, 1, 0, 0, 17, 0, 0], "semantic": {"name": "mechanism_analyse_RAM", "arg_names": [], "import_names": ["mar"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mechanism_analyse_RAM as mar"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L10_C0", "label": "mechanism_analyse_advait import maa", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0175, 0.0018, 0, 0.66, 0.2857, 32, 0, 1, 0, 0, 32, 0, 0], "semantic": {"name": "mechanism_analyse_advait", "arg_names": [], "import_names": ["maa"], "rhs_call_name": "", "annotation": ""}, "snippet": "import mechanism_analyse_advait as maa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L12_C0", "label": "arm_trajectories import at", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.021, 0.0018, 0, 0.66, 0.3214, 34, 0, 1, 0, 0, 34, 0, 0], "semantic": {"name": "arm_trajectories", "arg_names": [], "import_names": ["at"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arm_trajectories as at"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L13_C0", "label": "tangential_force_monitor import tfm", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0228, 0.0018, 0, 0.66, 0.3571, 461, 0, 1, 0, 0, 461, 0, 0], "semantic": {"name": "tangential_force_monitor", "arg_names": [], "import_names": ["tfm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tangential_force_monitor as tfm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L15_C0", "label": "roslib import roslib", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0018, 0, 0.66, 0.3929, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L15_C15", "label": "load_manifest()", "type": "expression", "loc": [15, 15], "level": 0, "parent": null, "vector": [8, 0, 0.0263, 0.0018, 0, 0.66, 0.4286, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L16_C0", "label": "hrl_lib.util import ut, tr", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.028, 0.0018, 0, 0.66, 0.4643, 775, 0, 2, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut", "tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut, hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "label": "estimate_mechanism_kinematics", "type": "function", "loc": [20, 50], "level": 0, "parent": null, "vector": [2, 0, 0.0613, 0.0543, 0, 0.66, 0.5, 486, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "estimate_mechanism_kinematics", "arg_names": ["pull_dict", "pr2_log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def estimate_mechanism_kinematics(pull_dict, pr2_log):\n if not pr2_log:\n act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])\n force_tl = pull_dict['force']\n actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])\n cartesian_force_clean, _ = at.filter_trajectory_force(actual_cartesian,\n pull_dict['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "label": "if", "type": "if", "loc": [21, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [4, 1, 0.0525, 0.0333, 1, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not pr2_log:\n act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])\n force_tl = pull_dict['force']\n actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])\n cartesian_force_clean, _ = at.filter_trajectory_force(actual_cartesian,\n pull_dict['force'])\n pts_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L22_C8", "label": "act_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0385, 0.0018, 2, 0.73, 0.0, 476, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "act_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L23_C8", "label": "force_tl =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0403, 0.0018, 2, 0.73, 0.0833, 787, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_tl = pull_dict['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L24_C8", "label": "actual_cartesian, force_ts = account_segway_motion()", "type": "assigned_variable", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0429, 0.0035, 2, 0.73, 0.1667, 463, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "actual_cartesian, force_ts", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L26_C8", "label": "cartesian_force_clean, _ = filter_trajectory_force()", "type": "assigned_variable", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0464, 0.0035, 2, 0.73, 0.25, 298, 3, 2, 0, 0, 811, 10, 1], "semantic": {"name": "cartesian_force_clean, _", "arg_names": [], "import_names": [], "rhs_call_name": "filter_trajectory_force", "annotation": ""}, "snippet": " cartesian_force_clean, _ = at.filter_trajectory_force(actual_cartesian,\n pull_dict['force'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L28_C8", "label": "pts_list =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.049, 0.0018, 2, 0.73, 0.3333, 713, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L29_C8", "label": "pts_2d, reject_idx = filter_cartesian_trajectory()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0508, 0.0018, 2, 0.73, 0.4167, 285, 3, 1, 0, 0, 996, 10, 1], "semantic": {"name": "pts_2d, reject_idx", "arg_names": [], "import_names": [], "rhs_call_name": "filter_cartesian_trajectory", "annotation": ""}, "snippet": " pts_2d, reject_idx = at.filter_cartesian_trajectory(cartesian_force_clean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L33_C8", "label": "p_list, f_list =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0578, 0.0018, 2, 0.73, 0.5, 719, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "p_list, f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L34_C8", "label": "p_list =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0595, 0.0018, 2, 0.73, 0.5833, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = p_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L35_C8", "label": "f_list =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0613, 0.0018, 2, 0.73, 0.6667, 992, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = f_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L36_C8", "label": "pts =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.063, 0.0018, 2, 0.73, 0.75, 195, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts = np.matrix(p_list).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L37_C8", "label": "px =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0648, 0.0018, 2, 0.73, 0.8333, 422, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "px", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " px = pts[0,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L38_C8", "label": "py =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0665, 0.0018, 2, 0.73, 0.9167, 368, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "py", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " py = pts[1,:].A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L39_C8", "label": "pts_2d = matrix()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "vector": [14, 2, 0.0683, 0.0018, 2, 0.73, 1.0, 945, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " pts_2d = np.matrix(np.row_stack((px, py)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L42_C4", "label": "rad =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [14, 1, 0.0736, 0.0018, 1, 0.13, 0.1667, 439, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = 1.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L43_C4", "label": "x_guess =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [14, 1, 0.0753, 0.0018, 1, 0.13, 0.3333, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = pts_2d[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L44_C4", "label": "y_guess =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [14, 1, 0.0771, 0.0018, 1, 0.13, 0.5, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = pts_2d[1,0] - rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L45_C4", "label": "rad_guess =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [14, 1, 0.0788, 0.0018, 1, 0.13, 0.6667, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L46_C4", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [14, 1, 0.0823, 0.0053, 1, 0.13, 0.8333, 693, 3, 7, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = at.fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False,\n rad_fix=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L50_C4", "label": "return", "type": "return", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "vector": [13, 1, 0.0876, 0.0018, 1, 0.13, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rad, cx, cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "label": "force_trajectory_in_hindsight", "type": "function", "loc": [52, 93], "level": 0, "parent": null, "vector": [2, 0, 0.127, 0.0736, 0, 0.66, 0.5357, 814, 0, 3, 1, 0, 0, 0, 19], "semantic": {"name": "force_trajectory_in_hindsight", "arg_names": ["pull_dict", "mechanism_type", "pr2_log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def force_trajectory_in_hindsight(pull_dict, mechanism_type, pr2_log):\n print('_________________________________________________')\n print('starting force_trajectory_in_hindsight')\n print('_________________________________________________')\n\n if not pr2_log:\n arm = pull_dict['arm']\n act_tl = at.joint_to_cartesian(pull_dict['actual'], arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L53_C4", "label": "print()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "vector": [8, 1, 0.0928, 0.0018, 1, 0.61, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('_________________________________________________')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L54_C4", "label": "print()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "vector": [8, 1, 0.0946, 0.0018, 1, 0.61, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('starting force_trajectory_in_hindsight')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L55_C4", "label": "print()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "vector": [8, 1, 0.0963, 0.0018, 1, 0.61, 0.4, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('_________________________________________________')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "label": "if", "type": "if", "loc": [57, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "vector": [4, 1, 0.1095, 0.021, 1, 0.61, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not pr2_log:\n arm = pull_dict['arm']\n act_tl = at.joint_to_cartesian(pull_dict['actual'], arm)\n force_tl = pull_dict['force']\n actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])\n p_list = actual_cartesian.p_list\n f_list = force_ts.f_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L58_C8", "label": "arm =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1016, 0.0018, 2, 0.29, 0.0, 413, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = pull_dict['arm']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L59_C8", "label": "act_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1033, 0.0018, 2, 0.29, 0.125, 476, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "act_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " act_tl = at.joint_to_cartesian(pull_dict['actual'], arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L60_C8", "label": "force_tl =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1051, 0.0018, 2, 0.29, 0.25, 787, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_tl = pull_dict['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L61_C8", "label": "actual_cartesian, force_ts = account_segway_motion()", "type": "assigned_variable", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1077, 0.0035, 2, 0.29, 0.375, 463, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "actual_cartesian, force_ts", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L63_C8", "label": "p_list =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1103, 0.0018, 2, 0.29, 0.5, 98, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L64_C8", "label": "f_list =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1121, 0.0018, 2, 0.29, 0.625, 992, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = force_ts.f_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L66_C8", "label": "p_list, f_list =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1156, 0.0018, 2, 0.29, 0.75, 719, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "p_list, f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L67_C8", "label": "p_list =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1173, 0.0018, 2, 0.29, 0.875, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = p_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L68_C8", "label": "f_list =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "vector": [14, 2, 0.1191, 0.0018, 2, 0.29, 1.0, 992, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = f_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "label": "if", "type": "if", "loc": [70, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "vector": [4, 1, 0.141, 0.0385, 1, 0.61, 0.8, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mechanism_type == 'rotary':\n r, cx, cy = estimate_mechanism_kinematics(pull_dict, pr2_log)\n print('rad, cx, cy:', r, cx, cy)\n frad_list,ftan_list,_ = at.compute_radial_tangential_forces(f_list,\n p_list,cx,cy)\n p0 = p_list[0]\n rad_vec_init = np.matrix((p0[0]-cx, p0[1]-cy)).T\n rad_vec_init = rad_vec_init / np.linalg.norm(rad_vec_init)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L71_C8", "label": "r, cx, cy = estimate_mechanism_kinematics()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1243, 0.0018, 2, 0.01, 0.0, 330, 3, 2, 0, 0, 486, 10, 1], "semantic": {"name": "r, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "estimate_mechanism_kinematics", "annotation": ""}, "snippet": " r, cx, cy = estimate_mechanism_kinematics(pull_dict, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L72_C8", "label": "print()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [8, 2, 0.1261, 0.0018, 2, 0.01, 0.1, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('rad, cx, cy:', r, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L73_C8", "label": "frad_list, ftan_list, _ = compute_radial_tangential_forces()", "type": "assigned_variable", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1287, 0.0035, 2, 0.01, 0.2, 300, 3, 4, 0, 0, 224, 10, 1], "semantic": {"name": "frad_list, ftan_list, _", "arg_names": [], "import_names": [], "rhs_call_name": "compute_radial_tangential_forces", "annotation": ""}, "snippet": " frad_list,ftan_list,_ = at.compute_radial_tangential_forces(f_list,\n p_list,cx,cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L75_C8", "label": "p0 =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1313, 0.0018, 2, 0.01, 0.3, 477, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p0 = p_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L76_C8", "label": "rad_vec_init =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1331, 0.0018, 2, 0.01, 0.4, 423, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec_init = np.matrix((p0[0]-cx, p0[1]-cy)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L77_C8", "label": "rad_vec_init =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1349, 0.0018, 2, 0.01, 0.5, 423, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec_init = rad_vec_init / np.linalg.norm(rad_vec_init)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L78_C8", "label": "config_list =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1366, 0.0018, 2, 0.01, 0.6, 882, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "config_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " config_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "label": "for p", "type": "for", "loc": [79, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [6, 2, 0.1436, 0.0123, 2, 0.01, 0.7, 491, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in p_list:\n rvec = np.matrix((p[0]-cx, p[1]-cy)).T\n rvec = rvec / np.linalg.norm(rvec)\n ang = np.arccos((rvec.T*rad_vec_init)[0,0])\n if np.isnan(ang):\n ang = 0\n config_list.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L80_C12", "label": "rvec =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "vector": [14, 3, 0.1401, 0.0018, 3, 0.55, 0.0, 763, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rvec = np.matrix((p[0]-cx, p[1]-cy)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L81_C12", "label": "rvec =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "vector": [14, 3, 0.1419, 0.0018, 3, 0.55, 0.25, 763, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rvec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rvec = rvec / np.linalg.norm(rvec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L82_C12", "label": "ang = arccos()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "vector": [14, 3, 0.1436, 0.0018, 3, 0.55, 0.5, 762, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " ang = np.arccos((rvec.T*rad_vec_init)[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L83_C12", "label": "if", "type": "if", "loc": [83, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "vector": [4, 3, 0.1462, 0.0035, 3, 0.55, 0.75, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.isnan(ang):\n ang = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L84_C16", "label": "ang =", "type": "assigned_variable", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L83_C12", "vector": [14, 4, 0.1471, 0.0018, 4, 0.01, 0.0, 762, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L85_C12", "label": "append()", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "vector": [8, 3, 0.1489, 0.0018, 3, 0.55, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " config_list.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L87_C8", "label": "p0 =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1524, 0.0018, 2, 0.01, 0.8, 477, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p0 = p_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L88_C8", "label": "ftan_list, config_list =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [14, 2, 0.1541, 0.0018, 2, 0.01, 0.9, 198, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ftan_list, config_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_list, config_list = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L89_C8", "label": "for f, p", "type": "for", "loc": [89, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "vector": [6, 2, 0.1576, 0.0053, 2, 0.01, 1.0, 749, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "f, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, p in zip(f_list, p_list):\n config_list.append(p0[0] - p[0])\n ftan_list.append(abs(f[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L90_C12", "label": "append()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L89_C8", "vector": [8, 3, 0.1576, 0.0018, 3, 0.19, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " config_list.append(p0[0] - p[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L91_C12", "label": "append()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L89_C8", "vector": [8, 3, 0.1594, 0.0018, 3, 0.19, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ftan_list.append(abs(f[0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L93_C4", "label": "return", "type": "return", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "vector": [13, 1, 0.1629, 0.0018, 1, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return config_list, ftan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "label": "online_force_with_radius", "type": "function", "loc": [95, 151], "level": 0, "parent": null, "vector": [2, 0, 0.2154, 0.0998, 0, 0.66, 0.5714, 110, 0, 4, 1, 0, 0, 0, 24], "semantic": {"name": "online_force_with_radius", "arg_names": ["pull_dict", "pr2_log", "radius_err", "with_prior"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def online_force_with_radius(pull_dict, pr2_log, radius_err = 0.,\n with_prior = True):\n if not pr2_log:\n act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])\n force_tl = pull_dict['force']\n actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])\n p_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "label": "if", "type": "if", "loc": [97, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [4, 1, 0.1786, 0.0193, 1, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not pr2_log:\n act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])\n force_tl = pull_dict['force']\n actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])\n p_list = actual_cartesian.p_list\n f_list = force_ts.f_list\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L98_C8", "label": "act_tl = joint_to_cartesian()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1716, 0.0018, 2, 0.85, 0.0, 476, 3, 2, 0, 0, 202, 10, 1], "semantic": {"name": "act_tl", "arg_names": [], "import_names": [], "rhs_call_name": "joint_to_cartesian", "annotation": ""}, "snippet": " act_tl = at.joint_to_cartesian(pull_dict['actual'], pull_dict['arm'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L99_C8", "label": "force_tl =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1734, 0.0018, 2, 0.85, 0.1429, 787, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_tl = pull_dict['force']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L100_C8", "label": "actual_cartesian, force_ts = account_segway_motion()", "type": "assigned_variable", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.176, 0.0035, 2, 0.85, 0.2857, 463, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "actual_cartesian, force_ts", "arg_names": [], "import_names": [], "rhs_call_name": "account_segway_motion", "annotation": ""}, "snippet": " actual_cartesian, force_ts = at.account_segway_motion(act_tl,\n force_tl, pull_dict['segway'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L102_C8", "label": "p_list =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1786, 0.0018, 2, 0.85, 0.4286, 98, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = actual_cartesian.p_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L103_C8", "label": "f_list =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1804, 0.0018, 2, 0.85, 0.5714, 992, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = force_ts.f_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L105_C8", "label": "p_list, f_list =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1839, 0.0018, 2, 0.85, 0.7143, 719, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "p_list, f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L106_C8", "label": "p_list =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1856, 0.0018, 2, 0.85, 0.8571, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = p_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L107_C8", "label": "f_list =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "vector": [14, 2, 0.1874, 0.0018, 2, 0.85, 1.0, 992, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = f_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L109_C4", "label": "radius, _, _ = estimate_mechanism_kinematics()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [14, 1, 0.1909, 0.0018, 1, 0.11, 0.1111, 972, 3, 2, 0, 0, 486, 10, 1], "semantic": {"name": "radius, _, _", "arg_names": [], "import_names": [], "rhs_call_name": "estimate_mechanism_kinematics", "annotation": ""}, "snippet": " radius, _, _ = estimate_mechanism_kinematics(pull_dict, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L111_C4", "label": "print()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [8, 1, 0.1944, 0.0018, 1, 0.11, 0.2222, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('_________________________________________________')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L112_C4", "label": "print()", "type": "expression", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [8, 1, 0.1961, 0.0018, 1, 0.11, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('using radius:', radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L113_C4", "label": "print()", "type": "expression", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [8, 1, 0.1979, 0.0018, 1, 0.11, 0.4444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('_________________________________________________')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L115_C4", "label": "pts_list =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [14, 1, 0.2014, 0.0018, 1, 0.11, 0.5556, 713, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pts_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L116_C4", "label": "ftan_list =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [14, 1, 0.2032, 0.0018, 1, 0.11, 0.6667, 985, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ftan_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ftan_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L117_C4", "label": "config_list =", "type": "assigned_variable", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [14, 1, 0.2049, 0.0018, 1, 0.11, 0.7778, 882, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "config_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " config_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "label": "for f, p", "type": "for", "loc": [118, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [6, 1, 0.2338, 0.056, 1, 0.11, 0.8889, 749, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "f, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f,p in zip(f_list, p_list):\n pts_list.append(p)\n pts_2d = (np.matrix(pts_list).T)[0:2,:]\n\n x_guess = pts_list[0][0]\n y_guess = pts_list[0][1] - radius\n rad_guess = radius\n if with_prior:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L119_C8", "label": "append()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [8, 2, 0.2084, 0.0018, 2, 0.9, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pts_list.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L120_C8", "label": "pts_2d =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2102, 0.0018, 2, 0.9, 0.0588, 945, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pts_2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pts_2d = (np.matrix(pts_list).T)[0:2,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L122_C8", "label": "x_guess =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2137, 0.0018, 2, 0.9, 0.1176, 547, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_guess = pts_list[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L123_C8", "label": "y_guess =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2154, 0.0018, 2, 0.9, 0.1765, 583, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_guess = pts_list[0][1] - radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L124_C8", "label": "rad_guess =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2172, 0.0018, 2, 0.9, 0.2353, 590, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad_guess", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_guess = radius"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L125_C8", "label": "if", "type": "if", "loc": [125, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [4, 2, 0.225, 0.014, 2, 0.9, 0.2941, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_prior:\n rad, cx, cy = at.fit_circle_priors(rad_guess, x_guess,\n y_guess, pts_2d, sigma_r = 0.2, sigma_xy = 0.2,\n sigma_pts = 0.01, verbose=False)\n else:\n rad, cx, cy = at.fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False,\n rad_fix=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L126_C12", "label": "rad, cx, cy = fit_circle_priors()", "type": "assigned_variable", "loc": [126, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L125_C8", "vector": [14, 3, 0.2224, 0.0053, 3, 0.61, 0.0, 693, 3, 8, 0, 0, 342, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle_priors", "annotation": ""}, "snippet": " rad, cx, cy = at.fit_circle_priors(rad_guess, x_guess,\n y_guess, pts_2d, sigma_r = 0.2, sigma_xy = 0.2,\n sigma_pts = 0.01, verbose=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L130_C12", "label": "rad, cx, cy = fit_circle()", "type": "assigned_variable", "loc": [130, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L125_C8", "vector": [14, 3, 0.2294, 0.0053, 3, 0.61, 1.0, 693, 3, 7, 0, 0, 441, 10, 1], "semantic": {"name": "rad, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "fit_circle", "annotation": ""}, "snippet": " rad, cx, cy = at.fit_circle(rad_guess,x_guess,y_guess,pts_2d,\n method='fmin_bfgs',verbose=False,\n rad_fix=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L133_C8", "label": "print()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [8, 2, 0.2329, 0.0018, 2, 0.9, 0.3529, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('rad, cx, cy:', rad, cx, cy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L135_C8", "label": "p0 =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2364, 0.0018, 2, 0.9, 0.4118, 477, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p0 = p_list[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L136_C8", "label": "rad_vec_init =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2382, 0.0018, 2, 0.9, 0.4706, 423, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec_init = np.matrix((p0[0]-cx, p0[1]-cy)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L137_C8", "label": "rad_vec_init =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2399, 0.0018, 2, 0.9, 0.5294, 423, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec_init = rad_vec_init / np.linalg.norm(rad_vec_init)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L139_C8", "label": "rad_vec = array()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2434, 0.0018, 2, 0.9, 0.5882, 331, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " rad_vec = np.array([p[0]-cx,p[1]-cy])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L140_C8", "label": "rad_vec =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2452, 0.0018, 2, 0.9, 0.6471, 331, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rad_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad_vec = rad_vec/np.linalg.norm(rad_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L142_C8", "label": "ang = arccos()", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2487, 0.0018, 2, 0.9, 0.7059, 762, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " ang = np.arccos((rad_vec.T*rad_vec_init)[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L143_C8", "label": "append()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [8, 2, 0.2504, 0.0018, 2, 0.9, 0.7647, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " config_list.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L145_C8", "label": "tan_vec =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2539, 0.0018, 2, 0.9, 0.8235, 651, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tan_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_vec = (np.matrix([[0,-1],[1,0]]) * np.matrix(rad_vec).T).A1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L146_C8", "label": "f_vec = array()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2557, 0.0018, 2, 0.9, 0.8824, 231, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " f_vec = np.array([f[0],f[1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L148_C8", "label": "f_tan_mag = abs()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [14, 2, 0.2592, 0.0018, 2, 0.9, 0.9412, 345, 3, 1, 0, 0, 799, 10, 2], "semantic": {"name": "f_tan_mag", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " f_tan_mag = abs(np.dot(f_vec, tan_vec))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L149_C8", "label": "append()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "vector": [8, 2, 0.2609, 0.0018, 2, 0.9, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ftan_list.append(f_tan_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L151_C4", "label": "return", "type": "return", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "vector": [13, 1, 0.2644, 0.0018, 1, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return config_list, ftan_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "label": "load_ref_traj", "type": "function", "loc": [153, 175], "level": 0, "parent": null, "vector": [2, 0, 0.2872, 0.0403, 0, 0.66, 0.6071, 805, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "load_ref_traj", "arg_names": ["nm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_ref_traj(nm):\n if 'kitchen_cabinet' in nm:\n #has_tags = ['HSI_kitchen_cabinet_left']\n has_tags = ['HSI_kitchen_cabinet_right']\n elif 'lab_cabinet_recessed_left' in nm:\n has_tags = ['HSI_lab_cabinet_recessed_left']\n elif 'lab_cabinet_recessed_right' in nm:\n has_tags = ['HRL_lab_cabinet_recessed_right']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L154_C4", "label": "if", "type": "if", "loc": [154, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "vector": [4, 1, 0.2863, 0.035, 1, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'kitchen_cabinet' in nm:\n #has_tags = ['HSI_kitchen_cabinet_left']\n has_tags = ['HSI_kitchen_cabinet_right']\n elif 'lab_cabinet_recessed_left' in nm:\n has_tags = ['HSI_lab_cabinet_recessed_left']\n elif 'lab_cabinet_recessed_right' in nm:\n has_tags = ['HRL_lab_cabinet_recessed_right']\n elif 'spring_loaded_door' in nm:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L156_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L154_C4", "vector": [14, 2, 0.2732, 0.0018, 2, 0.21, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['HSI_kitchen_cabinet_right']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L157_C4", "label": "if", "type": "if", "loc": [157, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L154_C4", "vector": [4, 2, 0.289, 0.0298, 2, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'lab_cabinet_recessed_left' in nm:\n has_tags = ['HSI_lab_cabinet_recessed_left']\n elif 'lab_cabinet_recessed_right' in nm:\n has_tags = ['HRL_lab_cabinet_recessed_right']\n elif 'spring_loaded_door' in nm:\n has_tags = ['HSI_Glass_Door']\n elif 'hrl_toolchest' in nm:\n has_tags = ['HRL_toolchest_drawer_empty']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L158_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L157_C4", "vector": [14, 3, 0.2767, 0.0018, 3, 0.33, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['HSI_lab_cabinet_recessed_left']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L159_C4", "label": "if", "type": "if", "loc": [159, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L157_C4", "vector": [4, 3, 0.2907, 0.0263, 3, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'lab_cabinet_recessed_right' in nm:\n has_tags = ['HRL_lab_cabinet_recessed_right']\n elif 'spring_loaded_door' in nm:\n has_tags = ['HSI_Glass_Door']\n elif 'hrl_toolchest' in nm:\n has_tags = ['HRL_toolchest_drawer_empty']\n elif 'ikea_cabinet' in nm:\n has_tags = ['HSI_kitchen_cabinet_right']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L160_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L159_C4", "vector": [14, 4, 0.2802, 0.0018, 4, 0.51, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['HRL_lab_cabinet_recessed_right']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L161_C4", "label": "if", "type": "if", "loc": [161, 173], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L159_C4", "vector": [4, 4, 0.2925, 0.0228, 4, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'spring_loaded_door' in nm:\n has_tags = ['HSI_Glass_Door']\n elif 'hrl_toolchest' in nm:\n has_tags = ['HRL_toolchest_drawer_empty']\n elif 'ikea_cabinet' in nm:\n has_tags = ['HSI_kitchen_cabinet_right']\n #has_tags[rd.o, rd.c]\n elif 'refrigerator' in nm:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L162_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [162, 162], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L161_C4", "vector": [14, 5, 0.2837, 0.0018, 5, 0.66, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['HSI_Glass_Door']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L163_C4", "label": "if", "type": "if", "loc": [163, 173], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L161_C4", "vector": [4, 5, 0.2942, 0.0193, 5, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'hrl_toolchest' in nm:\n has_tags = ['HRL_toolchest_drawer_empty']\n elif 'ikea_cabinet' in nm:\n has_tags = ['HSI_kitchen_cabinet_right']\n #has_tags[rd.o, rd.c]\n elif 'refrigerator' in nm:\n has_tags = ['naveen_refrigerator']\n #has_tags = [rd.r]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L164_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [164, 164], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L163_C4", "vector": [14, 6, 0.2872, 0.0018, 6, 0.37, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['HRL_toolchest_drawer_empty']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L165_C4", "label": "if", "type": "if", "loc": [165, 173], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L163_C4", "vector": [4, 6, 0.296, 0.0158, 6, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'ikea_cabinet' in nm:\n has_tags = ['HSI_kitchen_cabinet_right']\n #has_tags[rd.o, rd.c]\n elif 'refrigerator' in nm:\n has_tags = ['naveen_refrigerator']\n #has_tags = [rd.r]\n else:\n #has_tags = [rd.r]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L166_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [166, 166], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L165_C4", "vector": [14, 7, 0.2907, 0.0018, 7, 0.18, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['HSI_kitchen_cabinet_right']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L168_C4", "label": "if", "type": "if", "loc": [168, 173], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L165_C4", "vector": [4, 7, 0.2986, 0.0105, 7, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'refrigerator' in nm:\n has_tags = ['naveen_refrigerator']\n #has_tags = [rd.r]\n else:\n #has_tags = [rd.r]\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L169_C8", "label": "has_tags =", "type": "assigned_variable", "loc": [169, 169], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L168_C4", "vector": [14, 8, 0.296, 0.0018, 8, 0.48, 0.0, 195, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "has_tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_tags = ['naveen_refrigerator']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L173_C8", "label": "return", "type": "return", "loc": [173, 173], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L168_C4", "vector": [13, 8, 0.303, 0.0018, 8, 0.48, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L174_C4", "label": "mn, std, config, typ = get_mean_std_config()", "type": "assigned_variable", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "vector": [14, 1, 0.3047, 0.0018, 1, 0.67, 0.5, 414, 3, 1, 0, 0, 191, 10, 1], "semantic": {"name": "mn, std, config, typ", "arg_names": [], "import_names": [], "rhs_call_name": "get_mean_std_config", "annotation": ""}, "snippet": " mn, std, config, typ = rd.get_mean_std_config(has_tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L175_C4", "label": "return", "type": "return", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "vector": [13, 1, 0.3065, 0.0018, 1, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mn, std, config, typ"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "label": "error_lists", "type": "function", "loc": [177, 205], "level": 0, "parent": null, "vector": [2, 0, 0.3345, 0.0508, 0, 0.66, 0.6429, 560, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "error_lists", "arg_names": ["ftan_l", "config_l", "ref_dict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def error_lists(ftan_l, config_l, ref_dict):\n # matching the dict expected in tangential_force_monitor.py\n ref_force_dict = {}\n ref_force_dict['tangential'] = ref_dict['mean']\n ref_force_dict['configuration'] = ref_dict['config']\n ref_force_dict['type'] = ref_dict['typ']\n ref_force_dict['name'] = ref_dict['name']\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L179_C4", "label": "ref_force_dict =", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.3135, 0.0018, 1, 0.01, 0.0, 687, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ref_force_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_force_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L180_C4", "label": "assign", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.3152, 0.0018, 1, 0.01, 0.125, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_force_dict['tangential'] = ref_dict['mean']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L181_C4", "label": "assign", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.317, 0.0018, 1, 0.01, 0.25, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_force_dict['configuration'] = ref_dict['config']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L182_C4", "label": "assign", "type": "assigned_variable", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.3187, 0.0018, 1, 0.01, 0.375, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_force_dict['type'] = ref_dict['typ']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L183_C4", "label": "assign", "type": "assigned_variable", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.3205, 0.0018, 1, 0.01, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_force_dict['name'] = ref_dict['name']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L185_C4", "label": "rel_err_list =", "type": "assigned_variable", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.324, 0.0018, 1, 0.01, 0.625, 966, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "rel_err_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rel_err_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L186_C4", "label": "abs_err_list =", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [14, 1, 0.3257, 0.0018, 1, 0.01, 0.75, 852, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "abs_err_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " abs_err_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "label": "for f, c", "type": "for", "loc": [187, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [6, 1, 0.3415, 0.0298, 1, 0.01, 0.875, 226, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "f, c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f,c in zip(ftan_l, config_l):\n hi, lo, ref_hi, ref_lo = tfm.error_from_reference(ref_force_dict, f, c)\n# if ref_hi < 5.:\n# # only consider configs where ref force is greater than 3N\n# continue\n if lo > hi:\n err = -lo\n ref = ref_lo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L188_C8", "label": "hi, lo, ref_hi, ref_lo = error_from_reference()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "vector": [14, 2, 0.3292, 0.0018, 2, 0.32, 0.0, 202, 3, 3, 0, 0, 831, 10, 1], "semantic": {"name": "hi, lo, ref_hi, ref_lo", "arg_names": [], "import_names": [], "rhs_call_name": "error_from_reference", "annotation": ""}, "snippet": " hi, lo, ref_hi, ref_lo = tfm.error_from_reference(ref_force_dict, f, c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "label": "if", "type": "if", "loc": [192, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "vector": [4, 2, 0.3406, 0.0105, 2, 0.32, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lo > hi:\n err = -lo\n ref = ref_lo\n else:\n err = hi\n ref = ref_hi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L193_C12", "label": "err =", "type": "assigned_variable", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "vector": [14, 3, 0.338, 0.0018, 3, 0.16, 0.0, 541, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = -lo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L194_C12", "label": "ref =", "type": "assigned_variable", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "vector": [14, 3, 0.3398, 0.0018, 3, 0.16, 0.3333, 686, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ref", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref = ref_lo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L196_C12", "label": "err =", "type": "assigned_variable", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "vector": [14, 3, 0.3433, 0.0018, 3, 0.16, 0.6667, 541, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = hi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L197_C12", "label": "ref =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "vector": [14, 3, 0.345, 0.0018, 3, 0.16, 1.0, 686, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ref", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref = ref_hi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L198_C8", "label": "if", "type": "if", "loc": [198, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "vector": [4, 2, 0.3476, 0.0035, 2, 0.32, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ref == 0:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L202_C8", "label": "append()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "vector": [8, 2, 0.3538, 0.0018, 2, 0.32, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " rel_err_list.append(err/ref)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L203_C8", "label": "append()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "vector": [8, 2, 0.3555, 0.0018, 2, 0.32, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " abs_err_list.append(err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L205_C4", "label": "return", "type": "return", "loc": [205, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "vector": [13, 1, 0.359, 0.0018, 1, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rel_err_list, abs_err_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "label": "plot_err_histogram", "type": "function", "loc": [207, 225], "level": 0, "parent": null, "vector": [2, 0, 0.3783, 0.0333, 0, 0.66, 0.6786, 827, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "plot_err_histogram", "arg_names": ["rel_list", "abs_list", "title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_err_histogram(rel_list, abs_list, title):\n # plot relative error histogram.\n max_err = 1.0\n bin_width = 0.05 # relative err.\n bins = np.arange(0.-bin_width/2.-max_err, max_err+2*bin_width, bin_width)\n hist, bin_edges = np.histogram(np.array(rel_list), bins)\n mpu.figure()\n mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L209_C4", "label": "max_err =", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.366, 0.0018, 1, 0.02, 0.0, 933, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_err = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L210_C4", "label": "bin_width =", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.3678, 0.0018, 1, 0.02, 0.0909, 331, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 0.05 # relative err."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L211_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.3695, 0.0018, 1, 0.02, 0.1818, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2.-max_err, max_err+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L212_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.3713, 0.0018, 1, 0.02, 0.2727, 217, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(np.array(rel_list), bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L213_C4", "label": "figure()", "type": "expression", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [8, 1, 0.373, 0.0018, 1, 0.02, 0.3636, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L214_C4", "label": "plot_histogram()", "type": "expression", "loc": [214, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [8, 1, 0.3765, 0.0053, 1, 0.02, 0.4545, 34, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=bin_width*0.8, xlabel='Relative Error',\n plot_title=title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L218_C4", "label": "max_err =", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.3818, 0.0018, 1, 0.02, 0.5455, 933, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "max_err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_err = 20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L219_C4", "label": "bin_width =", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.3835, 0.0018, 1, 0.02, 0.6364, 331, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "bin_width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_width = 2 # relative err."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L220_C4", "label": "bins = arange()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.3853, 0.0018, 1, 0.02, 0.7273, 792, 3, 3, 0, 0, 489, 10, 1], "semantic": {"name": "bins", "arg_names": [], "import_names": [], "rhs_call_name": "arange", "annotation": ""}, "snippet": " bins = np.arange(0.-bin_width/2.-max_err, max_err+2*bin_width, bin_width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L221_C4", "label": "hist, bin_edges = histogram()", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [14, 1, 0.387, 0.0018, 1, 0.02, 0.8182, 217, 3, 2, 0, 0, 428, 10, 2], "semantic": {"name": "hist, bin_edges", "arg_names": [], "import_names": [], "rhs_call_name": "histogram", "annotation": ""}, "snippet": " hist, bin_edges = np.histogram(np.array(abs_list), bins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L222_C4", "label": "figure()", "type": "expression", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [8, 1, 0.3888, 0.0018, 1, 0.02, 0.9091, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " mpu.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L223_C4", "label": "plot_histogram()", "type": "expression", "loc": [223, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "vector": [8, 1, 0.3923, 0.0053, 1, 0.02, 1.0, 34, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_histogram", "arg_names": [], "import_names": [], "rhs_call_name": "plot_histogram", "annotation": ""}, "snippet": " mpu.plot_histogram(bin_edges[:-1]+bin_width/2., hist,\n width=bin_width*0.8, xlabel='Absolute Error',\n plot_title=title)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "label": "truncate_to_config", "type": "function", "loc": [227, 230], "level": 0, "parent": null, "vector": [2, 0, 0.4002, 0.007, 0, 0.66, 0.7143, 809, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "truncate_to_config", "arg_names": ["ftan_l", "config_l", "config"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def truncate_to_config(ftan_l, config_l, config):\n idxs = np.where(np.array(config_l)<config)[0]\n idx = idxs[-1]\n return ftan_l[:idx+1], config_l[:idx+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L228_C4", "label": "idxs =", "type": "assigned_variable", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "vector": [14, 1, 0.3993, 0.0018, 1, 0.52, 0.0, 677, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "idxs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idxs = np.where(np.array(config_l)<config)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L229_C4", "label": "idx =", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "vector": [14, 1, 0.4011, 0.0018, 1, 0.52, 0.5, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = idxs[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L230_C4", "label": "return", "type": "return", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "vector": [13, 1, 0.4028, 0.0018, 1, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ftan_l[:idx+1], config_l[:idx+1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "label": "plot_pkl", "type": "function", "loc": [232, 317], "level": 0, "parent": null, "vector": [2, 0, 0.4807, 0.1506, 0, 0.66, 0.75, 628, 0, 1, 0, 0, 0, 0, 28], "semantic": {"name": "plot_pkl", "arg_names": ["pkl_nm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def plot_pkl(pkl_nm):\n pull_dict = ut.load_pickle(pkl_nm)\n\n if 'pr2' in pkl_nm:\n pr2_log = True\n h_color = 'y'\n else:\n pr2_log = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L233_C4", "label": "pull_dict = load_pickle()", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [14, 1, 0.4081, 0.0018, 1, 0.02, 0.0, 921, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pull_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pull_dict = ut.load_pickle(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "label": "if", "type": "if", "loc": [235, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.4159, 0.0105, 1, 0.02, 0.0625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'pr2' in pkl_nm:\n pr2_log = True\n h_color = 'y'\n else:\n pr2_log = False\n h_color = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L236_C8", "label": "pr2_log =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "vector": [14, 2, 0.4133, 0.0018, 2, 0.47, 0.0, 601, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pr2_log = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L237_C8", "label": "h_color =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "vector": [14, 2, 0.4151, 0.0018, 2, 0.47, 0.3333, 270, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "h_color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_color = 'y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L239_C8", "label": "pr2_log =", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "vector": [14, 2, 0.4186, 0.0018, 2, 0.47, 0.6667, 601, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pr2_log = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L240_C8", "label": "h_color =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "vector": [14, 2, 0.4203, 0.0018, 2, 0.47, 1.0, 270, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "h_color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_color = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L242_C4", "label": "t = load_ref_traj()", "type": "assigned_variable", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [14, 1, 0.4238, 0.0018, 1, 0.02, 0.125, 15, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "load_ref_traj", "annotation": ""}, "snippet": " t = load_ref_traj(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "label": "if", "type": "if", "loc": [243, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.4317, 0.014, 1, 0.02, 0.1875, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if t !=None:\n ref_mean, ref_std, ref_config, typ = t\n mar.plot_reference_trajectory(ref_config, ref_mean, ref_std, typ, 'Hello')\n ref_config = np.degrees(ref_config)\n max_config = np.max(ref_config)\n else:\n typ = 'rotary'\n max_config = 60."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L244_C8", "label": "ref_mean, ref_std, ref_config, typ =", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "vector": [14, 2, 0.4273, 0.0018, 2, 0.12, 0.0, 977, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ref_mean, ref_std, ref_config, typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_mean, ref_std, ref_config, typ = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L245_C8", "label": "plot_reference_trajectory()", "type": "expression", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "vector": [8, 2, 0.4291, 0.0018, 2, 0.12, 0.2, 272, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_reference_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "plot_reference_trajectory", "annotation": ""}, "snippet": " mar.plot_reference_trajectory(ref_config, ref_mean, ref_std, typ, 'Hello')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L246_C8", "label": "ref_config = degrees()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "vector": [14, 2, 0.4308, 0.0018, 2, 0.12, 0.4, 943, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "ref_config", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " ref_config = np.degrees(ref_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L247_C8", "label": "max_config = max()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "vector": [14, 2, 0.4326, 0.0018, 2, 0.12, 0.6, 900, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " max_config = np.max(ref_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L249_C8", "label": "typ =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "vector": [14, 2, 0.4361, 0.0018, 2, 0.12, 0.8, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L250_C8", "label": "max_config =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "vector": [14, 2, 0.4378, 0.0018, 2, 0.12, 1.0, 900, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_config = 60."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "label": "if", "type": "if", "loc": [252, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.4457, 0.0105, 1, 0.02, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pr2_log:\n o_ftan = pull_dict['ftan_list']\n o_config = pull_dict['config_list']\n else:\n o_ftan = pull_dict['online_ftan']\n o_config = pull_dict['online_ang']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L253_C8", "label": "o_ftan =", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "vector": [14, 2, 0.4431, 0.0018, 2, 0.57, 0.0, 598, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o_ftan = pull_dict['ftan_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L254_C8", "label": "o_config =", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "vector": [14, 2, 0.4448, 0.0018, 2, 0.57, 0.3333, 109, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o_config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o_config = pull_dict['config_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L256_C8", "label": "o_ftan =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "vector": [14, 2, 0.4483, 0.0018, 2, 0.57, 0.6667, 598, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o_ftan = pull_dict['online_ftan']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L257_C8", "label": "o_config =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "vector": [14, 2, 0.4501, 0.0018, 2, 0.57, 1.0, 109, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o_config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o_config = pull_dict['online_ang']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L259_C4", "label": "h_config, h_ftan = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [259, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [14, 1, 0.4545, 0.0035, 1, 0.02, 0.3125, 377, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": " h_config, h_ftan = force_trajectory_in_hindsight(pull_dict,\n typ, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "label": "if", "type": "if", "loc": [261, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.4623, 0.0123, 1, 0.02, 0.375, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n if opt.prior:\n r_config, r_ftan = online_force_with_radius(pull_dict,\n pr2_log)\n r_config = np.degrees(r_config)\n o_config = np.degrees(o_config)\n h_config = np.degrees(h_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L262_C8", "label": "if", "type": "if", "loc": [262, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "vector": [4, 2, 0.4615, 0.007, 2, 0.1, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.prior:\n r_config, r_ftan = online_force_with_radius(pull_dict,\n pr2_log)\n r_config = np.degrees(r_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L263_C12", "label": "r_config, r_ftan = online_force_with_radius()", "type": "assigned_variable", "loc": [263, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L262_C8", "vector": [14, 3, 0.4615, 0.0035, 3, 0.21, 0.0, 864, 3, 2, 0, 0, 110, 10, 1], "semantic": {"name": "r_config, r_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "online_force_with_radius", "annotation": ""}, "snippet": " r_config, r_ftan = online_force_with_radius(pull_dict,\n pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L265_C12", "label": "r_config = degrees()", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L262_C8", "vector": [14, 3, 0.4641, 0.0018, 3, 0.21, 1.0, 633, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "r_config", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " r_config = np.degrees(r_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L266_C8", "label": "o_config = degrees()", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "vector": [14, 2, 0.4658, 0.0018, 2, 0.1, 0.5, 109, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "o_config", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " o_config = np.degrees(o_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L267_C8", "label": "h_config = degrees()", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "vector": [14, 2, 0.4676, 0.0018, 2, 0.1, 1.0, 76, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "h_config", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " h_config = np.degrees(h_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L269_C4", "label": "o_ftan, o_config = truncate_to_config()", "type": "assigned_variable", "loc": [269, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [14, 1, 0.4711, 0.0018, 1, 0.02, 0.4375, 572, 3, 3, 0, 0, 809, 10, 1], "semantic": {"name": "o_ftan, o_config", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_to_config", "annotation": ""}, "snippet": " o_ftan, o_config = truncate_to_config(o_ftan, o_config, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L270_C4", "label": "h_ftan, h_config = truncate_to_config()", "type": "assigned_variable", "loc": [270, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [14, 1, 0.4729, 0.0018, 1, 0.02, 0.5, 911, 3, 3, 0, 0, 809, 10, 1], "semantic": {"name": "h_ftan, h_config", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_to_config", "annotation": ""}, "snippet": " h_ftan, h_config = truncate_to_config(h_ftan, h_config, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "label": "if", "type": "if", "loc": [272, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.4807, 0.0105, 1, 0.02, 0.5625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n if opt.prior:\n r_ftan, r_config = truncate_to_config(r_ftan, r_config, max_config)\n bin_size = 1.\n else:\n bin_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L273_C8", "label": "if", "type": "if", "loc": [273, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "vector": [4, 2, 0.479, 0.0035, 2, 0.52, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.prior:\n r_ftan, r_config = truncate_to_config(r_ftan, r_config, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L274_C12", "label": "r_ftan, r_config = truncate_to_config()", "type": "assigned_variable", "loc": [274, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L273_C8", "vector": [14, 3, 0.4799, 0.0018, 3, 0.45, 0.0, 16, 3, 3, 0, 0, 809, 10, 1], "semantic": {"name": "r_ftan, r_config", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_to_config", "annotation": ""}, "snippet": " r_ftan, r_config = truncate_to_config(r_ftan, r_config, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L275_C8", "label": "bin_size =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "vector": [14, 2, 0.4816, 0.0018, 2, 0.52, 0.5, 582, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_size = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L277_C8", "label": "bin_size =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "vector": [14, 2, 0.4851, 0.0018, 2, 0.52, 1.0, 582, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "bin_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bin_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "label": "if", "type": "if", "loc": [293, 296], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.5158, 0.007, 1, 0.02, 0.625, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not pr2_log:\n m,c = get_cody_calibration()\n o_ftan = (np.array(o_ftan) - c) / m\n h_ftan = (np.array(h_ftan) - c) / m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L294_C8", "label": "m, c = get_cody_calibration()", "type": "assigned_variable", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "vector": [14, 2, 0.5149, 0.0018, 2, 0.23, 0.0, 557, 3, 0, 0, 0, 243, 10, 1], "semantic": {"name": "m, c", "arg_names": [], "import_names": [], "rhs_call_name": "get_cody_calibration", "annotation": ""}, "snippet": " m,c = get_cody_calibration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L295_C8", "label": "o_ftan =", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "vector": [14, 2, 0.5166, 0.0018, 2, 0.23, 0.5, 598, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "o_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o_ftan = (np.array(o_ftan) - c) / m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L296_C8", "label": "h_ftan =", "type": "assigned_variable", "loc": [296, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "vector": [14, 2, 0.5184, 0.0018, 2, 0.23, 1.0, 5, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "h_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " h_ftan = (np.array(h_ftan) - c) / m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L298_C4", "label": "plot()", "type": "expression", "loc": [298, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [8, 1, 0.5219, 0.0018, 1, 0.02, 0.6875, 929, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(o_config, o_ftan, 'bo-', ms=5, label='online')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L299_C4", "label": "plot()", "type": "expression", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [8, 1, 0.5236, 0.0018, 1, 0.02, 0.75, 929, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(h_config, h_ftan, h_color+'o-', ms=5, label='hindsight')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L300_C4", "label": "if", "type": "if", "loc": [300, 303], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.528, 0.007, 1, 0.02, 0.8125, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == 'rotary':\n if opt.prior:\n r_config, r_ftan = maa.bin(r_config, r_ftan, bin_size, max, True)\n pp.plot(r_config, r_ftan, 'go-', ms=5, label='online with priors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L301_C8", "label": "if", "type": "if", "loc": [301, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L300_C4", "vector": [4, 2, 0.5289, 0.0053, 2, 0.64, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.prior:\n r_config, r_ftan = maa.bin(r_config, r_ftan, bin_size, max, True)\n pp.plot(r_config, r_ftan, 'go-', ms=5, label='online with priors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L302_C12", "label": "r_config, r_ftan = bin()", "type": "assigned_variable", "loc": [302, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L301_C8", "vector": [14, 3, 0.5289, 0.0018, 3, 0.01, 0.0, 864, 3, 5, 0, 0, 167, 10, 1], "semantic": {"name": "r_config, r_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " r_config, r_ftan = maa.bin(r_config, r_ftan, bin_size, max, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L303_C12", "label": "plot()", "type": "expression", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L301_C8", "vector": [8, 3, 0.5306, 0.0018, 3, 0.01, 1.0, 929, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(r_config, r_ftan, 'go-', ms=5, label='online with priors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L304_C4", "label": "xlabel()", "type": "expression", "loc": [304, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [8, 1, 0.5324, 0.0018, 1, 0.02, 0.875, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xlabel", "arg_names": [], "import_names": [], "rhs_call_name": "xlabel", "annotation": ""}, "snippet": " pp.xlabel('Configuration')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L305_C4", "label": "ylabel()", "type": "expression", "loc": [305, 305], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [8, 1, 0.5342, 0.0018, 1, 0.02, 0.9375, 584, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ylabel", "arg_names": [], "import_names": [], "rhs_call_name": "ylabel", "annotation": ""}, "snippet": " pp.ylabel('Tangential Force')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "label": "if", "type": "if", "loc": [307, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "vector": [4, 1, 0.5464, 0.0193, 1, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pr2_log:\n pp.figure()\n p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']\n p_list = p_list[::2]\n f_list = f_list[::2]\n x_l, y_l, z_l = zip(*p_list)\n pp.plot(x_l, y_l)\n r, cx, cy = estimate_mechanism_kinematics(pull_dict, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L308_C8", "label": "figure()", "type": "expression", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [8, 2, 0.5394, 0.0018, 2, 0.46, 0.0, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pp.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L309_C8", "label": "p_list, f_list =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [14, 2, 0.5412, 0.0018, 2, 0.46, 0.125, 719, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "p_list, f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list, f_list = pull_dict['ee_list'], pull_dict['f_list']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L310_C8", "label": "p_list =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [14, 2, 0.5429, 0.0018, 2, 0.46, 0.25, 98, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p_list = p_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L311_C8", "label": "f_list =", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [14, 2, 0.5447, 0.0018, 2, 0.46, 0.375, 992, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = f_list[::2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L312_C8", "label": "x_l, y_l, z_l = zip()", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [14, 2, 0.5464, 0.0018, 2, 0.46, 0.5, 876, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "x_l, y_l, z_l", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " x_l, y_l, z_l = zip(*p_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L313_C8", "label": "plot()", "type": "expression", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [8, 2, 0.5482, 0.0018, 2, 0.46, 0.625, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(x_l, y_l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L314_C8", "label": "r, cx, cy = estimate_mechanism_kinematics()", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [14, 2, 0.5499, 0.0018, 2, 0.46, 0.75, 330, 3, 2, 0, 0, 486, 10, 1], "semantic": {"name": "r, cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "estimate_mechanism_kinematics", "annotation": ""}, "snippet": " r, cx, cy = estimate_mechanism_kinematics(pull_dict, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L315_C8", "label": "plot_circle()", "type": "expression", "loc": [315, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [8, 2, 0.5525, 0.0035, 2, 0.46, 0.875, 365, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "plot_circle", "arg_names": [], "import_names": [], "rhs_call_name": "plot_circle", "annotation": ""}, "snippet": " mpu.plot_circle(cx, cy, r, 0., math.pi/2,\n label='Actual\\_opt', color='r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L317_C8", "label": "axis()", "type": "expression", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "vector": [8, 2, 0.5552, 0.0018, 2, 0.46, 1.0, 860, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "axis", "arg_names": [], "import_names": [], "rhs_call_name": "axis", "annotation": ""}, "snippet": " pp.axis('equal')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "label": "compute_mean_std", "type": "function", "loc": [320, 348], "level": 0, "parent": null, "vector": [2, 0, 0.5849, 0.0508, 0, 0.66, 0.7857, 50, 0, 2, 1, 0, 0, 0, 17], "semantic": {"name": "compute_mean_std", "arg_names": ["pkls", "bin_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_mean_std(pkls, bin_size):\n c_list = []\n f_list = []\n max_config = math.radians(100.)\n typ = 'rotary'\n for pkl_nm in pkls:\n pull_dict = ut.load_pickle(pkl_nm)\n pr2_log = 'pr2' in pkl_nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L321_C4", "label": "c_list =", "type": "assigned_variable", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.5622, 0.0018, 1, 0.83, 0.0, 110, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "c_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L322_C4", "label": "f_list =", "type": "assigned_variable", "loc": [322, 322], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.5639, 0.0018, 1, 0.83, 0.0909, 992, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L323_C4", "label": "max_config = radians()", "type": "assigned_variable", "loc": [323, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.5657, 0.0018, 1, 0.83, 0.1818, 900, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_config = math.radians(100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L324_C4", "label": "typ =", "type": "assigned_variable", "loc": [324, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.5674, 0.0018, 1, 0.83, 0.2727, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "label": "for pkl_nm", "type": "for", "loc": [325, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [6, 1, 0.5762, 0.0158, 1, 0.83, 0.3636, 811, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "pkl_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pkl_nm in pkls:\n pull_dict = ut.load_pickle(pkl_nm)\n pr2_log = 'pr2' in pkl_nm\n h_config, h_ftan = force_trajectory_in_hindsight(pull_dict,\n typ, pr2_log)\n #h_config, h_ftan = online_force_with_radius(pull_dict, pr2_log)\n c_list.append(h_config)\n f_list.append(h_ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L326_C8", "label": "pull_dict = load_pickle()", "type": "assigned_variable", "loc": [326, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "vector": [14, 2, 0.5709, 0.0018, 2, 0.56, 0.0, 921, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pull_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pull_dict = ut.load_pickle(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L327_C8", "label": "pr2_log =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "vector": [14, 2, 0.5727, 0.0018, 2, 0.56, 0.2, 601, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pr2_log = 'pr2' in pkl_nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L328_C8", "label": "h_config, h_ftan = force_trajectory_in_hindsight()", "type": "assigned_variable", "loc": [328, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "vector": [14, 2, 0.5753, 0.0035, 2, 0.56, 0.4, 377, 3, 3, 0, 0, 814, 10, 1], "semantic": {"name": "h_config, h_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "force_trajectory_in_hindsight", "annotation": ""}, "snippet": " h_config, h_ftan = force_trajectory_in_hindsight(pull_dict,\n typ, pr2_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L331_C8", "label": "append()", "type": "expression", "loc": [331, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "vector": [8, 2, 0.5797, 0.0018, 2, 0.56, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " c_list.append(h_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L332_C8", "label": "append()", "type": "expression", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "vector": [8, 2, 0.5814, 0.0018, 2, 0.56, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_list.append(h_ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L333_C8", "label": "max_config = min()", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "vector": [14, 2, 0.5832, 0.0018, 2, 0.56, 1.0, 900, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " max_config = min(max_config, np.max(h_config))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L335_C4", "label": "leng =", "type": "assigned_variable", "loc": [335, 335], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.5867, 0.0018, 1, 0.83, 0.4545, 858, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "leng", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " leng = int (max_config / bin_size) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L336_C4", "label": "ff =", "type": "assigned_variable", "loc": [336, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.5884, 0.0018, 1, 0.83, 0.5455, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ff = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "label": "for c, f", "type": "for", "loc": [337, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [6, 1, 0.5963, 0.014, 1, 0.83, 0.6364, 271, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "c, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c, f in zip(c_list, f_list):\n #c, f = maa.bin(c, f, bin_size, max, True)\n c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)\n f, c = truncate_to_config(f, c, max_config)\n f = np.ma.masked_array(f, np.isnan(f))\n f = f[:leng]\n c = c[:leng]\n ff.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L339_C8", "label": "c, f = bin()", "type": "assigned_variable", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "vector": [14, 2, 0.5937, 0.0018, 2, 0.94, 0.0, 271, 3, 6, 0, 0, 167, 10, 1], "semantic": {"name": "c, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L340_C8", "label": "f, c = truncate_to_config()", "type": "assigned_variable", "loc": [340, 340], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "vector": [14, 2, 0.5954, 0.0018, 2, 0.94, 0.2, 226, 3, 3, 0, 0, 809, 10, 1], "semantic": {"name": "f, c", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_to_config", "annotation": ""}, "snippet": " f, c = truncate_to_config(f, c, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L341_C8", "label": "f = masked_array()", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "vector": [14, 2, 0.5972, 0.0018, 2, 0.94, 0.4, 899, 3, 2, 0, 0, 890, 10, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "masked_array", "annotation": ""}, "snippet": " f = np.ma.masked_array(f, np.isnan(f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L342_C8", "label": "f =", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "vector": [14, 2, 0.5989, 0.0018, 2, 0.94, 0.6, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[:leng]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L343_C8", "label": "c =", "type": "assigned_variable", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "vector": [14, 2, 0.6007, 0.0018, 2, 0.94, 0.8, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = c[:leng]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L344_C8", "label": "append()", "type": "expression", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "vector": [8, 2, 0.6025, 0.0018, 2, 0.94, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ff.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L345_C4", "label": "arr = array()", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.6042, 0.0018, 1, 0.83, 0.7273, 395, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " arr = np.array(ff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L346_C4", "label": "mean = mean()", "type": "assigned_variable", "loc": [346, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.606, 0.0018, 1, 0.83, 0.8182, 856, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean = arr.mean(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L347_C4", "label": "std = std()", "type": "assigned_variable", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [14, 1, 0.6077, 0.0018, 1, 0.83, 0.9091, 616, 3, 1, 0, 0, 616, 10, 1], "semantic": {"name": "std", "arg_names": [], "import_names": [], "rhs_call_name": "std", "annotation": ""}, "snippet": " std = arr.std(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L348_C4", "label": "return", "type": "return", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "vector": [13, 1, 0.6095, 0.0018, 1, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mean, std, c, arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "label": "calibrate_least_squares", "type": "function", "loc": [350, 365], "level": 0, "parent": null, "vector": [2, 0, 0.6261, 0.028, 0, 0.66, 0.8214, 166, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "calibrate_least_squares", "arg_names": ["ref_mean", "sensor_mean"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def calibrate_least_squares(ref_mean, sensor_mean):\n ref_mean = np.array(ref_mean)\n length = min(ref_mean.shape[0], sensor_mean.shape[0])\n ref_mean = ref_mean[:length]\n sensor_mean = sensor_mean[:length]\n def error_function(params):\n m, c = params[0], params[1]\n sensor_predict = m * ref_mean + c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L351_C4", "label": "ref_mean = array()", "type": "assigned_variable", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [14, 1, 0.6147, 0.0018, 1, 0.73, 0.0, 947, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "ref_mean", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " ref_mean = np.array(ref_mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L352_C4", "label": "length = min()", "type": "assigned_variable", "loc": [352, 352], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [14, 1, 0.6165, 0.0018, 1, 0.73, 0.1429, 221, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " length = min(ref_mean.shape[0], sensor_mean.shape[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L353_C4", "label": "ref_mean =", "type": "assigned_variable", "loc": [353, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [14, 1, 0.6182, 0.0018, 1, 0.73, 0.2857, 947, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ref_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ref_mean = ref_mean[:length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L354_C4", "label": "sensor_mean =", "type": "assigned_variable", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [14, 1, 0.62, 0.0018, 1, 0.73, 0.4286, 16, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sensor_mean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sensor_mean = sensor_mean[:length]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "label": "error_function", "type": "function", "loc": [355, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [2, 1, 0.6252, 0.0088, 1, 0.73, 0.5714, 875, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "error_function", "arg_names": ["params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error_function(params):\n m, c = params[0], params[1]\n sensor_predict = m * ref_mean + c\n err = (sensor_predict - sensor_mean)\n return np.sum((err * err) * np.abs(ref_mean))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L356_C8", "label": "m, c =", "type": "assigned_variable", "loc": [356, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "vector": [14, 2, 0.6235, 0.0018, 2, 0.18, 0.0, 557, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "m, c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m, c = params[0], params[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L357_C8", "label": "sensor_predict =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "vector": [14, 2, 0.6252, 0.0018, 2, 0.18, 0.3333, 411, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sensor_predict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sensor_predict = m * ref_mean + c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L358_C8", "label": "err =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "vector": [14, 2, 0.627, 0.0018, 2, 0.18, 0.6667, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = (sensor_predict - sensor_mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L359_C8", "label": "return", "type": "return", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "vector": [13, 2, 0.6287, 0.0018, 2, 0.18, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.sum((err * err) * np.abs(ref_mean))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L362_C4", "label": "params =", "type": "assigned_variable", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [14, 1, 0.634, 0.0018, 1, 0.73, 0.7143, 206, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = [1., 0.]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L363_C4", "label": "r = fmin_bfgs()", "type": "assigned_variable", "loc": [363, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [14, 1, 0.6366, 0.0035, 1, 0.73, 0.8571, 436, 3, 5, 0, 0, 613, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "fmin_bfgs", "annotation": ""}, "snippet": " r = so.fmin_bfgs(error_function, params, full_output=1,\n disp = False, gtol=1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L365_C4", "label": "print()", "type": "expression", "loc": [365, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "vector": [8, 1, 0.6392, 0.0018, 1, 0.73, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Optimization result:', r[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "label": "get_cody_calibration", "type": "function", "loc": [367, 372], "level": 0, "parent": null, "vector": [2, 0, 0.6471, 0.0105, 0, 0.66, 0.8571, 243, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "get_cody_calibration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_cody_calibration():\n m = 1.13769405\n c = 2.22946475\n # sensor = m * ref + c\n m, c = 1., 0.\n return m, c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L368_C4", "label": "m =", "type": "assigned_variable", "loc": [368, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "vector": [14, 1, 0.6445, 0.0018, 1, 0.24, 0.0, 711, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = 1.13769405"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L369_C4", "label": "c =", "type": "assigned_variable", "loc": [369, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "vector": [14, 1, 0.6462, 0.0018, 1, 0.24, 0.3333, 411, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = 2.22946475"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L371_C4", "label": "m, c =", "type": "assigned_variable", "loc": [371, 371], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "vector": [14, 1, 0.6497, 0.0018, 1, 0.24, 0.6667, 557, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "m, c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m, c = 1., 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L372_C4", "label": "return", "type": "return", "loc": [372, 372], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "vector": [13, 1, 0.6515, 0.0018, 1, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return m, c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "label": "convert_to_ram_db", "type": "function", "loc": [374, 388], "level": 0, "parent": null, "vector": [2, 0, 0.6673, 0.0263, 0, 0.66, 0.8929, 250, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "convert_to_ram_db", "arg_names": ["pkls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def convert_to_ram_db(pkls, name):\n if pkls == []:\n return\n bin_size = math.radians(1.)\n mean, std, c, arr = compute_mean_std(pkls, bin_size)\n\n d = {}\n d['std'] = std"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L375_C4", "label": "if", "type": "if", "loc": [375, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [4, 1, 0.6576, 0.0035, 1, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pkls == []:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L376_C8", "label": "return", "type": "return", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L375_C4", "vector": [13, 2, 0.6585, 0.0018, 2, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L377_C4", "label": "bin_size = radians()", "type": "assigned_variable", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6602, 0.0018, 1, 0.09, 0.0909, 582, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "bin_size", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " bin_size = math.radians(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L378_C4", "label": "mean, std, c, arr = compute_mean_std()", "type": "assigned_variable", "loc": [378, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.662, 0.0018, 1, 0.09, 0.1818, 710, 3, 2, 0, 0, 50, 10, 1], "semantic": {"name": "mean, std, c, arr", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mean_std", "annotation": ""}, "snippet": " mean, std, c, arr = compute_mean_std(pkls, bin_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L380_C4", "label": "d =", "type": "assigned_variable", "loc": [380, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6655, 0.0018, 1, 0.09, 0.2727, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L381_C4", "label": "assign", "type": "assigned_variable", "loc": [381, 381], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6673, 0.0018, 1, 0.09, 0.3636, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['std'] = std"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L382_C4", "label": "assign", "type": "assigned_variable", "loc": [382, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.669, 0.0018, 1, 0.09, 0.4545, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['mean'] = mean"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L383_C4", "label": "assign", "type": "assigned_variable", "loc": [383, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6708, 0.0018, 1, 0.09, 0.5455, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['rad'] = -3.141592"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L384_C4", "label": "assign", "type": "assigned_variable", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6725, 0.0018, 1, 0.09, 0.6364, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['name'] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L385_C4", "label": "assign", "type": "assigned_variable", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6743, 0.0018, 1, 0.09, 0.7273, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['config'] = c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L386_C4", "label": " = tolist()", "type": "assigned_variable", "loc": [386, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.676, 0.0018, 1, 0.09, 0.8182, 0, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " d['vec_list'] = arr.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L387_C4", "label": "assign", "type": "assigned_variable", "loc": [387, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [14, 1, 0.6778, 0.0018, 1, 0.09, 0.9091, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['typ'] = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L388_C4", "label": "save_pickle()", "type": "expression", "loc": [388, 388], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "vector": [8, 1, 0.6795, 0.0018, 1, 0.09, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, name+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "label": "simulate_perception", "type": "function", "loc": [391, 430], "level": 0, "parent": null, "vector": [2, 0, 0.7189, 0.0701, 0, 0.66, 0.9286, 62, 0, 3, 0, 0, 0, 0, 22], "semantic": {"name": "simulate_perception", "arg_names": ["pkls", "percep_std", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def simulate_perception(pkls, percep_std, name):\n c_list = []\n f_list = []\n trials_per_pkl = 5\n bin_size = math.radians(1.)\n max_config = math.radians(100.)\n for pkl_nm in pkls:\n pull_dict = ut.load_pickle(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L392_C4", "label": "c_list =", "type": "assigned_variable", "loc": [392, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.6865, 0.0018, 1, 0.15, 0.0, 110, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "c_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L393_C4", "label": "f_list =", "type": "assigned_variable", "loc": [393, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.6883, 0.0018, 1, 0.15, 0.05, 992, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L394_C4", "label": "trials_per_pkl =", "type": "assigned_variable", "loc": [394, 394], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.69, 0.0018, 1, 0.15, 0.1, 639, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "trials_per_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trials_per_pkl = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L395_C4", "label": "bin_size = radians()", "type": "assigned_variable", "loc": [395, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.6918, 0.0018, 1, 0.15, 0.15, 582, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "bin_size", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " bin_size = math.radians(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L396_C4", "label": "max_config = radians()", "type": "assigned_variable", "loc": [396, 396], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.6935, 0.0018, 1, 0.15, 0.2, 900, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_config = math.radians(100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "label": "for pkl_nm", "type": "for", "loc": [397, 407], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [6, 1, 0.704, 0.0193, 1, 0.15, 0.25, 811, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "pkl_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pkl_nm in pkls:\n pull_dict = ut.load_pickle(pkl_nm)\n pr2_log = 'pr2' in pkl_nm\n\n for t in range(trials_per_pkl):\n radius_err = np.random.normal(scale=percep_std)\n #radius_err = np.random.uniform(-percep_std, percep_std)\n h_config, h_ftan = online_force_with_radius(pull_dict, pr2_log, radius_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L398_C8", "label": "pull_dict = load_pickle()", "type": "assigned_variable", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "vector": [14, 2, 0.697, 0.0018, 2, 0.23, 0.0, 921, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pull_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pull_dict = ut.load_pickle(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L399_C8", "label": "pr2_log =", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "vector": [14, 2, 0.6988, 0.0018, 2, 0.23, 0.5, 601, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pr2_log = 'pr2' in pkl_nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "label": "for t", "type": "for", "loc": [401, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "vector": [6, 2, 0.7075, 0.0123, 2, 0.23, 1.0, 15, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for t in range(trials_per_pkl):\n radius_err = np.random.normal(scale=percep_std)\n #radius_err = np.random.uniform(-percep_std, percep_std)\n h_config, h_ftan = online_force_with_radius(pull_dict, pr2_log, radius_err)\n c_list.append(h_config)\n f_list.append(h_ftan)\n max_config = min(max_config, np.max(h_config))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L402_C12", "label": "radius_err = normal()", "type": "assigned_variable", "loc": [402, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "vector": [14, 3, 0.704, 0.0018, 3, 0.83, 0.0, 950, 3, 1, 0, 0, 444, 10, 1], "semantic": {"name": "radius_err", "arg_names": [], "import_names": [], "rhs_call_name": "normal", "annotation": ""}, "snippet": " radius_err = np.random.normal(scale=percep_std)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L404_C12", "label": "h_config, h_ftan = online_force_with_radius()", "type": "assigned_variable", "loc": [404, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "vector": [14, 3, 0.7075, 0.0018, 3, 0.83, 0.25, 377, 3, 3, 0, 0, 110, 10, 1], "semantic": {"name": "h_config, h_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "online_force_with_radius", "annotation": ""}, "snippet": " h_config, h_ftan = online_force_with_radius(pull_dict, pr2_log, radius_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L405_C12", "label": "append()", "type": "expression", "loc": [405, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "vector": [8, 3, 0.7093, 0.0018, 3, 0.83, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " c_list.append(h_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L406_C12", "label": "append()", "type": "expression", "loc": [406, 406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "vector": [8, 3, 0.711, 0.0018, 3, 0.83, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_list.append(h_ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L407_C12", "label": "max_config = min()", "type": "assigned_variable", "loc": [407, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "vector": [14, 3, 0.7128, 0.0018, 3, 0.83, 1.0, 900, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " max_config = min(max_config, np.max(h_config))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L409_C4", "label": "leng =", "type": "assigned_variable", "loc": [409, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7163, 0.0018, 1, 0.15, 0.3, 858, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "leng", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " leng = int (max_config / bin_size) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L410_C4", "label": "ff =", "type": "assigned_variable", "loc": [410, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.718, 0.0018, 1, 0.15, 0.35, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ff = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "label": "for c, f", "type": "for", "loc": [411, 417], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [6, 1, 0.725, 0.0123, 1, 0.15, 0.4, 271, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "c, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c, f in zip(c_list, f_list):\n c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)\n f, c = truncate_to_config(f, c, max_config)\n f = np.ma.masked_array(f, np.isnan(f))\n f = f[:leng]\n c = c[:leng]\n ff.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L412_C8", "label": "c, f = bin()", "type": "assigned_variable", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "vector": [14, 2, 0.7215, 0.0018, 2, 0.1, 0.0, 271, 3, 6, 0, 0, 167, 10, 1], "semantic": {"name": "c, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L413_C8", "label": "f, c = truncate_to_config()", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "vector": [14, 2, 0.7233, 0.0018, 2, 0.1, 0.2, 226, 3, 3, 0, 0, 809, 10, 1], "semantic": {"name": "f, c", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_to_config", "annotation": ""}, "snippet": " f, c = truncate_to_config(f, c, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L414_C8", "label": "f = masked_array()", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "vector": [14, 2, 0.725, 0.0018, 2, 0.1, 0.4, 899, 3, 2, 0, 0, 890, 10, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "masked_array", "annotation": ""}, "snippet": " f = np.ma.masked_array(f, np.isnan(f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L415_C8", "label": "f =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "vector": [14, 2, 0.7268, 0.0018, 2, 0.1, 0.6, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[:leng]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L416_C8", "label": "c =", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "vector": [14, 2, 0.7285, 0.0018, 2, 0.1, 0.8, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = c[:leng]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L417_C8", "label": "append()", "type": "expression", "loc": [417, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "vector": [8, 2, 0.7303, 0.0018, 2, 0.1, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ff.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L418_C4", "label": "arr = array()", "type": "assigned_variable", "loc": [418, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.732, 0.0018, 1, 0.15, 0.45, 395, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " arr = np.array(ff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L419_C4", "label": "mean = mean()", "type": "assigned_variable", "loc": [419, 419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7338, 0.0018, 1, 0.15, 0.5, 856, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean = arr.mean(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L420_C4", "label": "std = std()", "type": "assigned_variable", "loc": [420, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7356, 0.0018, 1, 0.15, 0.55, 616, 3, 1, 0, 0, 616, 10, 1], "semantic": {"name": "std", "arg_names": [], "import_names": [], "rhs_call_name": "std", "annotation": ""}, "snippet": " std = arr.std(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L422_C4", "label": "d =", "type": "assigned_variable", "loc": [422, 422], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7391, 0.0018, 1, 0.15, 0.6, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L423_C4", "label": "assign", "type": "assigned_variable", "loc": [423, 423], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7408, 0.0018, 1, 0.15, 0.65, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['std'] = std"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L424_C4", "label": "assign", "type": "assigned_variable", "loc": [424, 424], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7426, 0.0018, 1, 0.15, 0.7, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['mean'] = mean"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L425_C4", "label": "assign", "type": "assigned_variable", "loc": [425, 425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7443, 0.0018, 1, 0.15, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['rad'] = -3.141592"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L426_C4", "label": "assign", "type": "assigned_variable", "loc": [426, 426], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7461, 0.0018, 1, 0.15, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['name'] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L427_C4", "label": "assign", "type": "assigned_variable", "loc": [427, 427], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7478, 0.0018, 1, 0.15, 0.85, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['config'] = c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L428_C4", "label": " = tolist()", "type": "assigned_variable", "loc": [428, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7496, 0.0018, 1, 0.15, 0.9, 0, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " d['vec_list'] = arr.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L429_C4", "label": "assign", "type": "assigned_variable", "loc": [429, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [14, 1, 0.7513, 0.0018, 1, 0.15, 0.95, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['typ'] = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L430_C4", "label": "save_pickle()", "type": "expression", "loc": [430, 430], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "vector": [8, 1, 0.7531, 0.0018, 1, 0.15, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, name+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "label": "known_radius", "type": "function", "loc": [432, 470], "level": 0, "parent": null, "vector": [2, 0, 0.7898, 0.0683, 0, 0.66, 0.9643, 993, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "known_radius", "arg_names": ["pkls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def known_radius(pkls, name):\n c_list = []\n f_list = []\n trials_per_pkl = 1\n bin_size = math.radians(1.)\n max_config = math.radians(100.)\n for pkl_nm in pkls:\n pull_dict = ut.load_pickle(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L433_C4", "label": "c_list =", "type": "assigned_variable", "loc": [433, 433], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7583, 0.0018, 1, 0.67, 0.0, 110, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "c_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L434_C4", "label": "f_list =", "type": "assigned_variable", "loc": [434, 434], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7601, 0.0018, 1, 0.67, 0.05, 992, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L435_C4", "label": "trials_per_pkl =", "type": "assigned_variable", "loc": [435, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7618, 0.0018, 1, 0.67, 0.1, 639, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "trials_per_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trials_per_pkl = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L436_C4", "label": "bin_size = radians()", "type": "assigned_variable", "loc": [436, 436], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7636, 0.0018, 1, 0.67, 0.15, 582, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "bin_size", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " bin_size = math.radians(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L437_C4", "label": "max_config = radians()", "type": "assigned_variable", "loc": [437, 437], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7653, 0.0018, 1, 0.67, 0.2, 900, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " max_config = math.radians(100.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "label": "for pkl_nm", "type": "for", "loc": [438, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [6, 1, 0.775, 0.0175, 1, 0.67, 0.25, 811, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "pkl_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pkl_nm in pkls:\n pull_dict = ut.load_pickle(pkl_nm)\n pr2_log = 'pr2' in pkl_nm\n\n for t in range(trials_per_pkl):\n h_config, h_ftan = online_force_with_radius(pull_dict,\n pr2_log, with_prior = False)\n c_list.append(h_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L439_C8", "label": "pull_dict = load_pickle()", "type": "assigned_variable", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "vector": [14, 2, 0.7688, 0.0018, 2, 0.29, 0.0, 921, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "pull_dict", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " pull_dict = ut.load_pickle(pkl_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L440_C8", "label": "pr2_log =", "type": "assigned_variable", "loc": [440, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "vector": [14, 2, 0.7706, 0.0018, 2, 0.29, 0.5, 601, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pr2_log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pr2_log = 'pr2' in pkl_nm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "label": "for t", "type": "for", "loc": [442, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "vector": [6, 2, 0.7785, 0.0105, 2, 0.29, 1.0, 15, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for t in range(trials_per_pkl):\n h_config, h_ftan = online_force_with_radius(pull_dict,\n pr2_log, with_prior = False)\n c_list.append(h_config)\n f_list.append(h_ftan)\n max_config = min(max_config, np.max(h_config))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L443_C12", "label": "h_config, h_ftan = online_force_with_radius()", "type": "assigned_variable", "loc": [443, 444], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "vector": [14, 3, 0.7767, 0.0035, 3, 0.74, 0.0, 377, 3, 3, 0, 0, 110, 10, 1], "semantic": {"name": "h_config, h_ftan", "arg_names": [], "import_names": [], "rhs_call_name": "online_force_with_radius", "annotation": ""}, "snippet": " h_config, h_ftan = online_force_with_radius(pull_dict,\n pr2_log, with_prior = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L445_C12", "label": "append()", "type": "expression", "loc": [445, 445], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "vector": [8, 3, 0.7793, 0.0018, 3, 0.74, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " c_list.append(h_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L446_C12", "label": "append()", "type": "expression", "loc": [446, 446], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "vector": [8, 3, 0.7811, 0.0018, 3, 0.74, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " f_list.append(h_ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L447_C12", "label": "max_config = min()", "type": "assigned_variable", "loc": [447, 447], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "vector": [14, 3, 0.7828, 0.0018, 3, 0.74, 1.0, 900, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "max_config", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " max_config = min(max_config, np.max(h_config))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L449_C4", "label": "leng =", "type": "assigned_variable", "loc": [449, 449], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7863, 0.0018, 1, 0.67, 0.3, 858, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "leng", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " leng = int (max_config / bin_size) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L450_C4", "label": "ff =", "type": "assigned_variable", "loc": [450, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.7881, 0.0018, 1, 0.67, 0.35, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ff = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "label": "for c, f", "type": "for", "loc": [451, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [6, 1, 0.7951, 0.0123, 1, 0.67, 0.4, 271, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "c, f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c, f in zip(c_list, f_list):\n c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)\n f, c = truncate_to_config(f, c, max_config)\n f = np.ma.masked_array(f, np.isnan(f))\n f = f[:leng]\n c = c[:leng]\n ff.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L452_C8", "label": "c, f = bin()", "type": "assigned_variable", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "vector": [14, 2, 0.7916, 0.0018, 2, 0.06, 0.0, 271, 3, 6, 0, 0, 167, 10, 1], "semantic": {"name": "c, f", "arg_names": [], "import_names": [], "rhs_call_name": "bin", "annotation": ""}, "snippet": " c, f = maa.bin(c, f, bin_size, np.mean, False, empty_value = np.nan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L453_C8", "label": "f, c = truncate_to_config()", "type": "assigned_variable", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "vector": [14, 2, 0.7933, 0.0018, 2, 0.06, 0.2, 226, 3, 3, 0, 0, 809, 10, 1], "semantic": {"name": "f, c", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_to_config", "annotation": ""}, "snippet": " f, c = truncate_to_config(f, c, max_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L454_C8", "label": "f = masked_array()", "type": "assigned_variable", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "vector": [14, 2, 0.7951, 0.0018, 2, 0.06, 0.4, 899, 3, 2, 0, 0, 890, 10, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "masked_array", "annotation": ""}, "snippet": " f = np.ma.masked_array(f, np.isnan(f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L455_C8", "label": "f =", "type": "assigned_variable", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "vector": [14, 2, 0.7968, 0.0018, 2, 0.06, 0.6, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[:leng]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L456_C8", "label": "c =", "type": "assigned_variable", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "vector": [14, 2, 0.7986, 0.0018, 2, 0.06, 0.8, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = c[:leng]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L457_C8", "label": "append()", "type": "expression", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "vector": [8, 2, 0.8004, 0.0018, 2, 0.06, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ff.append(f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L458_C4", "label": "arr = array()", "type": "assigned_variable", "loc": [458, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8021, 0.0018, 1, 0.67, 0.45, 395, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "arr", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " arr = np.array(ff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L459_C4", "label": "mean = mean()", "type": "assigned_variable", "loc": [459, 459], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8039, 0.0018, 1, 0.67, 0.5, 856, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "mean", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " mean = arr.mean(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L460_C4", "label": "std = std()", "type": "assigned_variable", "loc": [460, 460], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8056, 0.0018, 1, 0.67, 0.55, 616, 3, 1, 0, 0, 616, 10, 1], "semantic": {"name": "std", "arg_names": [], "import_names": [], "rhs_call_name": "std", "annotation": ""}, "snippet": " std = arr.std(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L462_C4", "label": "d =", "type": "assigned_variable", "loc": [462, 462], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8091, 0.0018, 1, 0.67, 0.6, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L463_C4", "label": "assign", "type": "assigned_variable", "loc": [463, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8109, 0.0018, 1, 0.67, 0.65, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['std'] = std"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L464_C4", "label": "assign", "type": "assigned_variable", "loc": [464, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8126, 0.0018, 1, 0.67, 0.7, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['mean'] = mean"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L465_C4", "label": "assign", "type": "assigned_variable", "loc": [465, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8144, 0.0018, 1, 0.67, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['rad'] = -3.141592"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L466_C4", "label": "assign", "type": "assigned_variable", "loc": [466, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8161, 0.0018, 1, 0.67, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['name'] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L467_C4", "label": "assign", "type": "assigned_variable", "loc": [467, 467], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8179, 0.0018, 1, 0.67, 0.85, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['config'] = c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L468_C4", "label": " = tolist()", "type": "assigned_variable", "loc": [468, 468], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8196, 0.0018, 1, 0.67, 0.9, 0, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " d['vec_list'] = arr.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L469_C4", "label": "assign", "type": "assigned_variable", "loc": [469, 469], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [14, 1, 0.8214, 0.0018, 1, 0.67, 0.95, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d['typ'] = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L470_C4", "label": "save_pickle()", "type": "expression", "loc": [470, 470], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "vector": [8, 1, 0.8231, 0.0018, 1, 0.67, 1.0, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, name+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "label": "if", "type": "if", "loc": [473, 569], "level": 0, "parent": null, "vector": [4, 0, 0.9124, 0.1699, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 60], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import optparse\n import glob\n p = optparse.OptionParser()\n p.add_option('-d', action='store', type='string', dest='dir_nm',\n help='plot all the pkls in the directory.', default='')\n p.add_option('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L474_C4", "label": "optparse import optparse", "type": "import", "loc": [474, 474], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [1, 1, 0.8301, 0.0018, 1, 0.74, 0.0, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": " import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L475_C4", "label": "glob import glob", "type": "import", "loc": [475, 475], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [1, 1, 0.8319, 0.0018, 1, 0.74, 0.0667, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_name": "", "annotation": ""}, "snippet": " import glob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L476_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [476, 476], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [14, 1, 0.8336, 0.0018, 1, 0.74, 0.1333, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = optparse.OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L477_C4", "label": "add_option()", "type": "expression", "loc": [477, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8363, 0.0035, 1, 0.74, 0.2, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-d', action='store', type='string', dest='dir_nm',\n help='plot all the pkls in the directory.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L479_C4", "label": "add_option()", "type": "expression", "loc": [479, 480], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8398, 0.0035, 1, 0.74, 0.2667, 176, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-f', action='store', type='string', dest='fname',\n help='pkl file to use.', default='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L481_C4", "label": "add_option()", "type": "expression", "loc": [481, 482], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8433, 0.0035, 1, 0.74, 0.3333, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--prior', action='store_true', dest='prior',\n help='estimate tangential force using prior.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L483_C4", "label": "add_option()", "type": "expression", "loc": [483, 484], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8468, 0.0035, 1, 0.74, 0.4, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--calibrate', action='store_true', dest='calibrate',\n help='calibrate the sensor using the ref trajectory.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L485_C4", "label": "add_option()", "type": "expression", "loc": [485, 486], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8503, 0.0035, 1, 0.74, 0.4667, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--ram_db', action='store_true', dest='ram_db',\n help='convert trials to ram_db format.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L487_C4", "label": "add_option()", "type": "expression", "loc": [487, 488], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8538, 0.0035, 1, 0.74, 0.5333, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--nm', action='store', dest='name', default='',\n help='name for the ram_db dict.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L489_C4", "label": "add_option()", "type": "expression", "loc": [489, 490], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [8, 1, 0.8573, 0.0035, 1, 0.74, 0.6, 176, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('--simulate_percep', action='store_true', dest='simulate_percep',\n help='simulate perception.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L492_C4", "label": "opt, args = parse_args()", "type": "assigned_variable", "loc": [492, 492], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [14, 1, 0.8616, 0.0018, 1, 0.74, 0.6667, 852, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opt, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " opt, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "label": "if", "type": "if", "loc": [494, 500], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [4, 1, 0.8704, 0.0123, 1, 0.74, 0.7333, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.calibrate:\n pkls_nm = glob.glob(opt.dir_nm+'/*pull*.pkl')\n ref_mean, ref_std, ref_config, typ = load_ref_traj(pkls_nm[0])\n cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')\n cody_mn, cody_std, cody_config, _ = compute_mean_std(cody_pkls, math.radians(1.))\n calibrate_least_squares(ref_mean, cody_mn)\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L495_C8", "label": "pkls_nm = glob()", "type": "assigned_variable", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "vector": [14, 2, 0.8669, 0.0018, 2, 0.26, 0.0, 885, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pkls_nm", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pkls_nm = glob.glob(opt.dir_nm+'/*pull*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L496_C8", "label": "ref_mean, ref_std, ref_config, typ = load_ref_traj()", "type": "assigned_variable", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "vector": [14, 2, 0.8687, 0.0018, 2, 0.26, 0.2, 977, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "ref_mean, ref_std, ref_config, typ", "arg_names": [], "import_names": [], "rhs_call_name": "load_ref_traj", "annotation": ""}, "snippet": " ref_mean, ref_std, ref_config, typ = load_ref_traj(pkls_nm[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L497_C8", "label": "cody_pkls = glob()", "type": "assigned_variable", "loc": [497, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "vector": [14, 2, 0.8704, 0.0018, 2, 0.26, 0.4, 523, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "cody_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L498_C8", "label": "cody_mn, cody_std, cody_config, _ = compute_mean_std()", "type": "assigned_variable", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "vector": [14, 2, 0.8722, 0.0018, 2, 0.26, 0.6, 446, 3, 2, 0, 0, 50, 10, 2], "semantic": {"name": "cody_mn, cody_std, cody_config, _", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mean_std", "annotation": ""}, "snippet": " cody_mn, cody_std, cody_config, _ = compute_mean_std(cody_pkls, math.radians(1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L499_C8", "label": "calibrate_least_squares()", "type": "expression", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "vector": [8, 2, 0.8739, 0.0018, 2, 0.26, 0.8, 166, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "calibrate_least_squares", "arg_names": [], "import_names": [], "rhs_call_name": "calibrate_least_squares", "annotation": ""}, "snippet": " calibrate_least_squares(ref_mean, cody_mn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L500_C8", "label": "exit()", "type": "expression", "loc": [500, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "vector": [8, 2, 0.8757, 0.0018, 2, 0.26, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "label": "if", "type": "if", "loc": [503, 518], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [4, 1, 0.894, 0.028, 1, 0.74, 0.8, 0, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.simulate_percep:\n percep_std = 0.1\n if opt.name == '':\n name = opt.dir_nm.split('/')[0]\n else:\n name = opt.name\n cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')\n if cody_pkls != []:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L504_C8", "label": "percep_std =", "type": "assigned_variable", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [14, 2, 0.8827, 0.0018, 2, 0.06, 0.0, 209, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "percep_std", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percep_std = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L505_C8", "label": "if", "type": "if", "loc": [505, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [4, 2, 0.887, 0.007, 2, 0.06, 0.1667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.name == '':\n name = opt.dir_nm.split('/')[0]\n else:\n name = opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L506_C12", "label": "name =", "type": "assigned_variable", "loc": [506, 506], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L505_C8", "vector": [14, 3, 0.8862, 0.0018, 3, 0.6, 0.0, 57, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = opt.dir_nm.split('/')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L508_C12", "label": "name =", "type": "assigned_variable", "loc": [508, 508], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L505_C8", "vector": [14, 3, 0.8897, 0.0018, 3, 0.6, 1.0, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L509_C8", "label": "cody_pkls = glob()", "type": "assigned_variable", "loc": [509, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [14, 2, 0.8914, 0.0018, 2, 0.06, 0.3333, 523, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "cody_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L510_C8", "label": "if", "type": "if", "loc": [510, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [4, 2, 0.8949, 0.0053, 2, 0.06, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cody_pkls != []:\n simulate_perception(cody_pkls, percep_std, name+'_noisy_cody')\n known_radius(cody_pkls, name+'_known_rad_cody')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L511_C12", "label": "simulate_perception()", "type": "expression", "loc": [511, 511], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L510_C8", "vector": [8, 3, 0.8949, 0.0018, 3, 0.22, 0.0, 62, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "simulate_perception", "arg_names": [], "import_names": [], "rhs_call_name": "simulate_perception", "annotation": ""}, "snippet": " simulate_perception(cody_pkls, percep_std, name+'_noisy_cody')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L512_C12", "label": "known_radius()", "type": "expression", "loc": [512, 512], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L510_C8", "vector": [8, 3, 0.8967, 0.0018, 3, 0.22, 1.0, 993, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "known_radius", "arg_names": [], "import_names": [], "rhs_call_name": "known_radius", "annotation": ""}, "snippet": " known_radius(cody_pkls, name+'_known_rad_cody')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L513_C8", "label": "pr2_pkls = glob()", "type": "assigned_variable", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [14, 2, 0.8984, 0.0018, 2, 0.06, 0.6667, 502, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pr2_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L514_C8", "label": "if", "type": "if", "loc": [514, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [4, 2, 0.9019, 0.0053, 2, 0.06, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pr2_pkls != []:\n simulate_perception(pr2_pkls, percep_std, name+'_noisy_pr2')\n known_radius(pr2_pkls, name+'_known_rad_pr2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L515_C12", "label": "simulate_perception()", "type": "expression", "loc": [515, 515], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L514_C8", "vector": [8, 3, 0.9019, 0.0018, 3, 0.6, 0.0, 62, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "simulate_perception", "arg_names": [], "import_names": [], "rhs_call_name": "simulate_perception", "annotation": ""}, "snippet": " simulate_perception(pr2_pkls, percep_std, name+'_noisy_pr2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L516_C12", "label": "known_radius()", "type": "expression", "loc": [516, 516], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L514_C8", "vector": [8, 3, 0.9037, 0.0018, 3, 0.6, 1.0, 993, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "known_radius", "arg_names": [], "import_names": [], "rhs_call_name": "known_radius", "annotation": ""}, "snippet": " known_radius(pr2_pkls, name+'_known_rad_pr2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L518_C8", "label": "exit()", "type": "expression", "loc": [518, 518], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "vector": [8, 2, 0.9072, 0.0018, 2, 0.06, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "label": "if", "type": "if", "loc": [521, 530], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [4, 1, 0.9203, 0.0175, 1, 0.74, 0.8667, 0, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.ram_db:\n if opt.name == '':\n name = opt.dir_nm.split('/')[0]\n else:\n name = opt.name\n cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')\n convert_to_ram_db(cody_pkls, name+'_cody')\n pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L522_C8", "label": "if", "type": "if", "loc": [522, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "vector": [4, 2, 0.9168, 0.007, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.name == '':\n name = opt.dir_nm.split('/')[0]\n else:\n name = opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L523_C12", "label": "name =", "type": "assigned_variable", "loc": [523, 523], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L522_C8", "vector": [14, 3, 0.9159, 0.0018, 3, 0.21, 0.0, 57, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = opt.dir_nm.split('/')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L525_C12", "label": "name =", "type": "assigned_variable", "loc": [525, 525], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L522_C8", "vector": [14, 3, 0.9194, 0.0018, 3, 0.21, 1.0, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = opt.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L526_C8", "label": "cody_pkls = glob()", "type": "assigned_variable", "loc": [526, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "vector": [14, 2, 0.9212, 0.0018, 2, 0.64, 0.2, 523, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "cody_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L527_C8", "label": "convert_to_ram_db()", "type": "expression", "loc": [527, 527], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "vector": [8, 2, 0.9229, 0.0018, 2, 0.64, 0.4, 250, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "convert_to_ram_db", "arg_names": [], "import_names": [], "rhs_call_name": "convert_to_ram_db", "annotation": ""}, "snippet": " convert_to_ram_db(cody_pkls, name+'_cody')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L528_C8", "label": "pr2_pkls = glob()", "type": "assigned_variable", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "vector": [14, 2, 0.9247, 0.0018, 2, 0.64, 0.6, 502, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pr2_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L529_C8", "label": "convert_to_ram_db()", "type": "expression", "loc": [529, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "vector": [8, 2, 0.9264, 0.0018, 2, 0.64, 0.8, 250, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "convert_to_ram_db", "arg_names": [], "import_names": [], "rhs_call_name": "convert_to_ram_db", "annotation": ""}, "snippet": " convert_to_ram_db(pr2_pkls, name+'_pr2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L530_C8", "label": "exit()", "type": "expression", "loc": [530, 530], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "vector": [8, 2, 0.9282, 0.0018, 2, 0.64, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "label": "if", "type": "if", "loc": [532, 564], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [4, 1, 0.9597, 0.0578, 1, 0.74, 0.9333, 0, 0, 0, 0, 0, 0, 0, 27], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.dir_nm != '':\n pkls_nm = glob.glob(opt.dir_nm+'/*pull*.pkl')\n\n pp.figure()\n ref_mean, ref_std, ref_config, typ = load_ref_traj(pkls_nm[0])\n mar.plot_reference_trajectory(ref_config, ref_mean, ref_std, typ, 'Hello')\n\n pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L533_C8", "label": "pkls_nm = glob()", "type": "assigned_variable", "loc": [533, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [14, 2, 0.9335, 0.0018, 2, 0.13, 0.0, 885, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pkls_nm", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pkls_nm = glob.glob(opt.dir_nm+'/*pull*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L535_C8", "label": "figure()", "type": "expression", "loc": [535, 535], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [8, 2, 0.937, 0.0018, 2, 0.13, 0.1111, 789, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "figure", "arg_names": [], "import_names": [], "rhs_call_name": "figure", "annotation": ""}, "snippet": " pp.figure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L536_C8", "label": "ref_mean, ref_std, ref_config, typ = load_ref_traj()", "type": "assigned_variable", "loc": [536, 536], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [14, 2, 0.9387, 0.0018, 2, 0.13, 0.2222, 977, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "ref_mean, ref_std, ref_config, typ", "arg_names": [], "import_names": [], "rhs_call_name": "load_ref_traj", "annotation": ""}, "snippet": " ref_mean, ref_std, ref_config, typ = load_ref_traj(pkls_nm[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L537_C8", "label": "plot_reference_trajectory()", "type": "expression", "loc": [537, 537], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [8, 2, 0.9405, 0.0018, 2, 0.13, 0.3333, 272, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "plot_reference_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "plot_reference_trajectory", "annotation": ""}, "snippet": " mar.plot_reference_trajectory(ref_config, ref_mean, ref_std, typ, 'Hello')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L539_C8", "label": "pr2_pkls = glob()", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [14, 2, 0.944, 0.0018, 2, 0.13, 0.4444, 502, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "pr2_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " pr2_pkls = glob.glob(opt.dir_nm+'/pr2*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "label": "if", "type": "if", "loc": [540, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [4, 2, 0.9518, 0.014, 2, 0.13, 0.5556, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pr2_pkls != []:\n pr2_mn, pr2_std, pr2_config, _ = compute_mean_std(pr2_pkls, math.radians(1.))\n\n c1 = 'b'\n pr2_config = np.degrees(pr2_config)\n pp.plot(pr2_config, pr2_mn, color=c1, label='PR2')\n pp.fill_between(pr2_config, np.array(pr2_mn)+np.array(pr2_std),\n np.array(pr2_mn)-np.array(pr2_std), color=c1, alpha=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L541_C12", "label": "pr2_mn, pr2_std, pr2_config, _ = compute_mean_std()", "type": "assigned_variable", "loc": [541, 541], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "vector": [14, 3, 0.9475, 0.0018, 3, 0.07, 0.0, 98, 3, 2, 0, 0, 50, 10, 2], "semantic": {"name": "pr2_mn, pr2_std, pr2_config, _", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mean_std", "annotation": ""}, "snippet": " pr2_mn, pr2_std, pr2_config, _ = compute_mean_std(pr2_pkls, math.radians(1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L543_C12", "label": "c1 =", "type": "assigned_variable", "loc": [543, 543], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "vector": [14, 3, 0.951, 0.0018, 3, 0.07, 0.25, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "c1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1 = 'b'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L544_C12", "label": "pr2_config = degrees()", "type": "assigned_variable", "loc": [544, 544], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "vector": [14, 3, 0.9527, 0.0018, 3, 0.07, 0.5, 140, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "pr2_config", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " pr2_config = np.degrees(pr2_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L545_C12", "label": "plot()", "type": "expression", "loc": [545, 545], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "vector": [8, 3, 0.9545, 0.0018, 3, 0.07, 0.75, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(pr2_config, pr2_mn, color=c1, label='PR2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L546_C12", "label": "fill_between()", "type": "expression", "loc": [546, 547], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "vector": [8, 3, 0.9571, 0.0035, 3, 0.07, 1.0, 206, 3, 5, 0, 0, 0, 0, 5], "semantic": {"name": "fill_between", "arg_names": [], "import_names": [], "rhs_call_name": "fill_between", "annotation": ""}, "snippet": " pp.fill_between(pr2_config, np.array(pr2_mn)+np.array(pr2_std),\n np.array(pr2_mn)-np.array(pr2_std), color=c1, alpha=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L549_C8", "label": "cody_pkls = glob()", "type": "assigned_variable", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [14, 2, 0.9615, 0.0018, 2, 0.13, 0.6667, 523, 3, 1, 0, 0, 958, 10, 1], "semantic": {"name": "cody_pkls", "arg_names": [], "import_names": [], "rhs_call_name": "glob", "annotation": ""}, "snippet": " cody_pkls = glob.glob(opt.dir_nm+'/*trajector*.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "label": "if", "type": "if", "loc": [550, 562], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [4, 2, 0.9737, 0.0228, 2, 0.13, 0.7778, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cody_pkls != []:\n cody_mn, cody_std, cody_config, _ = compute_mean_std(cody_pkls, math.radians(1.))\n m,c = get_cody_calibration()\n cody_mn = (cody_mn - c) / m\n \n cody_mn = cody_mn[1:]\n cody_std = cody_std[1:]\n cody_config = cody_config[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L551_C12", "label": "cody_mn, cody_std, cody_config, _ = compute_mean_std()", "type": "assigned_variable", "loc": [551, 551], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.965, 0.0018, 3, 0.18, 0.0, 446, 3, 2, 0, 0, 50, 10, 2], "semantic": {"name": "cody_mn, cody_std, cody_config, _", "arg_names": [], "import_names": [], "rhs_call_name": "compute_mean_std", "annotation": ""}, "snippet": " cody_mn, cody_std, cody_config, _ = compute_mean_std(cody_pkls, math.radians(1.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L552_C12", "label": "m, c = get_cody_calibration()", "type": "assigned_variable", "loc": [552, 552], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.9667, 0.0018, 3, 0.18, 0.1111, 557, 3, 0, 0, 0, 243, 10, 1], "semantic": {"name": "m, c", "arg_names": [], "import_names": [], "rhs_call_name": "get_cody_calibration", "annotation": ""}, "snippet": " m,c = get_cody_calibration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L553_C12", "label": "cody_mn =", "type": "assigned_variable", "loc": [553, 553], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.9685, 0.0018, 3, 0.18, 0.2222, 733, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cody_mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cody_mn = (cody_mn - c) / m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L555_C12", "label": "cody_mn =", "type": "assigned_variable", "loc": [555, 555], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.972, 0.0018, 3, 0.18, 0.3333, 733, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cody_mn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cody_mn = cody_mn[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L556_C12", "label": "cody_std =", "type": "assigned_variable", "loc": [556, 556], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.9737, 0.0018, 3, 0.18, 0.4444, 912, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cody_std", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cody_std = cody_std[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L557_C12", "label": "cody_config =", "type": "assigned_variable", "loc": [557, 557], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.9755, 0.0018, 3, 0.18, 0.5556, 358, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cody_config", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cody_config = cody_config[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L558_C12", "label": "c1 =", "type": "assigned_variable", "loc": [558, 558], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.9772, 0.0018, 3, 0.18, 0.6667, 452, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "c1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c1 = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L559_C12", "label": "cody_config = degrees()", "type": "assigned_variable", "loc": [559, 559], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [14, 3, 0.979, 0.0018, 3, 0.18, 0.7778, 358, 3, 1, 0, 0, 633, 10, 1], "semantic": {"name": "cody_config", "arg_names": [], "import_names": [], "rhs_call_name": "degrees", "annotation": ""}, "snippet": " cody_config = np.degrees(cody_config)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L560_C12", "label": "plot()", "type": "expression", "loc": [560, 560], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [8, 3, 0.9807, 0.0018, 3, 0.18, 0.8889, 929, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pp.plot(cody_config, cody_mn, color=c1, label='Cody')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L561_C12", "label": "fill_between()", "type": "expression", "loc": [561, 562], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "vector": [8, 3, 0.9834, 0.0035, 3, 0.18, 1.0, 206, 3, 5, 0, 0, 0, 0, 5], "semantic": {"name": "fill_between", "arg_names": [], "import_names": [], "rhs_call_name": "fill_between", "annotation": ""}, "snippet": " pp.fill_between(cody_config, np.array(cody_mn)+np.array(cody_std),\n np.array(cody_mn)-np.array(cody_std), color=c1, alpha=0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L563_C8", "label": "legend()", "type": "expression", "loc": [563, 563], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [8, 2, 0.986, 0.0018, 2, 0.13, 0.8889, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pp.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L564_C8", "label": "show()", "type": "expression", "loc": [564, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "vector": [8, 2, 0.9877, 0.0018, 2, 0.13, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pp.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "label": "if", "type": "if", "loc": [566, 569], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "vector": [4, 1, 0.9939, 0.007, 1, 0.74, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opt.fname:\n plot_pkl(opt.fname)\n pp.legend()\n pp.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L567_C8", "label": "plot_pkl()", "type": "expression", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "vector": [8, 2, 0.993, 0.0018, 2, 0.05, 0.0, 628, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot_pkl", "arg_names": [], "import_names": [], "rhs_call_name": "plot_pkl", "annotation": ""}, "snippet": " plot_pkl(opt.fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L568_C8", "label": "legend()", "type": "expression", "loc": [568, 568], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "vector": [8, 2, 0.9947, 0.0018, 2, 0.05, 0.5, 880, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "legend", "arg_names": [], "import_names": [], "rhs_call_name": "legend", "annotation": ""}, "snippet": " pp.legend()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L569_C8", "label": "show()", "type": "expression", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "vector": [8, 2, 0.9965, 0.0018, 2, 0.05, 1.0, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pp.show()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L153_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L207_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L262_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L298_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L300_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L300_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L301_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L301_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L305_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L307_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L324_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L325_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L337_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L346_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L320_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L353_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L355_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L363_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L350_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L368_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L367_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Return_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L380_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L381_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L387_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L374_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L388_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L392_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L396_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L404_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L401_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L407_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L417_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L419_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L420_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L424_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L426_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L427_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L428_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L391_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L430_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L434_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L435_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L436_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L438_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L443_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L445_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L442_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L447_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:For_L451_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L458_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L459_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L460_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L462_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L463_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L468_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L469_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:FunctionDef_L432_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L470_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Import_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L476_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L477_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L479_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L481_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L483_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L485_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L489_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L492_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L494_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L500_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L505_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L505_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L506_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L505_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L508_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L510_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L510_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L512_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L514_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L515_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L514_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L516_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L503_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L518_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L522_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L522_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L523_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L522_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L525_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L529_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L521_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L533_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L535_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L536_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L537_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L541_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L543_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L544_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L545_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L540_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L546_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L551_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L552_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L553_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L555_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L556_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L557_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L558_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Assign_L559_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L560_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L550_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L561_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L532_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L564_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L473_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L568_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99208:If_L566_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99208:Expr_L569_C8"}] |
#! /usr/bin/python
import roslib; roslib.load_manifest('hrl_pr2_lib')
import rospy
import tf.transformations as tr
import hrl_lib.tf_utils as tfu
import hrl_lib.util as ut
import tf
import geometry_msgs.msg as gm
import sys
import math
import numpy as np
import actionlib
import hrl_pr2_lib.msg as hm
class MoveBase:
def __init__(self):
rospy.init_node('odom_move_base')
self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)
#rospy.Subscriber('simple_move_base', gm.Pose2D, self.pose2d_cb)
self.tl = tf.TransformListener()
self.go_xy_server = actionlib.SimpleActionServer('go_xy', hm.GoXYAction, self._go_xy_cb, auto_start=True)
self.go_ang_server = actionlib.SimpleActionServer('go_angle', hm.GoAngleAction, self._go_ang_cb, auto_start=True)
def _go_xy_cb(self, goal):
rospy.loginfo('received go_xy goal %f %f' % (goal.x, goal.y))
def send_feed_back(error):
feed_back_msg = hm.GoXYFeedback()
feed_back_msg.error = np.linalg.norm(error)
self.go_xy_server.publish_feedback(feed_back_msg)
error = self.go_xy(np.matrix([goal.x, goal.y]).T, func=send_feed_back)
result = hm.GoXYResult()
result.error = np.linalg.norm(error)
self.go_xy_server.set_succeeded(result)
def _go_ang_cb(self, goal):
rospy.loginfo('received go_angle goal %f' % (goal.angle))
def send_feed_back(error):
feed_back_msg = hm.GoAngleFeedback()
feed_back_msg.error = error
self.go_ang_server.publish_feedback(feed_back_msg)
error = self.go_angle(goal.angle, func=send_feed_back)
result = hm.GoAngleResult()
result.error = error
self.go_ang_server.set_succeeded(result)
def go_xy(self, target_base, tolerance=.01, max_speed=.1, func=None):
k = 2.
self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))
rate = rospy.Rate(100)
od_T_bf = tfu.transform('odom_combined', 'base_footprint', self.tl)
target_odom = (od_T_bf * np.row_stack([target_base, np.matrix([0,1.]).T]))[0:2,0]
#print 'target base', target_base.T
#print 'target odom', target_odom.T
while not rospy.is_shutdown():
robot_odom = np.matrix(tfu.transform('odom_combined', 'base_footprint', self.tl)[0:2,3])
#rospy.loginfo('odom %s' % str(robot_odom.T))
diff_odom = target_odom - robot_odom
mag = np.linalg.norm(diff_odom)
#rospy.loginfo('error %s' % str(mag))
if func != None:
func(diff_odom)
if mag < tolerance:
break
direc = diff_odom / mag
speed = min(mag * k, max_speed)
vel_odom = direc * speed
#vel_odom = direc * mag * k
#print mag*k, max_speed, speed
bf_T_odom = tfu.transform('base_footprint', 'odom_combined', self.tl)
vel_base = bf_T_odom * np.row_stack([vel_odom, np.matrix([0,0.]).T])
#pdb.set_trace()
#rospy.loginfo('vel_base %f %f' % (vel_base[0,0], vel_base[1,0]))
tw = gm.Twist()
tw.linear.x = vel_base[0,0]
tw.linear.y = vel_base[1,0]
#rospy.loginfo('commanded %s' % str(tw))
self.tw_pub.publish(tw)
rate.sleep()
rospy.loginfo('finished go_xy %f' % np.linalg.norm(diff_odom))
return diff_odom
##
# delta angle
def go_angle(self, target_odom, tolerance=math.radians(5.), max_ang_vel=math.radians(20.), func=None):
self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))
rate = rospy.Rate(100)
k = math.radians(80)
#current_ang_odom = tr.euler_from_matrix(tfu.transform('base_footprint', 'odom_combined', self.tl)[0:3, 0:3], 'sxyz')[2]
#target_odom = current_ang_odom + delta_ang
while not rospy.is_shutdown():
robot_odom = tfu.transform('base_footprint', 'odom_combined', self.tl)
current_ang_odom = tr.euler_from_matrix(robot_odom[0:3, 0:3], 'sxyz')[2]
diff = ut.standard_rad(current_ang_odom - target_odom)
p = k * diff
#print diff
if func != None:
func(diff)
if np.abs(diff) < tolerance:
break
tw = gm.Twist()
vels = [p, np.sign(p) * max_ang_vel]
tw.angular.z = vels[np.argmin(np.abs(vels))]
#rospy.loginfo('diff %.3f vel %.3f' % (math.degrees(diff), math.degrees(tw.angular.z)))
self.tw_pub.publish(tw)
#rospy.loginfo('commanded %s' % str(tw))
rate.sleep()
rospy.loginfo('finished %.3f' % math.degrees(diff))
return diff
#def pose2d_cb(self, msg):
# if msg.x != 0:
# rospy.loginfo('go x called')
# self.go_x(msg.x, msg.y)
# elif msg.theta != 0:
# rospy.loginfo('go theta called')
# self.go_ang(msg.theta)
#def go_ang(self, ang, speed):
# dt = math.radians(ang)
# if dt > 0:
# sign = -1
# elif dt < 0:
# sign = 1
# else:
# sign = 0
# self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))
# p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl)# \
# start_ang = tr.euler_from_matrix(p0_base[0:3, 0:3], 'sxyz')[2]
# r = rospy.Rate(100)
# dist_so_far = 0.
# last_ang = start_ang
# while not rospy.is_shutdown():
# pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl) #\
# current_ang = tr.euler_from_matrix(pcurrent_base[0:3, 0:3], 'sxyz')[2]
# #relative_trans = np.linalg.inv(p0_base) * pcurrent_base
# #relative_ang = math.degrees(tr.euler_from_matrix(relative_trans[0:3, 0:3], 'sxyz')[2])
# dist_so_far = dist_so_far + (ut.standard_rad(current_ang - last_ang))
# #print 'dist_so_far %.3f dt %.3f diff %.3f' % (dist_so_far, dt, ut.standard_rad(current_ang - last_ang))
# if dt > 0 and dist_so_far > dt:
# rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))
# break
# elif dt < 0 and dist_so_far < dt:
# rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))
# break
# elif dt == 0:
# rospy.loginfo('stopped! %f %f' % (dist_so_far, dt))
# break
# tw = gm.Twist()
# tw.linear.x = 0
# tw.linear.y = 0
# tw.linear.z = 0
# tw.angular.x = 0
# tw.angular.y = 0#0#math.radians(10)
# tw.angular.z = math.radians(speed * sign)
# self.tw_pub.publish(tw)
# r.sleep()
# last_ang = current_ang
#def go_x(self, x, speed):
# vel = speed * np.sign(x)
# self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))
# p0_base = tfu.transform('base_footprint', 'odom_combined', self.tl)
# r = rospy.Rate(100)
# while not rospy.is_shutdown():
# pcurrent_base = tfu.transform('base_footprint', 'odom_combined', self.tl)
# relative_trans = np.linalg.inv(p0_base) * pcurrent_base
# dist_moved = np.linalg.norm(relative_trans[0:3,3])
# print "%s" % str(dist_moved)
#
# if dist_moved > np.abs(x):
# rospy.loginfo('stopped! error %f' % (np.abs(dist_moved-np.abs(x))))
# break
# tw = gm.Twist()
# tw.linear.x = vel
# tw.linear.y = 0
# tw.linear.z = 0
# tw.angular.x = 0
# tw.angular.y = 0
# tw.angular.z = 0
# self.tw_pub.publish(tw)
# r.sleep()
if __name__ == '__main__':
m = MoveBase()
rospy.loginfo('simple move base server up!')
rospy.spin()
#m.go_ang(-390, 100)
#m.go_x(.2, .05)
| ajibawa-2023/Python-Code-Large/train/row_99209 | 88 | 215 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0047, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0093, 0.0047, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.014, 0.0047, 0, 0.66, 0.1429, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L4_C0", "label": "tf.transformations import tr", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0186, 0.0047, 0, 0.66, 0.2143, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L5_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0047, 0, 0.66, 0.2857, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L6_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0279, 0.0047, 0, 0.66, 0.3571, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L7_C0", "label": "tf import tf", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0326, 0.0047, 0, 0.66, 0.4286, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L9_C0", "label": "geometry_msgs.msg import gm", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0419, 0.0047, 0, 0.66, 0.5, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0465, 0.0047, 0, 0.66, 0.5714, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L11_C0", "label": "math import math", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0512, 0.0047, 0, 0.66, 0.6429, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0558, 0.0047, 0, 0.66, 0.7143, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L13_C0", "label": "actionlib import actionlib", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0605, 0.0047, 0, 0.66, 0.7857, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Import_L14_C0", "label": "hrl_pr2_lib.msg import hm", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0651, 0.0047, 0, 0.66, 0.8571, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "hrl_pr2_lib.msg", "arg_names": [], "import_names": ["hm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.msg as hm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "label": "MoveBase", "type": "class", "loc": [16, 124], "level": 0, "parent": null, "vector": [3, 0, 0.3256, 0.507, 0, 0.66, 0.9286, 11, 0, 7, 0, 0, 0, 0, 62], "semantic": {"name": "MoveBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MoveBase:\n\n def __init__(self):\n rospy.init_node('odom_move_base')\n self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)\n #rospy.Subscriber('simple_move_base', gm.Pose2D, self.pose2d_cb)\n self.tl = tf.TransformListener()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "vector": [2, 1, 0.1, 0.0372, 1, 0.69, 0.0, 555, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node('odom_move_base')\n self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)\n #rospy.Subscriber('simple_move_base', gm.Pose2D, self.pose2d_cb)\n self.tl = tf.TransformListener()\n\n self.go_xy_server = actionlib.SimpleActionServer('go_xy', hm.GoXYAction, self._go_xy_cb, auto_start=True)\n self.go_ang_server = actionlib.SimpleActionServer('go_angle', hm.GoAngleAction, self._go_ang_cb, auto_start=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L19_C8", "label": "init_node()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "vector": [8, 2, 0.0884, 0.0047, 2, 0.52, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('odom_move_base')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L20_C8", "label": "self.tw_pub = Publisher()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "vector": [14, 2, 0.093, 0.0047, 2, 0.52, 0.25, 794, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.tw_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.tw_pub = rospy.Publisher('base_controller/command', gm.Twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L22_C8", "label": "self.tl = TransformListener()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "vector": [14, 2, 0.1023, 0.0047, 2, 0.52, 0.5, 790, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tl", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tl = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L24_C8", "label": "self.go_xy_server = SimpleActionServer()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "vector": [14, 2, 0.1116, 0.0047, 2, 0.52, 0.75, 253, 3, 4, 0, 0, 975, 10, 1], "semantic": {"name": "self.go_xy_server", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self.go_xy_server = actionlib.SimpleActionServer('go_xy', hm.GoXYAction, self._go_xy_cb, auto_start=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L25_C8", "label": "self.go_ang_server = SimpleActionServer()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "vector": [14, 2, 0.1163, 0.0047, 2, 0.52, 1.0, 267, 3, 4, 0, 0, 975, 10, 1], "semantic": {"name": "self.go_ang_server", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionServer", "annotation": ""}, "snippet": " self.go_ang_server = actionlib.SimpleActionServer('go_angle', hm.GoAngleAction, self._go_ang_cb, auto_start=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "label": "_go_xy_cb", "type": "function", "loc": [27, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "vector": [2, 1, 0.1465, 0.0465, 1, 0.69, 0.25, 959, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "_go_xy_cb", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _go_xy_cb(self, goal):\n rospy.loginfo('received go_xy goal %f %f' % (goal.x, goal.y))\n def send_feed_back(error):\n feed_back_msg = hm.GoXYFeedback()\n feed_back_msg.error = np.linalg.norm(error)\n self.go_xy_server.publish_feedback(feed_back_msg)\n error = self.go_xy(np.matrix([goal.x, goal.y]).T, func=send_feed_back)\n result = hm.GoXYResult()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L28_C8", "label": "loginfo()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "vector": [8, 2, 0.1302, 0.0047, 2, 0.85, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('received go_xy goal %f %f' % (goal.x, goal.y))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "label": "send_feed_back", "type": "function", "loc": [29, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "vector": [2, 2, 0.1419, 0.0186, 2, 0.85, 0.2, 319, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_feed_back", "arg_names": ["error"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_feed_back(error):\n feed_back_msg = hm.GoXYFeedback()\n feed_back_msg.error = np.linalg.norm(error)\n self.go_xy_server.publish_feedback(feed_back_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L30_C12", "label": "feed_back_msg = GoXYFeedback()", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "vector": [14, 3, 0.1395, 0.0047, 3, 0.43, 0.0, 166, 3, 0, 0, 0, 542, 10, 1], "semantic": {"name": "feed_back_msg", "arg_names": [], "import_names": [], "rhs_call_name": "GoXYFeedback", "annotation": ""}, "snippet": " feed_back_msg = hm.GoXYFeedback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L31_C12", "label": "feed_back_msg.error = norm()", "type": "assigned_variable", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "vector": [14, 3, 0.1442, 0.0047, 3, 0.43, 0.5, 817, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "feed_back_msg.error", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " feed_back_msg.error = np.linalg.norm(error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L32_C12", "label": "publish_feedback()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "vector": [8, 3, 0.1488, 0.0047, 3, 0.43, 1.0, 56, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_feedback", "arg_names": [], "import_names": [], "rhs_call_name": "publish_feedback", "annotation": ""}, "snippet": " self.go_xy_server.publish_feedback(feed_back_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L33_C8", "label": "error = go_xy()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "vector": [14, 2, 0.1535, 0.0047, 2, 0.85, 0.4, 771, 3, 2, 0, 0, 601, 10, 2], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "go_xy", "annotation": ""}, "snippet": " error = self.go_xy(np.matrix([goal.x, goal.y]).T, func=send_feed_back)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L34_C8", "label": "result = GoXYResult()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "vector": [14, 2, 0.1581, 0.0047, 2, 0.85, 0.6, 51, 3, 0, 0, 0, 632, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "GoXYResult", "annotation": ""}, "snippet": " result = hm.GoXYResult()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L35_C8", "label": "result.error = norm()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "vector": [14, 2, 0.1628, 0.0047, 2, 0.85, 0.8, 412, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "result.error", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " result.error = np.linalg.norm(error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L36_C8", "label": "set_succeeded()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "vector": [8, 2, 0.1674, 0.0047, 2, 0.85, 1.0, 825, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self.go_xy_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "label": "_go_ang_cb", "type": "function", "loc": [39, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "vector": [2, 1, 0.207, 0.0558, 1, 0.69, 0.5, 516, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_go_ang_cb", "arg_names": ["self", "goal"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _go_ang_cb(self, goal):\n rospy.loginfo('received go_angle goal %f' % (goal.angle))\n\n def send_feed_back(error):\n feed_back_msg = hm.GoAngleFeedback()\n feed_back_msg.error = error\n self.go_ang_server.publish_feedback(feed_back_msg)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L40_C8", "label": "loginfo()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "vector": [8, 2, 0.186, 0.0047, 2, 0.32, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('received go_angle goal %f' % (goal.angle))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "label": "send_feed_back", "type": "function", "loc": [42, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "vector": [2, 2, 0.2023, 0.0186, 2, 0.32, 0.2, 319, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "send_feed_back", "arg_names": ["error"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_feed_back(error):\n feed_back_msg = hm.GoAngleFeedback()\n feed_back_msg.error = error\n self.go_ang_server.publish_feedback(feed_back_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L43_C12", "label": "feed_back_msg = GoAngleFeedback()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "vector": [14, 3, 0.2, 0.0047, 3, 0.89, 0.0, 166, 3, 0, 0, 0, 847, 10, 1], "semantic": {"name": "feed_back_msg", "arg_names": [], "import_names": [], "rhs_call_name": "GoAngleFeedback", "annotation": ""}, "snippet": " feed_back_msg = hm.GoAngleFeedback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L44_C12", "label": "feed_back_msg.error =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "vector": [14, 3, 0.2047, 0.0047, 3, 0.89, 0.5, 817, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "feed_back_msg.error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " feed_back_msg.error = error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L45_C12", "label": "publish_feedback()", "type": "expression", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "vector": [8, 3, 0.2093, 0.0047, 3, 0.89, 1.0, 56, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_feedback", "arg_names": [], "import_names": [], "rhs_call_name": "publish_feedback", "annotation": ""}, "snippet": " self.go_ang_server.publish_feedback(feed_back_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L47_C8", "label": "error = go_angle()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "vector": [14, 2, 0.2186, 0.0047, 2, 0.32, 0.4, 771, 3, 2, 0, 0, 129, 10, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "go_angle", "annotation": ""}, "snippet": " error = self.go_angle(goal.angle, func=send_feed_back)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L48_C8", "label": "result = GoAngleResult()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "vector": [14, 2, 0.2233, 0.0047, 2, 0.32, 0.6, 51, 3, 0, 0, 0, 49, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "GoAngleResult", "annotation": ""}, "snippet": " result = hm.GoAngleResult()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L49_C8", "label": "result.error =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "vector": [14, 2, 0.2279, 0.0047, 2, 0.32, 0.8, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "result.error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result.error = error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L50_C8", "label": "set_succeeded()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "vector": [8, 2, 0.2326, 0.0047, 2, 0.32, 1.0, 825, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_succeeded", "arg_names": [], "import_names": [], "rhs_call_name": "set_succeeded", "annotation": ""}, "snippet": " self.go_ang_server.set_succeeded(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "label": "go_xy", "type": "function", "loc": [53, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "vector": [2, 1, 0.3395, 0.1907, 1, 0.69, 0.75, 601, 0, 5, 1, 0, 0, 0, 21], "semantic": {"name": "go_xy", "arg_names": ["self", "target_base", "tolerance", "max_speed", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_xy(self, target_base, tolerance=.01, max_speed=.1, func=None):\n k = 2.\n self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))\n rate = rospy.Rate(100)\n\n od_T_bf = tfu.transform('odom_combined', 'base_footprint', self.tl)\n target_odom = (od_T_bf * np.row_stack([target_base, np.matrix([0,1.]).T]))[0:2,0]\n #print 'target base', target_base.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L54_C8", "label": "k =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [14, 2, 0.2512, 0.0047, 2, 0.81, 0.0, 954, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L55_C8", "label": "waitForTransform()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [8, 2, 0.2558, 0.0047, 2, 0.81, 0.1429, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L56_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [14, 2, 0.2605, 0.0047, 2, 0.81, 0.2857, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L58_C8", "label": "od_T_bf = transform()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [14, 2, 0.2698, 0.0047, 2, 0.81, 0.4286, 465, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "od_T_bf", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " od_T_bf = tfu.transform('odom_combined', 'base_footprint', self.tl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L59_C8", "label": "target_odom =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [14, 2, 0.2744, 0.0047, 2, 0.81, 0.5714, 954, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "target_odom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target_odom = (od_T_bf * np.row_stack([target_base, np.matrix([0,1.]).T]))[0:2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "label": "while", "type": "while", "loc": [63, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [5, 2, 0.3581, 0.1349, 2, 0.81, 0.7143, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n robot_odom = np.matrix(tfu.transform('odom_combined', 'base_footprint', self.tl)[0:2,3])\n #rospy.loginfo('odom %s' % str(robot_odom.T))\n\n diff_odom = target_odom - robot_odom\n mag = np.linalg.norm(diff_odom)\n #rospy.loginfo('error %s' % str(mag))\n if func != None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L64_C12", "label": "robot_odom = matrix()", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.2977, 0.0047, 3, 0.46, 0.0, 67, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "robot_odom", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " robot_odom = np.matrix(tfu.transform('odom_combined', 'base_footprint', self.tl)[0:2,3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L67_C12", "label": "diff_odom =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3116, 0.0047, 3, 0.46, 0.0714, 992, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff_odom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff_odom = target_odom - robot_odom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L68_C12", "label": "mag = norm()", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3163, 0.0047, 3, 0.46, 0.1429, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(diff_odom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L70_C12", "label": "if", "type": "if", "loc": [70, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [4, 3, 0.3279, 0.0093, 3, 0.46, 0.2143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if func != None:\n func(diff_odom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L71_C16", "label": "func()", "type": "expression", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L70_C12", "vector": [8, 4, 0.3302, 0.0047, 4, 0.48, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(diff_odom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L72_C12", "label": "if", "type": "if", "loc": [72, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [4, 3, 0.3372, 0.0093, 3, 0.46, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag < tolerance:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L75_C12", "label": "direc =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3488, 0.0047, 3, 0.46, 0.3571, 620, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "direc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " direc = diff_odom / mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L76_C12", "label": "speed = min()", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3535, 0.0047, 3, 0.46, 0.4286, 970, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "speed", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " speed = min(mag * k, max_speed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L77_C12", "label": "vel_odom =", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3581, 0.0047, 3, 0.46, 0.5, 981, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_odom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_odom = direc * speed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L81_C12", "label": "bf_T_odom = transform()", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3767, 0.0047, 3, 0.46, 0.5714, 917, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "bf_T_odom", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " bf_T_odom = tfu.transform('base_footprint', 'odom_combined', self.tl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L82_C12", "label": "vel_base =", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.3814, 0.0047, 3, 0.46, 0.6429, 175, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "vel_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_base = bf_T_odom * np.row_stack([vel_odom, np.matrix([0,0.]).T])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L86_C12", "label": "tw = Twist()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.4, 0.0047, 3, 0.46, 0.7143, 656, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "tw", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " tw = gm.Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L87_C12", "label": "tw.linear.x =", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.4047, 0.0047, 3, 0.46, 0.7857, 338, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tw.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.linear.x = vel_base[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L88_C12", "label": "tw.linear.y =", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [14, 3, 0.4093, 0.0047, 3, 0.46, 0.8571, 571, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tw.linear.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.linear.y = vel_base[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L90_C12", "label": "publish()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [8, 3, 0.4186, 0.0047, 3, 0.46, 0.9286, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.tw_pub.publish(tw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L91_C12", "label": "sleep()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "vector": [8, 3, 0.4233, 0.0047, 3, 0.46, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L92_C8", "label": "loginfo()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [8, 2, 0.4279, 0.0047, 2, 0.81, 0.8571, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('finished go_xy %f' % np.linalg.norm(diff_odom))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "vector": [13, 2, 0.4326, 0.0047, 2, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return diff_odom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "label": "go_angle", "type": "function", "loc": [97, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "vector": [2, 1, 0.514, 0.1302, 1, 0.69, 1.0, 129, 0, 5, 1, 0, 0, 0, 21], "semantic": {"name": "go_angle", "arg_names": ["self", "target_odom", "tolerance", "max_ang_vel", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_angle(self, target_odom, tolerance=math.radians(5.), max_ang_vel=math.radians(20.), func=None):\n self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))\n rate = rospy.Rate(100)\n k = math.radians(80)\n\n #current_ang_odom = tr.euler_from_matrix(tfu.transform('base_footprint', 'odom_combined', self.tl)[0:3, 0:3], 'sxyz')[2]\n #target_odom = current_ang_odom + delta_ang\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L98_C8", "label": "waitForTransform()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "vector": [8, 2, 0.4558, 0.0047, 2, 0.31, 0.0, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tl.waitForTransform('base_footprint', 'odom_combined', rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L99_C8", "label": "rate = Rate()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "vector": [14, 2, 0.4605, 0.0047, 2, 0.31, 0.2, 477, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " rate = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L100_C8", "label": "k = radians()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "vector": [14, 2, 0.4651, 0.0047, 2, 0.31, 0.4, 954, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "radians", "annotation": ""}, "snippet": " k = math.radians(80)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "label": "while", "type": "while", "loc": [105, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "vector": [5, 2, 0.5279, 0.0837, 2, 0.31, 0.6, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n robot_odom = tfu.transform('base_footprint', 'odom_combined', self.tl)\n current_ang_odom = tr.euler_from_matrix(robot_odom[0:3, 0:3], 'sxyz')[2]\n diff = ut.standard_rad(current_ang_odom - target_odom)\n p = k * diff\n #print diff\n if func != None:\n func(diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L106_C12", "label": "robot_odom = transform()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.493, 0.0047, 3, 0.27, 0.0, 67, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "robot_odom", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " robot_odom = tfu.transform('base_footprint', 'odom_combined', self.tl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L107_C12", "label": "current_ang_odom =", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.4977, 0.0047, 3, 0.27, 0.1, 418, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "current_ang_odom", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " current_ang_odom = tr.euler_from_matrix(robot_odom[0:3, 0:3], 'sxyz')[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L108_C12", "label": "diff = standard_rad()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.5023, 0.0047, 3, 0.27, 0.2, 833, 3, 1, 0, 0, 54, 10, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "standard_rad", "annotation": ""}, "snippet": " diff = ut.standard_rad(current_ang_odom - target_odom)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L109_C12", "label": "p =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.507, 0.0047, 3, 0.27, 0.3, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = k * diff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L111_C12", "label": "if", "type": "if", "loc": [111, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [4, 3, 0.5186, 0.0093, 3, 0.27, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if func != None:\n func(diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L112_C16", "label": "func()", "type": "expression", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L111_C12", "vector": [8, 4, 0.5209, 0.0047, 4, 0.78, 0.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L113_C12", "label": "if", "type": "if", "loc": [113, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [4, 3, 0.5279, 0.0093, 3, 0.27, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.abs(diff) < tolerance:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L116_C12", "label": "tw = Twist()", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.5395, 0.0047, 3, 0.27, 0.6, 656, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "tw", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " tw = gm.Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L117_C12", "label": "vels =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.5442, 0.0047, 3, 0.27, 0.7, 813, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "vels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vels = [p, np.sign(p) * max_ang_vel]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L118_C12", "label": "tw.angular.z =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [14, 3, 0.5488, 0.0047, 3, 0.27, 0.8, 305, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tw.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tw.angular.z = vels[np.argmin(np.abs(vels))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L120_C12", "label": "publish()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [8, 3, 0.5581, 0.0047, 3, 0.27, 0.9, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.tw_pub.publish(tw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L122_C12", "label": "sleep()", "type": "expression", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "vector": [8, 3, 0.5674, 0.0047, 3, 0.27, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rate.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L123_C8", "label": "loginfo()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "vector": [8, 2, 0.5721, 0.0047, 2, 0.31, 0.8, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('finished %.3f' % math.degrees(diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Return_L124_C8", "label": "return", "type": "return", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "vector": [13, 2, 0.5767, 0.0047, 2, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return diff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "label": "if", "type": "if", "loc": [208, 211], "level": 0, "parent": null, "vector": [4, 0, 0.9744, 0.0186, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n m = MoveBase()\n rospy.loginfo('simple move base server up!')\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L209_C4", "label": "m = MoveBase()", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "vector": [14, 1, 0.9721, 0.0047, 1, 0.82, 0.0, 711, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "MoveBase", "annotation": ""}, "snippet": " m = MoveBase()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L210_C4", "label": "loginfo()", "type": "expression", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "vector": [8, 1, 0.9767, 0.0047, 1, 0.82, 0.5, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('simple move base server up!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L211_C4", "label": "spin()", "type": "expression", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "vector": [8, 1, 0.9814, 0.0047, 1, 0.82, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L70_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L111_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:While_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Return_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99209:If_L208_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99209:Expr_L211_C4"}] |
import sensor_msgs.msg as sm
import pr2_arm_navigation_perception.srv as snp
#import tf
#import tf.msg
import rospy
import numpy as np
import hrl_lib.rutils as ru
##
# Converts a list of pr2_msgs/PressureState into a matrix
#
# @return left mat, right mat, array
def pressure_state_to_mat(contact_msgs):
times = np.array([c.header.stamp.to_time() for c in contact_msgs])
left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs])
left = np.matrix(left).T
right = np.matrix(right).T
return left, right, times
class LaserScanner:
def __init__(self, service):
srv_name = '/%s/single_sweep_cloud' % service
self.sp = rospy.ServiceProxy(srv_name, snp.BuildCloudAngle)
def scan_np(self, start, end, duration):
resp = self.sp(start, end, duration)
return ru.pointcloud_to_np(resp.cloud)
def scan(self, start, end, duration):
resp = self.sp(start, end, duration)
return resp.cloud
def sweep_param_to_tilt_param(angle_begin, angle_end, duration):
amplitude = abs(angle_end - angle_begin)/2.0
offset = (angle_end + angle_begin)/2.0
period = duration*2.0
return {'amplitude': amplitude, 'offset':offset, 'period': period}
class PointCloudReceiver:
def __init__(self, topic):
self.listener = ru.GenericListener('point_cloud_receiver', sm.PointCloud, topic, .2)
self.topic = topic
def read(self):
cur_time = rospy.Time.now().to_sec()
not_fresh = True
while not_fresh:
pcmsg = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)
if not (pcmsg.header.stamp.to_sec() < cur_time):
not_fresh = False
tdif = rospy.Time.now().to_sec() - cur_time
if tdif > 10.:
rospy.logerr('Have not heard from %s for %.2f seconds.' % (self.topic, tdif))
rospy.sleep(.1)
return pcmsg
| ajibawa-2023/Python-Code-Large/train/row_99210 | 42 | 63 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Import_L2_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0159, 0, 0.66, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Import_L3_C0", "label": "pr2_arm_navigation_perception.srv import snp", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0159, 0, 0.66, 0.125, 326, 0, 1, 0, 0, 326, 0, 0], "semantic": {"name": "pr2_arm_navigation_perception.srv", "arg_names": [], "import_names": ["snp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_arm_navigation_perception.srv as snp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0159, 0, 0.66, 0.25, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0159, 0, 0.66, 0.375, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Import_L8_C0", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.127, 0.0159, 0, 0.66, 0.5, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "label": "pressure_state_to_mat", "type": "function", "loc": [15, 21], "level": 0, "parent": null, "vector": [2, 0, 0.2857, 0.1111, 0, 0.66, 0.625, 871, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "pressure_state_to_mat", "arg_names": ["contact_msgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pressure_state_to_mat(contact_msgs):\n times = np.array([c.header.stamp.to_time() for c in contact_msgs])\n left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs])\n \n left = np.matrix(left).T\n right = np.matrix(right).T\n return left, right, times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L16_C4", "label": "times = array()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "vector": [14, 1, 0.254, 0.0159, 1, 0.49, 0.0, 342, 3, 1, 0, 0, 80, 10, 2], "semantic": {"name": "times", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " times = np.array([c.header.stamp.to_time() for c in contact_msgs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L17_C4", "label": "left, right = zip()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "vector": [14, 1, 0.2698, 0.0159, 1, 0.49, 0.25, 628, 3, 1, 0, 0, 814, 10, 3], "semantic": {"name": "left, right", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " left, right = zip(*[[list(c.l_finger_tip), list(c.r_finger_tip)] for c in contact_msgs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L19_C4", "label": "left =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "vector": [14, 1, 0.3016, 0.0159, 1, 0.49, 0.5, 605, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = np.matrix(left).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L20_C4", "label": "right =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "vector": [14, 1, 0.3175, 0.0159, 1, 0.49, 0.75, 724, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = np.matrix(right).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L21_C4", "label": "return", "type": "return", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "vector": [13, 1, 0.3333, 0.0159, 1, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return left, right, times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "label": "LaserScanner", "type": "class", "loc": [23, 34], "level": 0, "parent": null, "vector": [3, 0, 0.4524, 0.1905, 0, 0.66, 0.75, 232, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "LaserScanner", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LaserScanner:\n def __init__(self, service):\n srv_name = '/%s/single_sweep_cloud' % service\n self.sp = rospy.ServiceProxy(srv_name, snp.BuildCloudAngle)\n\n def scan_np(self, start, end, duration):\n resp = self.sp(start, end, duration)\n return ru.pointcloud_to_np(resp.cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "vector": [2, 1, 0.3968, 0.0476, 1, 0.85, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "service"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, service):\n srv_name = '/%s/single_sweep_cloud' % service\n self.sp = rospy.ServiceProxy(srv_name, snp.BuildCloudAngle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L25_C8", "label": "srv_name =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L24_C4", "vector": [14, 2, 0.3968, 0.0159, 2, 0.81, 0.0, 114, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "srv_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " srv_name = '/%s/single_sweep_cloud' % service"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L26_C8", "label": "self.sp = ServiceProxy()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L24_C4", "vector": [14, 2, 0.4127, 0.0159, 2, 0.81, 1.0, 494, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "self.sp", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.sp = rospy.ServiceProxy(srv_name, snp.BuildCloudAngle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L28_C4", "label": "scan_np", "type": "function", "loc": [28, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "vector": [2, 1, 0.4603, 0.0476, 1, 0.85, 0.5, 102, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "scan_np", "arg_names": ["self", "start", "end", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan_np(self, start, end, duration):\n resp = self.sp(start, end, duration)\n return ru.pointcloud_to_np(resp.cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L29_C8", "label": "resp = sp()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L28_C4", "vector": [14, 2, 0.4603, 0.0159, 2, 0.88, 0.0, 48, 3, 3, 0, 0, 140, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "sp", "annotation": ""}, "snippet": " resp = self.sp(start, end, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L28_C4", "vector": [13, 2, 0.4762, 0.0159, 2, 0.88, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ru.pointcloud_to_np(resp.cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L32_C4", "label": "scan", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "vector": [2, 1, 0.5238, 0.0476, 1, 0.85, 1.0, 202, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "scan", "arg_names": ["self", "start", "end", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def scan(self, start, end, duration):\n resp = self.sp(start, end, duration)\n return resp.cloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L33_C8", "label": "resp = sp()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L32_C4", "vector": [14, 2, 0.5238, 0.0159, 2, 0.01, 0.0, 48, 3, 3, 0, 0, 140, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "sp", "annotation": ""}, "snippet": " resp = self.sp(start, end, duration)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L32_C4", "vector": [13, 2, 0.5397, 0.0159, 2, 0.01, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp.cloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "label": "sweep_param_to_tilt_param", "type": "function", "loc": [36, 40], "level": 0, "parent": null, "vector": [2, 0, 0.6032, 0.0794, 0, 0.66, 0.875, 671, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "sweep_param_to_tilt_param", "arg_names": ["angle_begin", "angle_end", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sweep_param_to_tilt_param(angle_begin, angle_end, duration):\n amplitude = abs(angle_end - angle_begin)/2.0 \n offset = (angle_end + angle_begin)/2.0 \n period = duration*2.0\n return {'amplitude': amplitude, 'offset':offset, 'period': period}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L37_C4", "label": "amplitude =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "vector": [14, 1, 0.5873, 0.0159, 1, 0.06, 0.0, 783, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "amplitude", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " amplitude = abs(angle_end - angle_begin)/2.0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L38_C4", "label": "offset =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "vector": [14, 1, 0.6032, 0.0159, 1, 0.06, 0.3333, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = (angle_end + angle_begin)/2.0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L39_C4", "label": "period =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "vector": [14, 1, 0.619, 0.0159, 1, 0.06, 0.6667, 297, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "period", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " period = duration*2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L40_C4", "label": "return", "type": "return", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "vector": [13, 1, 0.6349, 0.0159, 1, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'amplitude': amplitude, 'offset':offset, 'period': period}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L42_C0", "label": "PointCloudReceiver", "type": "class", "loc": [42, 60], "level": 0, "parent": null, "vector": [3, 0, 0.8095, 0.3016, 0, 0.66, 1.0, 990, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "PointCloudReceiver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PointCloudReceiver:\n def __init__(self, topic):\n self.listener = ru.GenericListener('point_cloud_receiver', sm.PointCloud, topic, .2)\n self.topic = topic\n\n def read(self):\n cur_time = rospy.Time.now().to_sec()\n not_fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L42_C0", "vector": [2, 1, 0.6984, 0.0476, 1, 0.12, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic):\n self.listener = ru.GenericListener('point_cloud_receiver', sm.PointCloud, topic, .2)\n self.topic = topic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L44_C8", "label": "self.listener = GenericListener()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L43_C4", "vector": [14, 2, 0.6984, 0.0159, 2, 0.86, 0.0, 686, 3, 4, 0, 0, 36, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " self.listener = ru.GenericListener('point_cloud_receiver', sm.PointCloud, topic, .2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L45_C8", "label": "self.topic =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L43_C4", "vector": [14, 2, 0.7143, 0.0159, 2, 0.86, 1.0, 928, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.topic = topic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "label": "read", "type": "function", "loc": [47, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L42_C0", "vector": [2, 1, 0.8492, 0.2222, 1, 0.12, 1.0, 453, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "read", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self):\n cur_time = rospy.Time.now().to_sec()\n not_fresh = True\n\n while not_fresh:\n pcmsg = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)\n if not (pcmsg.header.stamp.to_sec() < cur_time):\n not_fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L48_C8", "label": "cur_time = to_sec()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "vector": [14, 2, 0.7619, 0.0159, 2, 0.31, 0.0, 618, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "cur_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " cur_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L49_C8", "label": "not_fresh =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "vector": [14, 2, 0.7778, 0.0159, 2, 0.31, 0.3333, 649, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "not_fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " not_fresh = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "label": "while", "type": "while", "loc": [51, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "vector": [5, 2, 0.8651, 0.127, 2, 0.31, 0.6667, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not_fresh:\n pcmsg = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)\n if not (pcmsg.header.stamp.to_sec() < cur_time):\n not_fresh = False\n tdif = rospy.Time.now().to_sec() - cur_time\n if tdif > 10.:\n rospy.logerr('Have not heard from %s for %.2f seconds.' % (self.topic, tdif))\n rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L52_C12", "label": "pcmsg = read()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "vector": [14, 3, 0.8254, 0.0159, 3, 0.66, 0.0, 518, 3, 4, 0, 0, 453, 10, 1], "semantic": {"name": "pcmsg", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " pcmsg = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L53_C12", "label": "if", "type": "if", "loc": [53, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "vector": [4, 3, 0.8492, 0.0317, 3, 0.66, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (pcmsg.header.stamp.to_sec() < cur_time):\n not_fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L54_C16", "label": "not_fresh =", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L53_C12", "vector": [14, 4, 0.8571, 0.0159, 4, 0.63, 0.0, 649, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "not_fresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " not_fresh = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L55_C12", "label": "tdif =", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "vector": [14, 3, 0.873, 0.0159, 3, 0.66, 0.5, 682, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tdif", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tdif = rospy.Time.now().to_sec() - cur_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L56_C12", "label": "if", "type": "if", "loc": [56, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "vector": [4, 3, 0.8968, 0.0317, 3, 0.66, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tdif > 10.:\n rospy.logerr('Have not heard from %s for %.2f seconds.' % (self.topic, tdif))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Expr_L57_C16", "label": "logerr()", "type": "expression", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L56_C12", "vector": [8, 4, 0.9048, 0.0159, 4, 0.6, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Have not heard from %s for %.2f seconds.' % (self.topic, tdif))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Expr_L58_C12", "label": "sleep()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "vector": [8, 3, 0.9206, 0.0159, 3, 0.66, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L60_C8", "label": "return", "type": "return", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "vector": [13, 2, 0.9524, 0.0159, 2, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pcmsg"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:ClassDef_L42_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Expr_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:While_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99210:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99210:Return_L60_C8"}] |
#
# Temoprarily in this package. Advait needs to move it to a better
# location.
#
import numpy as np, math
import copy
import roslib; roslib.load_manifest('hrl_pr2_lib')
import rospy
import hrl_lib.util as ut
## Class defining the core EPC function and a few simple examples.
# More complex behaviors that use EPC should have their own ROS
# packages.
class EPC():
def __init__(self, robot):
self.robot = robot
self.f_list = []
self.ee_list = []
self.cep_list = []
##
# @param equi_pt_generator: function that returns stop, ea where ea: equilibrium angles and stop: string which is '' for epc motion to continue
# @param rapid_call_func: called in the time between calls to the equi_pt_generator can be used for logging, safety etc. returns string which is '' for epc motion to continue
# @param time_step: time between successive calls to equi_pt_generator
# @param arg_list - list of arguments to be passed to the equi_pt_generator
# @return stop (the string which has the reason why the epc
# motion stopped.), ea (last commanded equilibrium angles)
def epc_motion(self, equi_pt_generator, time_step, arm, arg_list,
rapid_call_func=None, control_function=None):
stop, ea = equi_pt_generator(*arg_list)
t_end = rospy.get_time()
while stop == '':
if rospy.is_shutdown():
stop = 'rospy shutdown'
continue
t_end += time_step
#self.robot.set_jointangles(arm, ea)
#import pdb; pdb.set_trace()
control_function(arm, *ea)
# self.robot.step() this should be within the rapid_call_func for the meka arms.
t1 = rospy.get_time()
while t1<t_end:
if rapid_call_func != None:
stop = rapid_call_func(arm)
if stop != '':
break
#self.robot.step() this should be within the rapid_call_func for the meka arms
rospy.sleep(0.01)
t1 = rospy.get_time()
if stop == '':
stop, ea = equi_pt_generator(*arg_list)
if stop == 'reset timing':
stop = ''
t_end = rospy.get_time()
return stop, ea
## Pull back along a straight line (-ve x direction)
# @param arm - 'right_arm' or 'left_arm'
# @param distance - how far back to pull.
def pull_back_cartesian_control(self, arm, distance, logging_fn):
cep, _ = self.robot.get_cep_jtt(arm)
cep_end = cep + distance * np.matrix([-1., 0., 0.]).T
self.dist_left = distance
def eq_gen_pull_back(cep):
logging_fn(arm)
if self.dist_left <= 0.:
return 'done', None
step_size = 0.01
cep[0,0] -= step_size
self.dist_left -= step_size
if cep[0,0] < 0.4:
return 'very close to the body: %.3f'%cep[0,0], None
return '', (cep, None)
arg_list = [cep]
s = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list,
control_function = self.robot.set_cep_jtt)
print s
def move_till_hit(self, arm, vec=np.matrix([0.3,0.,0.]).T, force_threshold=3.0,
speed=0.1, bias_FT=True):
unit_vec = vec/np.linalg.norm(vec)
time_step = 0.1
dist = np.linalg.norm(vec)
step_size = speed * time_step
cep_start, _ = self.robot.get_cep_jtt(arm)
cep = copy.copy(cep_start)
def eq_gen(cep):
force = self.robot.get_wrist_force(arm, base_frame = True)
force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion.
print 'force_projection:', force_projection
if force_projection>force_threshold:
return 'done', None
elif np.linalg.norm(force)>45.:
return 'large force', None
elif np.linalg.norm(cep_start-cep) >= dist:
return 'reached without contact', None
else:
cep_t = cep + unit_vec * step_size
cep[0,0] = cep_t[0,0]
cep[1,0] = cep_t[1,0]
cep[2,0] = cep_t[2,0]
return '', (cep, None)
if bias_FT:
self.robot.bias_wrist_ft(arm)
rospy.sleep(0.5)
return self.epc_motion(eq_gen, time_step, arm, [cep],
control_function = self.robot.set_cep_jtt)
def cep_gen_surface_follow(self, arm, move_dir, force_threshold,
cep, cep_start):
wrist_force = self.robot.get_wrist_force(arm, base_frame=True)
if wrist_force[0,0] < -3.:
cep[0,0] -= 0.002
if wrist_force[0,0] > -1.:
cep[0,0] += 0.003
if cep[0,0] > (cep_start[0,0]+0.05):
cep[0,0] = cep_start[0,0]+0.05
step_size = 0.002
cep_t = cep + move_dir * step_size
cep[0,0] = cep_t[0,0]
cep[1,0] = cep_t[1,0]
cep[2,0] = cep_t[2,0]
v = cep - cep_start
if (wrist_force.T * move_dir)[0,0] < -force_threshold:
stop = 'got a hook'
elif np.linalg.norm(wrist_force) > 50.:
stop = 'force is large %f'%(np.linalg.norm(wrist_force))
elif (v.T * move_dir)[0,0] > 0.20:
stop = 'moved a lot without a hook'
else:
stop = ''
return stop, (cep, None)
if __name__ == '__main__':
import pr2_arms as pa
rospy.init_node('epc_pr2', anonymous = True)
rospy.logout('epc_pr2: ready')
pr2_arms = pa.PR2Arms()
epc = EPC(pr2_arms)
r_arm, l_arm = 0, 1
arm = r_arm
# #----- testing move_till_hit ------
# p1 = np.matrix([0.6, -0.22, -0.05]).T
# epc.robot.go_cep_jtt(arm, p1)
# epc.move_till_hit(arm)
raw_input('Hit ENTER to close')
pr2_arms.close_gripper(arm)
raw_input('Hit ENTER to search_and_hook')
p1 = np.matrix([0.8, -0.22, -0.05]).T
epc.search_and_hook(arm, p1)
epc.pull_back_cartesian_control(arm, 0.3)
d = {
'f_list': epc.f_list, 'ee_list': epc.ee_list,
'cep_list': epc.cep_list
}
ut.save_pickle(d, 'pr2_pull_'+ut.formatted_time()+'.pkl')
# if False:
# ea = [0, 0, 0, 0, 0, 0, 0]
# ea = epc.robot.get_joint_angles(arm)
# rospy.logout('Going to starting position')
# epc.robot.set_jointangles(arm, ea, duration=4.0)
# raw_input('Hit ENTER to pull')
# epc.pull_back(arm, ea, tr.Rx(0), 0.2)
#
# if False:
# p = np.matrix([0.9, -0.3, -0.15]).T
# rot = tr.Rx(0.)
# rot = tr.Rx(math.radians(90.))
#
# rospy.logout('Going to starting position')
# # epc.robot.open_gripper(arm)
# epc.robot.set_cartesian(arm, p, rot)
# # raw_input('Hit ENTER to close the gripper')
# # epc.robot.close_gripper(arm)
# raw_input('Hit ENTER to pull')
# epc.pull_back_cartesian_control(arm, p, rot, 0.4)
| ajibawa-2023/Python-Code-Large/train/row_99211 | 109 | 204 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L7_C0", "label": "numpy import np, math", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0343, 0.0049, 0, 0.66, 0.0, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L8_C0", "label": "copy import copy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0392, 0.0049, 0, 0.66, 0.1429, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L10_C0", "label": "roslib import roslib", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.049, 0.0049, 0, 0.66, 0.2857, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L10_C15", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.049, 0.0049, 0, 0.66, 0.4286, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L11_C0", "label": "rospy import rospy", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0539, 0.0049, 0, 0.66, 0.5714, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L13_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0637, 0.0049, 0, 0.66, 0.7143, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "label": "EPC", "type": "class", "loc": [18, 147], "level": 0, "parent": null, "vector": [3, 0, 0.4044, 0.6373, 0, 0.66, 0.8571, 417, 0, 7, 0, 0, 0, 0, 30], "semantic": {"name": "EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EPC():\n def __init__(self, robot):\n self.robot = robot\n self.f_list = []\n self.ee_list = []\n self.cep_list = []\n\n ##"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "label": "__init__", "type": "function", "loc": [19, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "vector": [2, 1, 0.1029, 0.0245, 1, 0.01, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n self.robot = robot\n self.f_list = []\n self.ee_list = []\n self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L20_C8", "label": "self.robot =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "vector": [14, 2, 0.098, 0.0049, 2, 0.76, 0.0, 879, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.robot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.robot = robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L21_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "vector": [14, 2, 0.1029, 0.0049, 2, 0.76, 0.3333, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L22_C8", "label": "self.ee_list =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "vector": [14, 2, 0.1078, 0.0049, 2, 0.76, 0.6667, 959, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ee_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ee_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L23_C8", "label": "self.cep_list =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "vector": [14, 2, 0.1127, 0.0049, 2, 0.76, 1.0, 867, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cep_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "label": "epc_motion", "type": "function", "loc": [32, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "vector": [2, 1, 0.2328, 0.1569, 1, 0.01, 0.25, 938, 0, 7, 1, 0, 0, 0, 10], "semantic": {"name": "epc_motion", "arg_names": ["self", "equi_pt_generator", "time_step", "arm", "arg_list", "rapid_call_func", "control_function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def epc_motion(self, equi_pt_generator, time_step, arm, arg_list,\n rapid_call_func=None, control_function=None):\n\n stop, ea = equi_pt_generator(*arg_list)\n t_end = rospy.get_time()\n while stop == '':\n if rospy.is_shutdown():\n stop = 'rospy shutdown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L35_C8", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "vector": [14, 2, 0.1716, 0.0049, 2, 0.88, 0.0, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L36_C8", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "vector": [14, 2, 0.1765, 0.0049, 2, 0.88, 0.3333, 945, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t_end = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "label": "while", "type": "while", "loc": [37, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "vector": [5, 2, 0.2402, 0.1225, 2, 0.88, 0.6667, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while stop == '':\n if rospy.is_shutdown():\n stop = 'rospy shutdown'\n continue\n t_end += time_step\n #self.robot.set_jointangles(arm, ea)\n #import pdb; pdb.set_trace()\n control_function(arm, *ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L38_C12", "label": "if", "type": "if", "loc": [38, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "vector": [4, 3, 0.1912, 0.0147, 3, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n stop = 'rospy shutdown'\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L39_C16", "label": "stop =", "type": "assigned_variable", "loc": [39, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L38_C12", "vector": [14, 4, 0.1912, 0.0049, 4, 0.36, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'rospy shutdown'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L44_C12", "label": "control_function()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "vector": [8, 3, 0.2157, 0.0049, 3, 0.91, 0.2, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "control_function", "arg_names": [], "import_names": [], "rhs_call_name": "control_function", "annotation": ""}, "snippet": " control_function(arm, *ea)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L47_C12", "label": "t1 = get_time()", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "vector": [14, 3, 0.2304, 0.0049, 3, 0.91, 0.4, 329, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "label": "while", "type": "while", "loc": [48, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "vector": [5, 3, 0.2525, 0.0392, 3, 0.91, 0.6, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while t1<t_end:\n if rapid_call_func != None:\n stop = rapid_call_func(arm)\n if stop != '':\n break\n #self.robot.step() this should be within the rapid_call_func for the meka arms\n rospy.sleep(0.01)\n t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L49_C16", "label": "if", "type": "if", "loc": [49, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "vector": [4, 4, 0.2475, 0.0196, 4, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rapid_call_func != None:\n stop = rapid_call_func(arm)\n if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L50_C20", "label": "stop = rapid_call_func()", "type": "assigned_variable", "loc": [50, 50], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L49_C16", "vector": [14, 5, 0.2451, 0.0049, 5, 0.46, 0.0, 343, 3, 1, 0, 0, 571, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "rapid_call_func", "annotation": ""}, "snippet": " stop = rapid_call_func(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L51_C20", "label": "if", "type": "if", "loc": [51, 52], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L49_C16", "vector": [4, 5, 0.2525, 0.0098, 5, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop != '':\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L54_C16", "label": "sleep()", "type": "expression", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "vector": [8, 4, 0.2647, 0.0049, 4, 0.96, 0.5, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L55_C16", "label": "t1 = get_time()", "type": "assigned_variable", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "vector": [14, 4, 0.2696, 0.0049, 4, 0.96, 1.0, 329, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t1 = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L57_C12", "label": "if", "type": "if", "loc": [57, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "vector": [4, 3, 0.2819, 0.0098, 3, 0.91, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == '':\n stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L58_C16", "label": "stop, ea = equi_pt_generator()", "type": "assigned_variable", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L57_C12", "vector": [14, 4, 0.2843, 0.0049, 4, 0.16, 0.0, 665, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "stop, ea", "arg_names": [], "import_names": [], "rhs_call_name": "equi_pt_generator", "annotation": ""}, "snippet": " stop, ea = equi_pt_generator(*arg_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L59_C12", "label": "if", "type": "if", "loc": [59, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "vector": [4, 3, 0.2941, 0.0147, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == 'reset timing':\n stop = ''\n t_end = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L60_C16", "label": "stop =", "type": "assigned_variable", "loc": [60, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L59_C12", "vector": [14, 4, 0.2941, 0.0049, 4, 0.38, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L61_C16", "label": "t_end = get_time()", "type": "assigned_variable", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L59_C12", "vector": [14, 4, 0.299, 0.0049, 4, 0.38, 1.0, 945, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "t_end", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " t_end = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "vector": [13, 2, 0.3088, 0.0049, 2, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, ea"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "label": "pull_back_cartesian_control", "type": "function", "loc": [69, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "vector": [2, 1, 0.3848, 0.098, 1, 0.01, 0.5, 632, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "pull_back_cartesian_control", "arg_names": ["self", "arm", "distance", "logging_fn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull_back_cartesian_control(self, arm, distance, logging_fn):\n cep, _ = self.robot.get_cep_jtt(arm)\n cep_end = cep + distance * np.matrix([-1., 0., 0.]).T\n self.dist_left = distance\n\n def eq_gen_pull_back(cep):\n logging_fn(arm)\n if self.dist_left <= 0.:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L70_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [14, 2, 0.3431, 0.0049, 2, 0.78, 0.0, 705, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L71_C8", "label": "cep_end =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [14, 2, 0.348, 0.0049, 2, 0.78, 0.1667, 694, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_end = cep + distance * np.matrix([-1., 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L72_C8", "label": "self.dist_left =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [14, 2, 0.3529, 0.0049, 2, 0.78, 0.3333, 539, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dist_left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dist_left = distance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "label": "eq_gen_pull_back", "type": "function", "loc": [74, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [2, 2, 0.3848, 0.049, 2, 0.78, 0.5, 336, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "eq_gen_pull_back", "arg_names": ["cep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen_pull_back(cep):\n logging_fn(arm)\n if self.dist_left <= 0.:\n return 'done', None\n step_size = 0.01\n cep[0,0] -= step_size\n self.dist_left -= step_size\n if cep[0,0] < 0.4:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L75_C12", "label": "logging_fn()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "vector": [8, 3, 0.3676, 0.0049, 3, 0.12, 0.0, 515, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logging_fn", "arg_names": [], "import_names": [], "rhs_call_name": "logging_fn", "annotation": ""}, "snippet": " logging_fn(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L76_C12", "label": "if", "type": "if", "loc": [76, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "vector": [4, 3, 0.375, 0.0098, 3, 0.12, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.dist_left <= 0.:\n return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L77_C16", "label": "return", "type": "return", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L76_C12", "vector": [13, 4, 0.3775, 0.0049, 4, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L78_C12", "label": "step_size =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "vector": [14, 3, 0.3824, 0.0049, 3, 0.12, 0.5, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L81_C12", "label": "if", "type": "if", "loc": [81, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "vector": [4, 3, 0.3995, 0.0098, 3, 0.12, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cep[0,0] < 0.4:\n return 'very close to the body: %.3f'%cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L82_C16", "label": "return", "type": "return", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L81_C12", "vector": [13, 4, 0.402, 0.0049, 4, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'very close to the body: %.3f'%cep[0,0], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L83_C12", "label": "return", "type": "return", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "vector": [13, 3, 0.4069, 0.0049, 3, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L85_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [14, 2, 0.4167, 0.0049, 2, 0.78, 0.6667, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [cep]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L86_C8", "label": "s = epc_motion()", "type": "assigned_variable", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [14, 2, 0.424, 0.0098, 2, 0.78, 0.8333, 553, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " s = self.epc_motion(eq_gen_pull_back, 0.1, arm, arg_list,\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L88_C8", "label": "print()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "vector": [8, 2, 0.4314, 0.0049, 2, 0.78, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(s)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "label": "move_till_hit", "type": "function", "loc": [90, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "vector": [2, 1, 0.5123, 0.1471, 1, 0.01, 0.75, 163, 0, 6, 1, 0, 0, 0, 12], "semantic": {"name": "move_till_hit", "arg_names": ["self", "arm", "vec", "force_threshold", "speed", "bias_FT"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_till_hit(self, arm, vec=np.matrix([0.3,0.,0.]).T, force_threshold=3.0,\n speed=0.1, bias_FT=True):\n unit_vec = vec/np.linalg.norm(vec)\n time_step = 0.1\n dist = np.linalg.norm(vec)\n step_size = speed * time_step\n cep_start, _ = self.robot.get_cep_jtt(arm)\n cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L92_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [14, 2, 0.451, 0.0049, 2, 0.12, 0.0, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = vec/np.linalg.norm(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L93_C8", "label": "time_step =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [14, 2, 0.4559, 0.0049, 2, 0.12, 0.1111, 387, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "time_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_step = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L94_C8", "label": "dist = norm()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [14, 2, 0.4608, 0.0049, 2, 0.12, 0.2222, 673, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "dist", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " dist = np.linalg.norm(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L95_C8", "label": "step_size =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [14, 2, 0.4657, 0.0049, 2, 0.12, 0.3333, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = speed * time_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L96_C8", "label": "cep_start, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [14, 2, 0.4706, 0.0049, 2, 0.12, 0.4444, 342, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_start, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_start, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L97_C8", "label": "cep = copy()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [14, 2, 0.4755, 0.0049, 2, 0.12, 0.5556, 487, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "cep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "label": "eq_gen", "type": "function", "loc": [98, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [2, 2, 0.5172, 0.0784, 2, 0.12, 0.6667, 35, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "eq_gen", "arg_names": ["cep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eq_gen(cep):\n force = self.robot.get_wrist_force(arm, base_frame = True)\n force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion.\n print('force_projection:', force_projection)\n if force_projection>force_threshold:\n return 'done', None\n elif np.linalg.norm(force)>45.:\n return 'large force', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L99_C12", "label": "force = get_wrist_force()", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "vector": [14, 3, 0.4853, 0.0049, 3, 0.38, 0.0, 77, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " force = self.robot.get_wrist_force(arm, base_frame = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L100_C12", "label": "force_projection =", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "vector": [14, 3, 0.4902, 0.0049, 3, 0.38, 0.3333, 66, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_projection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_projection = force.T*unit_vec *-1 # projection in direction opposite to motion."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L101_C12", "label": "print()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "vector": [8, 3, 0.4951, 0.0049, 3, 0.38, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('force_projection:', force_projection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L102_C12", "label": "if", "type": "if", "loc": [102, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "vector": [4, 3, 0.527, 0.0588, 3, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_projection>force_threshold:\n return 'done', None\n elif np.linalg.norm(force)>45.:\n return 'large force', None\n elif np.linalg.norm(cep_start-cep) >= dist:\n return 'reached without contact', None\n else:\n cep_t = cep + unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L103_C16", "label": "return", "type": "return", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L102_C12", "vector": [13, 4, 0.5049, 0.0049, 4, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'done', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L104_C12", "label": "if", "type": "if", "loc": [104, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L102_C12", "vector": [4, 4, 0.5319, 0.049, 4, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.linalg.norm(force)>45.:\n return 'large force', None\n elif np.linalg.norm(cep_start-cep) >= dist:\n return 'reached without contact', None\n else:\n cep_t = cep + unit_vec * step_size\n cep[0,0] = cep_t[0,0]\n cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L105_C16", "label": "return", "type": "return", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L104_C12", "vector": [13, 5, 0.5147, 0.0049, 5, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'large force', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "label": "if", "type": "if", "loc": [106, 113], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L104_C12", "vector": [4, 5, 0.5368, 0.0392, 5, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.linalg.norm(cep_start-cep) >= dist:\n return 'reached without contact', None\n else:\n cep_t = cep + unit_vec * step_size\n cep[0,0] = cep_t[0,0]\n cep[1,0] = cep_t[1,0]\n cep[2,0] = cep_t[2,0]\n return '', (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L107_C16", "label": "return", "type": "return", "loc": [107, 107], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "vector": [13, 6, 0.5245, 0.0049, 6, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'reached without contact', None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L109_C16", "label": "cep_t =", "type": "assigned_variable", "loc": [109, 109], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "vector": [14, 6, 0.5343, 0.0049, 6, 0.53, 0.2, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L110_C16", "label": "assign", "type": "assigned_variable", "loc": [110, 110], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "vector": [14, 6, 0.5392, 0.0049, 6, 0.53, 0.4, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L111_C16", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "vector": [14, 6, 0.5441, 0.0049, 6, 0.53, 0.6, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L112_C16", "label": "assign", "type": "assigned_variable", "loc": [112, 112], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "vector": [14, 6, 0.549, 0.0049, 6, 0.53, 0.8, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L113_C16", "label": "return", "type": "return", "loc": [113, 113], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "vector": [13, 6, 0.5539, 0.0049, 6, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L115_C8", "label": "if", "type": "if", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [4, 2, 0.5662, 0.0098, 2, 0.12, 0.7778, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias_FT:\n self.robot.bias_wrist_ft(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L116_C12", "label": "bias_wrist_ft()", "type": "expression", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L115_C8", "vector": [8, 3, 0.5686, 0.0049, 3, 0.57, 0.0, 604, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "bias_wrist_ft", "arg_names": [], "import_names": [], "rhs_call_name": "bias_wrist_ft", "annotation": ""}, "snippet": " self.robot.bias_wrist_ft(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L117_C8", "label": "sleep()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [8, 2, 0.5735, 0.0049, 2, 0.12, 0.8889, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L118_C8", "label": "return", "type": "return", "loc": [118, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "vector": [13, 2, 0.5809, 0.0098, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.epc_motion(eq_gen, time_step, arm, [cep],\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "label": "cep_gen_surface_follow", "type": "function", "loc": [121, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "vector": [2, 1, 0.6569, 0.1324, 1, 0.01, 1.0, 994, 0, 6, 1, 0, 0, 0, 3], "semantic": {"name": "cep_gen_surface_follow", "arg_names": ["self", "arm", "move_dir", "force_threshold", "cep", "cep_start"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cep_gen_surface_follow(self, arm, move_dir, force_threshold,\n cep, cep_start):\n wrist_force = self.robot.get_wrist_force(arm, base_frame=True)\n if wrist_force[0,0] < -3.:\n cep[0,0] -= 0.002\n if wrist_force[0,0] > -1.:\n cep[0,0] += 0.003\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L123_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.6029, 0.0049, 2, 0.33, 0.0, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L124_C8", "label": "if", "type": "if", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [4, 2, 0.6103, 0.0098, 2, 0.33, 0.0909, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wrist_force[0,0] < -3.:\n cep[0,0] -= 0.002"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L126_C8", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [4, 2, 0.6201, 0.0098, 2, 0.33, 0.1818, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if wrist_force[0,0] > -1.:\n cep[0,0] += 0.003"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L129_C8", "label": "if", "type": "if", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [4, 2, 0.6348, 0.0098, 2, 0.33, 0.2727, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cep[0,0] > (cep_start[0,0]+0.05):\n cep[0,0] = cep_start[0,0]+0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L130_C12", "label": "assign", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L129_C8", "vector": [14, 3, 0.6373, 0.0049, 3, 0.23, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_start[0,0]+0.05"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L132_C8", "label": "step_size =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.6471, 0.0049, 2, 0.33, 0.3636, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.002"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L133_C8", "label": "cep_t =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.652, 0.0049, 2, 0.33, 0.4545, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + move_dir * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L134_C8", "label": "assign", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.6569, 0.0049, 2, 0.33, 0.5455, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L135_C8", "label": "assign", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.6618, 0.0049, 2, 0.33, 0.6364, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L136_C8", "label": "assign", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.6667, 0.0049, 2, 0.33, 0.7273, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L138_C8", "label": "v =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [14, 2, 0.6765, 0.0049, 2, 0.33, 0.8182, 553, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = cep - cep_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L139_C8", "label": "if", "type": "if", "loc": [139, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [4, 2, 0.6985, 0.0392, 2, 0.33, 0.9091, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (wrist_force.T * move_dir)[0,0] < -force_threshold:\n stop = 'got a hook'\n elif np.linalg.norm(wrist_force) > 50.:\n stop = 'force is large %f'%(np.linalg.norm(wrist_force))\n elif (v.T * move_dir)[0,0] > 0.20:\n stop = 'moved a lot without a hook'\n else:\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L140_C12", "label": "stop =", "type": "assigned_variable", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L139_C8", "vector": [14, 3, 0.6863, 0.0049, 3, 0.23, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'got a hook'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L141_C8", "label": "if", "type": "if", "loc": [141, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L139_C8", "vector": [4, 3, 0.7034, 0.0294, 3, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.linalg.norm(wrist_force) > 50.:\n stop = 'force is large %f'%(np.linalg.norm(wrist_force))\n elif (v.T * move_dir)[0,0] > 0.20:\n stop = 'moved a lot without a hook'\n else:\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L142_C12", "label": "stop =", "type": "assigned_variable", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L141_C8", "vector": [14, 4, 0.6961, 0.0049, 4, 0.84, 0.0, 343, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force is large %f'%(np.linalg.norm(wrist_force))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L143_C8", "label": "if", "type": "if", "loc": [143, 146], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L141_C8", "vector": [4, 4, 0.7083, 0.0196, 4, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif (v.T * move_dir)[0,0] > 0.20:\n stop = 'moved a lot without a hook'\n else:\n stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L144_C12", "label": "stop =", "type": "assigned_variable", "loc": [144, 144], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L143_C8", "vector": [14, 5, 0.7059, 0.0049, 5, 0.94, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'moved a lot without a hook'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L146_C12", "label": "stop =", "type": "assigned_variable", "loc": [146, 146], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L143_C8", "vector": [14, 5, 0.7157, 0.0049, 5, 0.94, 1.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "vector": [13, 2, 0.7206, 0.0049, 2, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "label": "if", "type": "if", "loc": [149, 177], "level": 0, "parent": null, "vector": [4, 0, 0.799, 0.1422, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import pr2_arms as pa\n rospy.init_node('epc_pr2', anonymous = True)\n rospy.logout('epc_pr2: ready')\n\n pr2_arms = pa.PR2Arms()\n epc = EPC(pr2_arms)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L150_C4", "label": "pr2_arms import pa", "type": "import", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [1, 1, 0.7353, 0.0049, 1, 0.49, 0.0, 369, 0, 1, 0, 0, 369, 0, 0], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L151_C4", "label": "init_node()", "type": "expression", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.7402, 0.0049, 1, 0.49, 0.0714, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('epc_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L152_C4", "label": "logout()", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.7451, 0.0049, 1, 0.49, 0.1429, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('epc_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L154_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [14, 1, 0.7549, 0.0049, 1, 0.49, 0.2143, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L155_C4", "label": "epc = EPC()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [14, 1, 0.7598, 0.0049, 1, 0.49, 0.2857, 304, 3, 1, 0, 0, 417, 10, 1], "semantic": {"name": "epc", "arg_names": [], "import_names": [], "rhs_call_name": "EPC", "annotation": ""}, "snippet": " epc = EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L157_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [14, 1, 0.7696, 0.0049, 1, 0.49, 0.3571, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L158_C4", "label": "arm =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [14, 1, 0.7745, 0.0049, 1, 0.49, 0.4286, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L165_C4", "label": "raw_input()", "type": "expression", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.8088, 0.0049, 1, 0.49, 0.5, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to close')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L166_C4", "label": "close_gripper()", "type": "expression", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.8137, 0.0049, 1, 0.49, 0.5714, 807, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " pr2_arms.close_gripper(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L167_C4", "label": "raw_input()", "type": "expression", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.8186, 0.0049, 1, 0.49, 0.6429, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to search_and_hook')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L168_C4", "label": "p1 =", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [14, 1, 0.8235, 0.0049, 1, 0.49, 0.7143, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.8, -0.22, -0.05]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L169_C4", "label": "search_and_hook()", "type": "expression", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.8284, 0.0049, 1, 0.49, 0.7857, 913, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "search_and_hook", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " epc.search_and_hook(arm, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L170_C4", "label": "pull_back_cartesian_control()", "type": "expression", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.8333, 0.0049, 1, 0.49, 0.8571, 632, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pull_back_cartesian_control", "arg_names": [], "import_names": [], "rhs_call_name": "pull_back_cartesian_control", "annotation": ""}, "snippet": " epc.pull_back_cartesian_control(arm, 0.3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L172_C4", "label": "d =", "type": "assigned_variable", "loc": [172, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [14, 1, 0.8505, 0.0196, 1, 0.49, 0.9286, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {\n 'f_list': epc.f_list, 'ee_list': epc.ee_list,\n 'cep_list': epc.cep_list\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L177_C4", "label": "save_pickle()", "type": "expression", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "vector": [8, 1, 0.8676, 0.0049, 1, 0.49, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d, 'pr2_pull_'+ut.formatted_time()+'.pkl')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L38_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L39_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L49_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L50_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L49_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L51_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L48_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L57_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:While_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L59_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L59_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L76_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L81_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L82_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L103_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L102_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L106_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L143_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Import_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99211:If_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99211:Expr_L177_C4"}] |
#! /usr/bin/python
import roslib
roslib.load_manifest("rospy")
roslib.load_manifest("sensor_msgs")
import rospy
from sensor_msgs.msg import PointCloud2
class Poller:
def __init__(self):
self.ind = 0
def callback(self,msg):
self.ind += 1
node_name = 'kinect_poller'
rospy.init_node(node_name)
pc_topic = rospy.get_param(node_name+'/topic_name')
poller = Poller()
rospy.sleep(1.0)
sub = rospy.Subscriber(pc_topic, PointCloud2, poller.callback)
r = rospy.Rate(100)
while not rospy.is_shutdown():
if poller.ind != 0:
break
r.sleep()
print "Polling %s" % pc_topic
rospy.spin()
| ajibawa-2023/Python-Code-Large/train/row_99213 | 21 | 27 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0741, 0.037, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1111, 0.037, 0, 0.66, 0.0667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"rospy\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1481, 0.037, 0, 0.66, 0.1333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"sensor_msgs\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1852, 0.037, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:ImportFrom_L7_C0", "label": "from sensor_msgs.msg import PointCloud2", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2593, 0.037, 0, 0.66, 0.2667, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:ClassDef_L9_C0", "label": "Poller", "type": "class", "loc": [9, 13], "level": 0, "parent": null, "vector": [3, 0, 0.4074, 0.1852, 0, 0.66, 0.3333, 423, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "Poller", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Poller:\n def __init__(self):\n self.ind = 0\n def callback(self,msg):\n self.ind += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99213:ClassDef_L9_C0", "vector": [2, 1, 0.3889, 0.0741, 1, 0.5, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L11_C8", "label": "self.ind =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99213:FunctionDef_L10_C4", "vector": [14, 2, 0.4074, 0.037, 2, 0.53, 0.0, 616, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.ind", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ind = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:FunctionDef_L12_C4", "label": "callback", "type": "function", "loc": [12, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99213:ClassDef_L9_C0", "vector": [2, 1, 0.463, 0.0741, 1, 0.5, 1.0, 342, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self,msg):\n self.ind += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L15_C0", "label": "node_name =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.037, 0, 0.66, 0.4, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = 'kinect_poller'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L16_C0", "label": "init_node()", "type": "expression", "loc": [16, 16], "level": 0, "parent": null, "vector": [8, 0, 0.5926, 0.037, 0, 0.66, 0.4667, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node(node_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L17_C0", "label": "pc_topic = get_param()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.6296, 0.037, 0, 0.66, 0.5333, 633, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "pc_topic", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": "pc_topic = rospy.get_param(node_name+'/topic_name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L18_C0", "label": "poller = Poller()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.6667, 0.037, 0, 0.66, 0.6, 716, 3, 0, 0, 0, 423, 10, 1], "semantic": {"name": "poller", "arg_names": [], "import_names": [], "rhs_call_name": "Poller", "annotation": ""}, "snippet": "poller = Poller()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L19_C0", "label": "sleep()", "type": "expression", "loc": [19, 19], "level": 0, "parent": null, "vector": [8, 0, 0.7037, 0.037, 0, 0.66, 0.6667, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": "rospy.sleep(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L20_C0", "label": "sub = Subscriber()", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.7407, 0.037, 0, 0.66, 0.7333, 819, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": "sub = rospy.Subscriber(pc_topic, PointCloud2, poller.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L21_C0", "label": "r = Rate()", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.7778, 0.037, 0, 0.66, 0.8, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": "r = rospy.Rate(100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:While_L22_C0", "label": "while", "type": "while", "loc": [22, 25], "level": 0, "parent": null, "vector": [5, 0, 0.8704, 0.1481, 0, 0.66, 0.8667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n if poller.ind != 0:\n break\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:If_L23_C4", "label": "if", "type": "if", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99213:While_L22_C0", "vector": [4, 1, 0.8704, 0.0741, 1, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if poller.ind != 0:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L25_C4", "label": "sleep()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99213:While_L22_C0", "vector": [8, 1, 0.9259, 0.037, 1, 0.33, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L26_C0", "label": "print()", "type": "expression", "loc": [26, 26], "level": 0, "parent": null, "vector": [8, 0, 0.963, 0.037, 0, 0.66, 0.9333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"Polling %s\" % pc_topic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L27_C0", "label": "spin()", "type": "expression", "loc": [27, 27], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.037, 0, 0.66, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": "rospy.spin()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99213:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99213:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99213:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99213:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99213:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99213:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99213:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99213:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99213:While_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99213:Expr_L25_C4"}] |
import roslib; roslib.load_manifest('hrl_pr2_lib')
import rospy
import numpy as np
import pr2_msgs.msg as pm
class PressureListener:
def __init__(self, topic='/pressure/l_gripper_motor', safe_pressure_threshold = 4000):
rospy.Subscriber(topic, pm.PressureState, self.press_cb)
self.lmat = None
self.rmat = None
self.lmat0 = None
self.rmat0 = None
self.lmat_raw = None
self.rmat_raw = None
self.safe_pressure_threshold = safe_pressure_threshold
self.exceeded_safe_threshold = False
self.threshold = None
self.exceeded_threshold = False
def rezero(self):
self.lmat0 = None
self.rmat0 = None
self.exceeded_threshold = False
self.exceeded_safe_threshold = False
def check_safety_threshold(self):
r = self.exceeded_safe_threshold
self.exceeded_safe_threshold = False #reset
return r
def check_threshold(self):
r = self.exceeded_threshold
self.exceeded_threshold = False
return r
def set_threshold(self, threshold):
self.threshold = threshold
def get_pressure_readings(self):
return self.lmat, self.rmat
def press_cb(self, pmsg):
lmat = np.matrix((pmsg.l_finger_tip)).T
rmat = np.matrix((pmsg.r_finger_tip)).T
if self.lmat0 == None:
self.lmat0 = lmat
self.rmat0 = rmat
return
self.lmat_raw = lmat
self.rmat_raw = rmat
lmat = lmat - self.lmat0
rmat = rmat - self.rmat0
#touch detected
if np.any(np.abs(lmat) > self.safe_pressure_threshold) or np.any(np.abs(rmat) > self.safe_pressure_threshold):
self.exceeded_safe_threshold = True
if self.threshold != None and (np.any(np.abs(lmat) > self.threshold) or np.any(np.abs(rmat) > self.threshold)):
#print 'EXCEEDED threshold', self.threshold
#print 'PressureListener: ', np.max(np.abs(lmat)), np.max(np.abs(rmat)), 'threshold', self.threshold
self.exceeded_threshold = True
self.lmat = lmat
self.rmat = rmat
| ajibawa-2023/Python-Code-Large/train/row_99214 | 52 | 71 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0141, 0.0141, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0141, 0.0141, 0, 0.66, 0.2, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0282, 0.0141, 0, 0.66, 0.4, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0141, 0, 0.66, 0.6, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Import_L4_C0", "label": "pr2_msgs.msg import pm", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0563, 0.0141, 0, 0.66, 0.8, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_msgs.msg as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "label": "PressureListener", "type": "class", "loc": [7, 69], "level": 0, "parent": null, "vector": [3, 0, 0.5352, 0.8873, 0, 0.66, 1.0, 422, 0, 7, 0, 0, 0, 0, 11], "semantic": {"name": "PressureListener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PressureListener:\n def __init__(self, topic='/pressure/l_gripper_motor', safe_pressure_threshold = 4000):\n rospy.Subscriber(topic, pm.PressureState, self.press_cb)\n self.lmat = None\n self.rmat = None\n self.lmat0 = None\n self.rmat0 = None\n self.lmat_raw = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "label": "__init__", "type": "function", "loc": [8, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.2042, 0.1972, 1, 0.72, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "topic", "safe_pressure_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topic='/pressure/l_gripper_motor', safe_pressure_threshold = 4000):\n rospy.Subscriber(topic, pm.PressureState, self.press_cb)\n self.lmat = None\n self.rmat = None\n self.lmat0 = None\n self.rmat0 = None\n self.lmat_raw = None\n self.rmat_raw = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Expr_L9_C8", "label": "Subscriber()", "type": "expression", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [8, 2, 0.1268, 0.0141, 2, 0.79, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(topic, pm.PressureState, self.press_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L10_C8", "label": "self.lmat =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.1408, 0.0141, 2, 0.79, 0.1, 486, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L11_C8", "label": "self.rmat =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.1549, 0.0141, 2, 0.79, 0.2, 15, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L12_C8", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.169, 0.0141, 2, 0.79, 0.3, 529, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L13_C8", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.1831, 0.0141, 2, 0.79, 0.4, 344, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L14_C8", "label": "self.lmat_raw =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.1972, 0.0141, 2, 0.79, 0.5, 88, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.lmat_raw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat_raw = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L15_C8", "label": "self.rmat_raw =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.2113, 0.0141, 2, 0.79, 0.6, 696, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.rmat_raw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat_raw = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L17_C8", "label": "self.safe_pressure_threshold =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.2394, 0.0141, 2, 0.79, 0.7, 302, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.safe_pressure_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.safe_pressure_threshold = safe_pressure_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L18_C8", "label": "self.exceeded_safe_threshold =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.2535, 0.0141, 2, 0.79, 0.8, 226, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_safe_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_safe_threshold = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L20_C8", "label": "self.threshold =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.2817, 0.0141, 2, 0.79, 0.9, 493, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.threshold = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L21_C8", "label": "self.exceeded_threshold =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "vector": [14, 2, 0.2958, 0.0141, 2, 0.79, 1.0, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_threshold = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "label": "rezero", "type": "function", "loc": [23, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.3521, 0.0704, 1, 0.72, 0.1667, 22, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "rezero", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rezero(self):\n self.lmat0 = None\n self.rmat0 = None\n self.exceeded_threshold = False\n self.exceeded_safe_threshold = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L24_C8", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "vector": [14, 2, 0.338, 0.0141, 2, 0.82, 0.0, 529, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L25_C8", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "vector": [14, 2, 0.3521, 0.0141, 2, 0.82, 0.3333, 344, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L26_C8", "label": "self.exceeded_threshold =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "vector": [14, 2, 0.3662, 0.0141, 2, 0.82, 0.6667, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_threshold = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L27_C8", "label": "self.exceeded_safe_threshold =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "vector": [14, 2, 0.3803, 0.0141, 2, 0.82, 1.0, 226, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_safe_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_safe_threshold = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "label": "check_safety_threshold", "type": "function", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.4296, 0.0563, 1, 0.72, 0.3333, 404, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "check_safety_threshold", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_safety_threshold(self):\n r = self.exceeded_safe_threshold\n self.exceeded_safe_threshold = False #reset \n return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L30_C8", "label": "r =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "vector": [14, 2, 0.4225, 0.0141, 2, 0.76, 0.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = self.exceeded_safe_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L31_C8", "label": "self.exceeded_safe_threshold =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "vector": [14, 2, 0.4366, 0.0141, 2, 0.76, 0.5, 226, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_safe_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_safe_threshold = False #reset "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "vector": [13, 2, 0.4507, 0.0141, 2, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "label": "check_threshold", "type": "function", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.5, 0.0563, 1, 0.72, 0.5, 347, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "check_threshold", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_threshold(self):\n r = self.exceeded_threshold\n self.exceeded_threshold = False\n return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L35_C8", "label": "r =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "vector": [14, 2, 0.493, 0.0141, 2, 0.71, 0.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = self.exceeded_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L36_C8", "label": "self.exceeded_threshold =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "vector": [14, 2, 0.507, 0.0141, 2, 0.71, 0.5, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_threshold = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "vector": [13, 2, 0.5211, 0.0141, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L39_C4", "label": "set_threshold", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.5563, 0.0282, 1, 0.72, 0.6667, 794, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_threshold", "arg_names": ["self", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_threshold(self, threshold):\n self.threshold = threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L40_C8", "label": "self.threshold =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L39_C4", "vector": [14, 2, 0.5634, 0.0141, 2, 0.53, 0.0, 493, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.threshold = threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L42_C4", "label": "get_pressure_readings", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.5986, 0.0282, 1, 0.72, 0.8333, 767, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_pressure_readings", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_pressure_readings(self):\n return self.lmat, self.rmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L42_C4", "vector": [13, 2, 0.6056, 0.0141, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.lmat, self.rmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "label": "press_cb", "type": "function", "loc": [45, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "vector": [2, 1, 0.8028, 0.3521, 1, 0.72, 1.0, 923, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "press_cb", "arg_names": ["self", "pmsg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def press_cb(self, pmsg):\n lmat = np.matrix((pmsg.l_finger_tip)).T\n rmat = np.matrix((pmsg.r_finger_tip)).T\n if self.lmat0 == None:\n self.lmat0 = lmat\n self.rmat0 = rmat\n return\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L46_C8", "label": "lmat =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.6479, 0.0141, 2, 0.2, 0.0, 697, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lmat = np.matrix((pmsg.l_finger_tip)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L47_C8", "label": "rmat =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.662, 0.0141, 2, 0.2, 0.1, 674, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = np.matrix((pmsg.r_finger_tip)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "label": "if", "type": "if", "loc": [48, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [4, 2, 0.6972, 0.0563, 2, 0.2, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.lmat0 == None:\n self.lmat0 = lmat\n self.rmat0 = rmat\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L49_C12", "label": "self.lmat0 =", "type": "assigned_variable", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "vector": [14, 3, 0.6901, 0.0141, 3, 0.73, 0.0, 529, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat0 = lmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L50_C12", "label": "self.rmat0 =", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "vector": [14, 3, 0.7042, 0.0141, 3, 0.73, 0.5, 344, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rmat0", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat0 = rmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L51_C12", "label": "return", "type": "return", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "vector": [13, 3, 0.7183, 0.0141, 3, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L53_C8", "label": "self.lmat_raw =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.7465, 0.0141, 2, 0.2, 0.3, 88, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lmat_raw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat_raw = lmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L54_C8", "label": "self.rmat_raw =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.7606, 0.0141, 2, 0.2, 0.4, 696, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rmat_raw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat_raw = rmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L56_C8", "label": "lmat =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.7887, 0.0141, 2, 0.2, 0.5, 697, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lmat = lmat - self.lmat0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L57_C8", "label": "rmat =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.8028, 0.0141, 2, 0.2, 0.6, 674, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rmat = rmat - self.rmat0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L60_C8", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [4, 2, 0.8521, 0.0282, 2, 0.2, 0.7, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(np.abs(lmat) > self.safe_pressure_threshold) or np.any(np.abs(rmat) > self.safe_pressure_threshold):\n self.exceeded_safe_threshold = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L61_C12", "label": "self.exceeded_safe_threshold =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L60_C8", "vector": [14, 3, 0.8592, 0.0141, 3, 0.81, 0.0, 226, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_safe_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_safe_threshold = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L63_C8", "label": "if", "type": "if", "loc": [63, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [4, 2, 0.9085, 0.0563, 2, 0.2, 0.8, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.threshold != None and (np.any(np.abs(lmat) > self.threshold) or np.any(np.abs(rmat) > self.threshold)):\n #print 'EXCEEDED threshold', self.threshold\n #print 'PressureListener: ', np.max(np.abs(lmat)), np.max(np.abs(rmat)), 'threshold', self.threshold\n self.exceeded_threshold = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L66_C12", "label": "self.exceeded_threshold =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L63_C8", "vector": [14, 3, 0.9296, 0.0141, 3, 0.14, 0.0, 390, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.exceeded_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exceeded_threshold = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L68_C8", "label": "self.lmat =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.9577, 0.0141, 2, 0.2, 0.9, 486, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lmat = lmat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L69_C8", "label": "self.rmat =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "vector": [14, 2, 0.9718, 0.0141, 2, 0.2, 1.0, 15, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rmat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rmat = rmat"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Return_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99214:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99214:Assign_L69_C8"}] |
import roslib; roslib.load_manifest('hrl_pr2_lib')
import rospy
import pr2_gripper_reactive_approach.reactive_grasp as rgr
import pr2_gripper_reactive_approach.controller_manager as con
import object_manipulator.convert_functions as cf
from actionlib_msgs.msg import GoalStatus
from geometry_msgs.msg import Pose, PoseStamped, Point, Quaternion
from pr2_gripper_sensor_msgs.msg import PR2GripperEventDetectorGoal
#import collision_monitor as cmon
#import hrl_pr2_lib.devices as de
import hrl_lib.tf_utils as tfu
import hrl_pr2_lib.pressure_listener as pm
import numpy as np
import tf
import pdb
import time
import hrl_lib.util as ut
import math
class RobotSafetyError(Exception):
def __init__(self, value):
self.parameter = value
def __str__(self):
return repr(self.parameter)
## NOT THREAD SAFE
class ArmStoppedDetector:
def __init__(self, pos_thres=0.0001, rot_thres=0.001, time_settle=1., hz=30., n_step=3000):
self.pos_diff = []
self.rot_diff = []
self.times = []
self.last_pos = None
self.last_t = None
self.n_step = n_step
self.hz = hz
self.time_settle = time_settle
self.pos_thres = pos_thres
self.rot_thres = rot_thres
self.start_time = time.time()
def record_diff(self, loc_mat):
cur_t = time.time() - self.start_time
if self.last_t == None or (cur_t - self.last_t) > (1./self.hz):
pos, rot = tfu.matrix_as_tf(loc_mat)
if self.last_pos != None:
self.pos_diff.append(np.linalg.norm(np.matrix(pos) - np.matrix(self.last_pos[0])))
lp = np.array(self.last_pos[1]) / np.linalg.norm(self.last_pos[1])
r = np.array(rot) / np.linalg.norm(rot)
#pdb.set_trace()
self.rot_diff.append(np.linalg.norm(lp - r))
self.times.append(cur_t)
sidx = len(self.pos_diff) - self.n_step
self.pos_diff = self.pos_diff[sidx:]
self.pose_diff = self.rot_diff[sidx:]
self.last_pos = tfu.matrix_as_tf(loc_mat)
self.last_t = cur_t
def is_stopped(self):
cur_t = time.time() - self.start_time
pos_over_thres_idx = np.where(np.array(self.pos_diff) > self.pos_thres)[0]
rot_over_thres_idx = np.where(np.array(self.rot_diff) > self.rot_thres)[0]
if len(pos_over_thres_idx) > 0 or len(rot_over_thres_idx) > 0:
max_times = []
if len(pos_over_thres_idx) > 0:
max_times.append(self.times[pos_over_thres_idx[-1]])
if len(rot_over_thres_idx) > 0:
max_times.append(self.times[rot_over_thres_idx[-1]])
tmax = np.max(max_times)
if (cur_t - tmax) > self.time_settle:
print cur_t - tmax, tmax, self.time_settle, max_times
return True
else:
return False
elif len(self.pos_diff) > (self.time_settle * self.hz):
return True
else:
return False
#if (np.any(np.array(self.pos_diff)) < self.pos_thres and
# np.any(np.array(self.rot_diff)) < self.rot_thres):
# return False
#else:
# return True
class LinearReactiveMovement:
##
# @param arm 'l' or 'r'
# @param pr2 Pr2 object (pr2.py)
# @param tf_listener a tf.TransformListener()
def __init__(self, arm, pr2, tf_listener, using_slip_controller=1, using_slip_detection=1):
if tf_listener == None:
self.tf_listener = tf.TransformListener()
else:
self.tf_listener = tf_listener
self.pr2 = pr2
if arm == 'l':
self.ik_frame = 'l_wrist_roll_link'
self.tool_frame = 'l_gripper_tool_frame'
self.arm_obj = self.pr2.left
ptopic = '/pressure/l_gripper_motor'
else:
self.ik_frame = 'r_wrist_roll_link'
self.tool_frame = 'r_gripper_tool_frame'
self.arm_obj = self.pr2.right
ptopic = '/pressure/r_gripper_motor'
self.pressure_listener = pm.PressureListener(ptopic, 5000)
print 'INITIALIZING CONTROLLER MANAGER'
self.cman = con.ControllerManager(arm, self.tf_listener, using_slip_controller,
using_slip_detection)
print 'INITIALIZAING REACTIVE GRASPER'
self.reactive_gr = rgr.ReactiveGrasper(self.cman)
#self.collision_monitor = cmon.CollisionClient(arm)
#cpy from kaijen code
#gripper_event_detector_action_name = arm+'_gripper_sensor_controller/event_detector'
#self.gripper_event_detector_action_client = actionlib.SimpleActionClient(gripper_event_detector_action_name, \
# PR2GripperEventDetectorAction)
self.movement_mode = 'cart' #or cart
#self.cman.start_joint_controllers()
#self.cman.start_gripper_controller()
self.timeout = 50.
##
# TODO is this redundant?
# @return 3x1 pos matrix, and 4x1 orientation matrix both in base_link
#def current_location(self):
# pos, rot = tfu.matrix_as_tf(self.arm_obj.pose_cartesian())
# return np.matrix(pos).T, np.matrix(rot).T
##
# Moves to a given position, orientation
#
# @param loc (3x1 position matrix, 4x1 orientation matrix) in base_link
# @param stop 'pressure_accel', 'pressure'
# @param pressure pressure to use
def move_absolute_old(self, loc, stop='pressure_accel', pressure=300):
self.set_pressure_threshold(pressure)
stop_funcs = self._process_stop_option(stop)
self.set_movement_mode_cart()
#pdb.set_trace()
self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout, settling_time=5.0)
self.set_movement_mode_ik()
r = self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout, settling_time=5.0)
#tfu.matrix_as_tf(self.arm_obj.pose_cartesian())[0]
#diff = loc[0] - self.current_location()[0]
diff = loc[0] - self.arm_obj.pose_cartesian_tf()[0]
rospy.loginfo('move_absolute: diff is %s' % str(diff.T))
rospy.loginfo('move_absolute: dist %.3f' % np.linalg.norm(diff))
return r, np.linalg.norm(diff)
def move_absolute(self, loc, stop='pressure_accel', pressure=300, frame='base_link'):
self.set_pressure_threshold(pressure)
stop_funcs = self._process_stop_option(stop)
r = self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout,
settling_time=5.0, frame=frame)
diff = loc[0] - self.arm_obj.pose_cartesian_tf()[0]
rospy.loginfo('move_absolute: diff is %s' % str(diff.T))
rospy.loginfo('move_absolute: dist %.3f' % np.linalg.norm(diff))
return r, np.linalg.norm(diff)
##
# Moves relative to an arbitrary frame
#
# @param movement_target 3x1 matrix a displacement in the target frame
# @param target_frame string id of the frame in which the movement is defined
# @param stop 'pressure_accel', 'pressure'
# @param pressure pressure to use
def move_relative(self, movement_target, target_frame, stop='pressure_accel', pressure=150):
base_T_target = tfu.transform('base_link', target_frame, self.tf_listener)
movement_base = base_T_target[0:3, 0:3] * movement_target
return self.move_relative_base(movement_base, stop=stop, pressure=pressure)
##
# Moves relative to tool frame
#
# @param movement_tool 3x1 matrix a displacement in the tool frame
# @param stop 'pressure_accel', 'pressure'
# @param pressure pressure to use
def move_relative_gripper(self, movement_tool, stop='pressure_accel', pressure=150):
base_T_tool = tfu.transform('base_link', self.tool_frame, self.tf_listener)
movement_base = base_T_tool[0:3, 0:3] * movement_tool # np.concatenate((movement_tool, np.matrix([1])))
return self.move_relative_base(movement_base, stop=stop, pressure=pressure)
##
# Moves relative to base frame
#
# @param movement 3x1 matrix displacement in base_frame
# @param stop 'pressure_accel', 'pressure'
# @param pressure pressure to use
def move_relative_base(self, movement, stop='pressure_accel', pressure=150):
self.set_pressure_threshold(pressure)
trans, rot = self.arm_obj.pose_cartesian_tf()
ntrans = trans + movement
stop_funcs = self._process_stop_option(stop)
r = self._move_cartesian(ntrans, rot, stop_funcs, \
timeout=self.timeout, settling_time=5.0)
diff = self.arm_obj.pose_cartesian_tf()[0] - (trans + movement)
rospy.loginfo('move_relative_base: diff is ' + str(diff.T))
rospy.loginfo('move_relative_base: dist %.3f' % np.linalg.norm(diff))
return r, np.linalg.norm(diff)
##
# Close gripper
def gripper_close(self):
self.reactive_gr.compliant_close()
##
# Open gripper
def gripper_open(self):
self.reactive_gr.cm.command_gripper(.1, -1, 1)
def set_pressure_threshold(self, t):
self.pressure_listener.set_threshold(t)
##
# Change which set of controllers are being used for move_* commands
def set_movement_mode_ik(self):
self.movement_mode = 'ik'
self.reactive_gr.cm.switch_to_joint_mode()
self.reactive_gr.cm.freeze_arm()
##
# Change which set of controllers are being used for move_* commands
def set_movement_mode_cart(self):
self.movement_mode = 'cart'
def _move_cartesian(self, position, orientation, \
stop_funcs=[], timeout = 3.0, settling_time = 0.5, \
frame='base_link', vel=.15):
if self.movement_mode == 'ik':
return self._move_cartesian_ik(position, orientation, stop_funcs, \
timeout, settling_time, frame, vel=.15)
elif self.movement_mode == 'cart':
return self._move_cartesian_cart(position, orientation, stop_funcs, \
timeout, settling_time, frame)
##
# move the wrist to a desired Cartesian pose while watching the fingertip sensors
# settling_time is how long to wait after the controllers think we're there
def _move_cartesian_cart(self, position, orientation, \
stop_funcs=[], timeout = 3.0, settling_time = 0.5, frame='base_link'):
# TODO: Test this function...
# Transform the pose from 'frame' to 'base_link'
self.tf_listener.waitForTransform('base_link', frame, rospy.Time(),
rospy.Duration(10))
frame_T_base = tfu.transform('base_link', frame, self.tf_listener)
init_cart_pose = tfu.tf_as_matrix((position.A1.tolist(),
orientation.A1.tolist()))
base_cart_pose = frame_T_base*init_cart_pose
# Get IK from tool frame to wrist frame for control input
self.tf_listener.waitForTransform(self.ik_frame, self.tool_frame, rospy.Time(), rospy.Duration(10))
toolframe_T_ikframe = tfu.transform(self.tool_frame, self.ik_frame, self.tf_listener)
#base_cart_pose = tfu.tf_as_matrix((base_position.A1.tolist(), base_orientation.A1.tolist()))
base_cart_pose = base_cart_pose * toolframe_T_ikframe
base_position, base_orientation = tfu.matrix_as_tf(base_cart_pose)
pose_stamped = cf.create_pose_stamped(base_position.tolist() + base_orientation.tolist())
rg = self.reactive_gr
rg.check_preempt()
#send the goal to the Cartesian controllers
#rospy.loginfo("sending goal to Cartesian controllers")
(pos, rot) = cf.pose_stamped_to_lists(rg.cm.tf_listener, pose_stamped, 'base_link')
rg.move_cartesian_step(pos+rot, timeout, settling_time)
#watch the fingertip/palm sensors until the controllers are done and then some
start_time = rospy.get_rostime()
done_time = None
#stopped = False
stop_trigger = None
#print 'enterning loop'
stop_detector = ArmStoppedDetector()
while(1):
rg.check_preempt()
if len(stop_funcs) > 0:
for f, name in stop_funcs:
if f():
rg.cm.switch_to_joint_mode()
rg.cm.freeze_arm()
#stopped = True
stop_trigger = name
rospy.loginfo('"%s" requested that motion should be stopped.' % (name))
break
if stop_trigger != None:
break
#if stop_func != None and stop_func():
# rg.cm.switch_to_joint_mode()
# rg.cm.freeze_arm()
# stopped = True
# break
#check if we're actually there
if rg.cm.check_cartesian_near_pose(pose_stamped, .0025, .05):
rospy.loginfo("_move_cartesian_cart: reached pose")
#stop_trigger = 'at_pose'
break
stop_detector.record_diff(self.arm_obj.pose_cartesian())
if stop_detector.is_stopped():
rospy.loginfo("_move_cartesian_cart: arm stopped")
#stop_trigger = 'stopped'
break
# if rg.cm.check_cartesian_really_done(pose_stamped, .0025, .05):
# #rospy.loginfo("actually got there")
# break
#
# #check if the controllers think we're done
# if not done_time and rg.cm.check_cartesian_done():
# #rospy.loginfo("check_cartesian_done returned 1")
# done_time = rospy.get_rostime()
# #done settling
# if done_time and rospy.get_rostime() - done_time > rospy.Duration(settling_time):
# rospy.loginfo("done settling")
# break
#timed out
#if timeout != 0. and rospy.get_rostime() - start_time > rospy.Duration(timeout):
# rospy.loginfo("_move_cartesian_cart: timed out")
# break
#if stop_trigger == 'pressure_safety' or stop_trigger == 'self_collision':
if stop_trigger == 'pressure_safety':
print 'ROBOT SAFETY ERROR'
#raise RobotSafetyError(stop_trigger)
#name = ut.formatted_time() + '_stop_detector.pkl'
#print 'saved', name
#ut.save_pickle(stop_detector, name)
return stop_trigger
def _move_cartesian_ik(self, position, orientation, \
stop_funcs=[], timeout = 30., settling_time = 0.25, \
frame='base_link', vel=.15):
#pdb.set_trace()
#self.arm_obj.set_cart_pose_ik(cart_pose, total_time=motion_length, frame=frame, block=False)
#cart_pose = tfu.tf_as_matrix((position.A1.tolist(), orientation.A1.tolist()))
self.tf_listener.waitForTransform(self.ik_frame, self.tool_frame, rospy.Time(), rospy.Duration(10))
toolframe_T_ikframe = tfu.transform(self.tool_frame, self.ik_frame, self.tf_listener)
cart_pose = tfu.tf_as_matrix((position.A1.tolist(), orientation.A1.tolist()))
cart_pose = cart_pose * toolframe_T_ikframe
position, orientation = tfu.matrix_as_tf(cart_pose)
#goal_pose_ps = create_pose_stamped(position.A1.tolist() + orientation.A1.tolist(), frame)
goal_pose_ps = cf.create_pose_stamped(position.tolist() + orientation.tolist(), frame)
r = self.reactive_gr.cm.move_cartesian_ik(goal_pose_ps, blocking=0, step_size=.005, \
pos_thres=.02, rot_thres=.1, timeout=rospy.Duration(timeout),
settling_time=rospy.Duration(settling_time), vel=vel)
if not (r == 'sent goal' or r == 'success'):
return r
#move_cartesian_ik(self, goal_pose, collision_aware = 0, blocking = 1,
# step_size = .005, pos_thres = .02, rot_thres = .1,
# timeout = rospy.Duration(30.),
# settling_time = rospy.Duration(0.25), vel = .15):
stop_trigger = None
done_time = None
start_time = rospy.get_rostime()
while stop_trigger == None:
for f, name in stop_funcs:
if f():
self.arm_obj.stop_trajectory_execution()
stop_trigger = name
rospy.loginfo('"%s" requested that motion should be stopped.' % (name))
break
if timeout != 0. and rospy.get_rostime() - start_time > rospy.Duration(timeout):
rospy.loginfo("_move_cartesian_ik: motion timed out")
break
if (not done_time) and (not self.arm_obj.has_active_goal()):
#rospy.loginfo("check_cartesian_done returned 1")
done_time = rospy.get_rostime()
if done_time and rospy.get_rostime() - done_time > rospy.Duration(settling_time):
rospy.loginfo("_move_cartesian_ik: done settling")
break
if stop_trigger == 'pressure_safety':
print 'ROBOT SAFETY ERROR'
#raise RobotSafetyError(stop_trigger)
return stop_trigger
def _check_gripper_event(self):
#state = self.gripper_event_detector_action_client.get_state()
state = self.cman.get_gripper_event_detector_state()
if state not in [GoalStatus.ACTIVE, GoalStatus.PENDING]:
rospy.loginfo('Gripper event detected.')
return True
else:
return False
##start up gripper event detector to detect when an object hits the table
#or when someone is trying to take an object from the robot
def _start_gripper_event_detector(self, event_type = 'all', accel = 8.25, slip=.008, blocking = 0, timeout = 15.):
goal = PR2GripperEventDetectorGoal()
if event_type == 'accel':
goal.command.trigger_conditions = goal.command.ACC
elif event_type == 'slip':
goal.command.trigger_conditions = goal.command.SLIP
elif event_type == 'press_accel':
goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_ACC
elif event_type == 'slip_accel':
goal.command.trigger_conditions = goal.command.SLIP_AND_ACC
else:
goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC #use either slip or acceleration as a contact condition
#goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC #use either slip or acceleration as a contact condition
goal.command.acceleration_trigger_magnitude = accel #contact acceleration used to trigger
goal.command.slip_trigger_magnitude = slip #contact slip used to trigger
rospy.loginfo("starting gripper event detector")
self.cman.gripper_event_detector_action_client.send_goal(goal)
#if blocking is requested, wait until the action returns
if blocking:
finished_within_time = self.cman.gripper_event_detector_action_client.wait_for_result(rospy.Duration(timeout))
if not finished_within_time:
rospy.logerr("Gripper didn't see the desired event trigger before timing out")
return 0
state = self.cman.gripper_event_detector_action_client.get_state()
if state == GoalStatus.SUCCEEDED:
result = self.cman.gripper_event_detector_action_client.get_result()
if result.data.placed:
return 1
return 0
def _process_stop_option(self, stop):
stop_funcs = []
self.pressure_listener.check_safety_threshold()
#self.collision_monitor.check_self_contacts()
#stop_funcs.append([self.pressure_listener.check_safety_threshold, 'pressure_safety'])
#stop_funcs.append([self.collision_monitor.check_self_contacts, 'self_collision'])
if stop == 'pressure':
self.pressure_listener.check_threshold()
stop_funcs.append([self.pressure_listener.check_threshold, 'pressure'])
elif stop == 'pressure_accel':
#print 'USING ACCELEROMETERS'
#set a threshold for pressure & check for accelerometer readings
self.pressure_listener.check_threshold()
stop_funcs.append([self.pressure_listener.check_threshold, 'pressure'])
self._start_gripper_event_detector(event_type='accel', timeout=self.timeout)
stop_funcs.append([self._check_gripper_event, 'accel'])
return stop_funcs
if __name__ == '__main__':
mode = 'run'
if mode == 'plot':
import pylab as pb
import sys
a = ut.load_pickle(sys.argv[1])
print len(a.pos_diff)
pb.plot(a.pos_diff)
pb.show()
exit(0)
else:
import hrl_pr2_lib.pr2 as pr2
rospy.init_node('test_linear_move')
arm = 'r'
tflistener = tf.TransformListener()
robot = pr2.PR2(tflistener)
movement = LinearReactiveMovement(arm, robot, tflistener)
if mode == 'save':
poses = []
print 'going.....'
while True:
print 'waiting for input'
r = raw_input()
if r != 's':
print 'getting pose.'
p = movement.arm_obj.pose_cartesian()
print 'pose is', p
poses.append(p)
else:
break
ut.save_pickle(poses, 'saved_poses.pkl')
elif mode == 'run':
poses = ut.load_pickle('saved_poses.pkl')
for p in poses:
print 'hit enter to move'
r = raw_input()
pos, rot = tfu.matrix_as_tf(p)
movement.set_movement_mode_cart()
movement.move_absolute2((np.matrix(pos), np.matrix(rot)))
| ajibawa-2023/Python-Code-Large/train/row_99215 | 288 | 529 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0019, 0.0019, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0019, 0.0019, 0, 0.66, 0.05, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0019, 0, 0.66, 0.1, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L4_C0", "label": "pr2_gripper_reactive_approach.reactive_grasp import rgr", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0019, 0, 0.66, 0.15, 534, 0, 1, 0, 0, 534, 0, 0], "semantic": {"name": "pr2_gripper_reactive_approach.reactive_grasp", "arg_names": [], "import_names": ["rgr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_gripper_reactive_approach.reactive_grasp as rgr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L5_C0", "label": "pr2_gripper_reactive_approach.controller_manager import con", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0095, 0.0019, 0, 0.66, 0.2, 80, 0, 1, 0, 0, 80, 0, 0], "semantic": {"name": "pr2_gripper_reactive_approach.controller_manager", "arg_names": [], "import_names": ["con"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pr2_gripper_reactive_approach.controller_manager as con"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L6_C0", "label": "object_manipulator.convert_functions import cf", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0113, 0.0019, 0, 0.66, 0.25, 7, 0, 1, 0, 0, 7, 0, 0], "semantic": {"name": "object_manipulator.convert_functions", "arg_names": [], "import_names": ["cf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import object_manipulator.convert_functions as cf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:ImportFrom_L8_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0151, 0.0019, 0, 0.66, 0.3, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["GoalStatus"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import GoalStatus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:ImportFrom_L9_C0", "label": "from geometry_msgs.msg import Pose, PoseStamped, Point\u2026", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.017, 0.0019, 0, 0.66, 0.35, 951, 0, 4, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose", "PoseStamped", "Point", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Pose, PoseStamped, Point, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:ImportFrom_L10_C0", "label": "from pr2_gripper_sensor_msgs.msg import PR2GripperEventDetectorGoal", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0019, 0, 0.66, 0.4, 765, 0, 1, 0, 0, 765, 0, 0], "semantic": {"name": "pr2_gripper_sensor_msgs.msg", "arg_names": [], "import_names": ["PR2GripperEventDetectorGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_gripper_sensor_msgs.msg import PR2GripperEventDetectorGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L14_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0265, 0.0019, 0, 0.66, 0.45, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L15_C0", "label": "hrl_pr2_lib.pressure_listener import pm", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0284, 0.0019, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "hrl_pr2_lib.pressure_listener", "arg_names": [], "import_names": ["pm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.pressure_listener as pm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L16_C0", "label": "numpy import np", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0302, 0.0019, 0, 0.66, 0.55, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L17_C0", "label": "tf import tf", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0321, 0.0019, 0, 0.66, 0.6, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L18_C0", "label": "pdb import pdb", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.034, 0.0019, 0, 0.66, 0.65, 91, 0, 1, 0, 0, 91, 0, 0], "semantic": {"name": "pdb", "arg_names": [], "import_names": ["pdb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L19_C0", "label": "time import time", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0359, 0.0019, 0, 0.66, 0.7, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L20_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0378, 0.0019, 0, 0.66, 0.75, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L21_C0", "label": "math import math", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0397, 0.0019, 0, 0.66, 0.8, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L24_C0", "label": "RobotSafetyError", "type": "class", "loc": [24, 29], "level": 0, "parent": null, "vector": [3, 0, 0.0501, 0.0113, 0, 0.66, 0.85, 133, 0, 2, 0, 0, 645, 0, 1], "semantic": {"name": "RobotSafetyError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RobotSafetyError(Exception):\n def __init__(self, value):\n self.parameter = value\n\n def __str__(self):\n return repr(self.parameter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L24_C0", "vector": [2, 1, 0.0482, 0.0038, 1, 0.54, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, value):\n self.parameter = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L26_C8", "label": "self.parameter =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L25_C4", "vector": [14, 2, 0.0491, 0.0019, 2, 0.05, 0.0, 718, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parameter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parameter = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L28_C4", "label": "__str__", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L24_C0", "vector": [2, 1, 0.0539, 0.0038, 1, 0.54, 1.0, 527, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return repr(self.parameter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L28_C4", "vector": [13, 2, 0.0548, 0.0019, 2, 0.51, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr(self.parameter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "label": "ArmStoppedDetector", "type": "class", "loc": [32, 87], "level": 0, "parent": null, "vector": [3, 0, 0.1125, 0.1059, 0, 0.66, 0.9, 521, 0, 3, 0, 0, 0, 0, 30], "semantic": {"name": "ArmStoppedDetector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ArmStoppedDetector:\n def __init__(self, pos_thres=0.0001, rot_thres=0.001, time_settle=1., hz=30., n_step=3000):\n self.pos_diff = []\n self.rot_diff = []\n self.times = []\n\n self.last_pos = None\n self.last_t = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "label": "__init__", "type": "function", "loc": [33, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "vector": [2, 1, 0.0747, 0.0265, 1, 0.93, 0.0, 555, 0, 6, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "pos_thres", "rot_thres", "time_settle", "hz", "n_step"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pos_thres=0.0001, rot_thres=0.001, time_settle=1., hz=30., n_step=3000):\n self.pos_diff = []\n self.rot_diff = []\n self.times = []\n\n self.last_pos = None\n self.last_t = None\n self.n_step = n_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L34_C8", "label": "self.pos_diff =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0643, 0.0019, 2, 0.88, 0.0, 861, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.pos_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos_diff = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L35_C8", "label": "self.rot_diff =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0662, 0.0019, 2, 0.88, 0.1, 785, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.rot_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rot_diff = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L36_C8", "label": "self.times =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0681, 0.0019, 2, 0.88, 0.2, 681, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.times = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L38_C8", "label": "self.last_pos =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0718, 0.0019, 2, 0.88, 0.3, 908, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_pos = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L39_C8", "label": "self.last_t =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0737, 0.0019, 2, 0.88, 0.4, 92, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.last_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_t = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L40_C8", "label": "self.n_step =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0756, 0.0019, 2, 0.88, 0.5, 454, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.n_step", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.n_step = n_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L41_C8", "label": "self.hz =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0775, 0.0019, 2, 0.88, 0.6, 793, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.hz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hz = hz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L42_C8", "label": "self.time_settle =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0794, 0.0019, 2, 0.88, 0.7, 596, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.time_settle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.time_settle = time_settle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L44_C8", "label": "self.pos_thres =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0832, 0.0019, 2, 0.88, 0.8, 340, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pos_thres", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos_thres = pos_thres"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L45_C8", "label": "self.rot_thres =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.0851, 0.0019, 2, 0.88, 0.9, 457, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rot_thres", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rot_thres = rot_thres"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L46_C8", "label": "self.start_time = time()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "vector": [14, 2, 0.087, 0.0019, 2, 0.88, 1.0, 387, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L48_C4", "label": "record_diff", "type": "function", "loc": [48, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "vector": [2, 1, 0.1078, 0.0359, 1, 0.93, 0.5, 83, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "record_diff", "arg_names": ["self", "loc_mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def record_diff(self, loc_mat):\n cur_t = time.time() - self.start_time\n if self.last_t == None or (cur_t - self.last_t) > (1./self.hz):\n pos, rot = tfu.matrix_as_tf(loc_mat)\n if self.last_pos != None:\n self.pos_diff.append(np.linalg.norm(np.matrix(pos) - np.matrix(self.last_pos[0])))\n\n lp = np.array(self.last_pos[1]) / np.linalg.norm(self.last_pos[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L49_C8", "label": "cur_t =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L48_C4", "vector": [14, 2, 0.0926, 0.0019, 2, 0.14, 0.0, 336, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cur_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_t = time.time() - self.start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "label": "if", "type": "if", "loc": [50, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L48_C4", "vector": [4, 2, 0.1096, 0.0321, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.last_t == None or (cur_t - self.last_t) > (1./self.hz):\n pos, rot = tfu.matrix_as_tf(loc_mat)\n if self.last_pos != None:\n self.pos_diff.append(np.linalg.norm(np.matrix(pos) - np.matrix(self.last_pos[0])))\n\n lp = np.array(self.last_pos[1]) / np.linalg.norm(self.last_pos[1])\n r = np.array(rot) / np.linalg.norm(rot)\n #pdb.set_trace()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L51_C12", "label": "pos, rot = matrix_as_tf()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "vector": [14, 3, 0.0964, 0.0019, 3, 0.08, 0.0, 298, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " pos, rot = tfu.matrix_as_tf(loc_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "label": "if", "type": "if", "loc": [52, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "vector": [4, 3, 0.1087, 0.0227, 3, 0.08, 0.3333, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.last_pos != None:\n self.pos_diff.append(np.linalg.norm(np.matrix(pos) - np.matrix(self.last_pos[0])))\n\n lp = np.array(self.last_pos[1]) / np.linalg.norm(self.last_pos[1])\n r = np.array(rot) / np.linalg.norm(rot)\n #pdb.set_trace()\n self.rot_diff.append(np.linalg.norm(lp - r))\n self.times.append(cur_t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L53_C16", "label": "append()", "type": "expression", "loc": [53, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [8, 4, 0.1002, 0.0019, 4, 0.66, 0.0, 243, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.pos_diff.append(np.linalg.norm(np.matrix(pos) - np.matrix(self.last_pos[0])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L55_C16", "label": "lp =", "type": "assigned_variable", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [14, 4, 0.104, 0.0019, 4, 0.66, 0.1429, 721, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "lp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lp = np.array(self.last_pos[1]) / np.linalg.norm(self.last_pos[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L56_C16", "label": "r =", "type": "assigned_variable", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [14, 4, 0.1059, 0.0019, 4, 0.66, 0.2857, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = np.array(rot) / np.linalg.norm(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L58_C16", "label": "append()", "type": "expression", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [8, 4, 0.1096, 0.0019, 4, 0.66, 0.4286, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.rot_diff.append(np.linalg.norm(lp - r))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L59_C16", "label": "append()", "type": "expression", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [8, 4, 0.1115, 0.0019, 4, 0.66, 0.5714, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.times.append(cur_t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L61_C16", "label": "sidx =", "type": "assigned_variable", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [14, 4, 0.1153, 0.0019, 4, 0.66, 0.7143, 688, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sidx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sidx = len(self.pos_diff) - self.n_step"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L62_C16", "label": "self.pos_diff =", "type": "assigned_variable", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [14, 4, 0.1172, 0.0019, 4, 0.66, 0.8571, 861, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pos_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos_diff = self.pos_diff[sidx:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L63_C16", "label": "self.pose_diff =", "type": "assigned_variable", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "vector": [14, 4, 0.1191, 0.0019, 4, 0.66, 1.0, 151, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pose_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pose_diff = self.rot_diff[sidx:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L65_C12", "label": "self.last_pos = matrix_as_tf()", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "vector": [14, 3, 0.1229, 0.0019, 3, 0.08, 0.6667, 908, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "self.last_pos", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " self.last_pos = tfu.matrix_as_tf(loc_mat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L66_C12", "label": "self.last_t =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "vector": [14, 3, 0.1248, 0.0019, 3, 0.08, 1.0, 92, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.last_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_t = cur_t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "label": "is_stopped", "type": "function", "loc": [68, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "vector": [2, 1, 0.1465, 0.0378, 1, 0.93, 1.0, 376, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "is_stopped", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_stopped(self):\n cur_t = time.time() - self.start_time\n pos_over_thres_idx = np.where(np.array(self.pos_diff) > self.pos_thres)[0]\n rot_over_thres_idx = np.where(np.array(self.rot_diff) > self.rot_thres)[0]\n if len(pos_over_thres_idx) > 0 or len(rot_over_thres_idx) > 0:\n max_times = []\n if len(pos_over_thres_idx) > 0:\n max_times.append(self.times[pos_over_thres_idx[-1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L69_C8", "label": "cur_t =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "vector": [14, 2, 0.1304, 0.0019, 2, 0.84, 0.0, 336, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cur_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_t = time.time() - self.start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L70_C8", "label": "pos_over_thres_idx =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "vector": [14, 2, 0.1323, 0.0019, 2, 0.84, 0.3333, 154, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pos_over_thres_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_over_thres_idx = np.where(np.array(self.pos_diff) > self.pos_thres)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L71_C8", "label": "rot_over_thres_idx =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "vector": [14, 2, 0.1342, 0.0019, 2, 0.84, 0.6667, 833, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rot_over_thres_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_over_thres_idx = np.where(np.array(self.rot_diff) > self.rot_thres)[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "label": "if", "type": "if", "loc": [72, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "vector": [4, 2, 0.1503, 0.0302, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pos_over_thres_idx) > 0 or len(rot_over_thres_idx) > 0:\n max_times = []\n if len(pos_over_thres_idx) > 0:\n max_times.append(self.times[pos_over_thres_idx[-1]])\n if len(rot_over_thres_idx) > 0:\n max_times.append(self.times[rot_over_thres_idx[-1]])\n tmax = np.max(max_times)\n if (cur_t - tmax) > self.time_settle:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L73_C12", "label": "max_times =", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "vector": [14, 3, 0.138, 0.0019, 3, 0.94, 0.0, 29, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "max_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_times = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L74_C12", "label": "if", "type": "if", "loc": [74, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "vector": [4, 3, 0.1408, 0.0038, 3, 0.94, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pos_over_thres_idx) > 0:\n max_times.append(self.times[pos_over_thres_idx[-1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L75_C16", "label": "append()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L74_C12", "vector": [8, 4, 0.1418, 0.0019, 4, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " max_times.append(self.times[pos_over_thres_idx[-1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L76_C12", "label": "if", "type": "if", "loc": [76, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "vector": [4, 3, 0.1446, 0.0038, 3, 0.94, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(rot_over_thres_idx) > 0:\n max_times.append(self.times[rot_over_thres_idx[-1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L77_C16", "label": "append()", "type": "expression", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L76_C12", "vector": [8, 4, 0.1456, 0.0019, 4, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " max_times.append(self.times[rot_over_thres_idx[-1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L78_C12", "label": "tmax = max()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "vector": [14, 3, 0.1474, 0.0019, 3, 0.94, 0.6, 449, 3, 1, 0, 0, 442, 10, 1], "semantic": {"name": "tmax", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " tmax = np.max(max_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "label": "if", "type": "if", "loc": [79, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "vector": [4, 3, 0.1531, 0.0095, 3, 0.94, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (cur_t - tmax) > self.time_settle:\n print(cur_t - tmax, tmax, self.time_settle, max_times)\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L80_C16", "label": "print()", "type": "expression", "loc": [80, 80], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "vector": [8, 4, 0.1512, 0.0019, 4, 0.04, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(cur_t - tmax, tmax, self.time_settle, max_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L81_C16", "label": "return", "type": "return", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "vector": [13, 4, 0.1531, 0.0019, 4, 0.04, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L83_C16", "label": "return", "type": "return", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "vector": [13, 4, 0.1569, 0.0019, 4, 0.04, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L84_C8", "label": "if", "type": "if", "loc": [84, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "vector": [4, 3, 0.1616, 0.0076, 3, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(self.pos_diff) > (self.time_settle * self.hz):\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L85_C12", "label": "return", "type": "return", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L84_C8", "vector": [13, 4, 0.1607, 0.0019, 4, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L87_C12", "label": "return", "type": "return", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L84_C8", "vector": [13, 4, 0.1645, 0.0019, 4, 0.0, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "label": "LinearReactiveMovement", "type": "class", "loc": [97, 478], "level": 0, "parent": null, "vector": [3, 0, 0.5435, 0.7221, 0, 0.66, 0.95, 508, 0, 17, 0, 0, 0, 0, 99], "semantic": {"name": "LinearReactiveMovement", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LinearReactiveMovement:\n\n ##\n # @param arm 'l' or 'r'\n # @param pr2 Pr2 object (pr2.py)\n # @param tf_listener a tf.TransformListener()\n def __init__(self, arm, pr2, tf_listener, using_slip_controller=1, using_slip_detection=1):\n if tf_listener == None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "label": "__init__", "type": "function", "loc": [103, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.2278, 0.0681, 1, 0.06, 0.0, 555, 0, 6, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "arm", "pr2", "tf_listener", "using_slip_controller", "using_slip_detection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm, pr2, tf_listener, using_slip_controller=1, using_slip_detection=1):\n if tf_listener == None:\n self.tf_listener = tf.TransformListener()\n else:\n self.tf_listener = tf_listener\n self.pr2 = pr2\n\n if arm == 'l':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L104_C8", "label": "if", "type": "if", "loc": [104, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [4, 2, 0.1994, 0.0076, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tf_listener == None:\n self.tf_listener = tf.TransformListener()\n else:\n self.tf_listener = tf_listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L105_C12", "label": "self.tf_listener = TransformListener()", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L104_C8", "vector": [14, 3, 0.1985, 0.0019, 3, 0.66, 0.0, 639, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L107_C12", "label": "self.tf_listener =", "type": "assigned_variable", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L104_C8", "vector": [14, 3, 0.2023, 0.0019, 3, 0.66, 1.0, 639, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tf_listener = tf_listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L108_C8", "label": "self.pr2 =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [14, 2, 0.2042, 0.0019, 2, 0.57, 0.1111, 141, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pr2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pr2 = pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "label": "if", "type": "if", "loc": [110, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [4, 2, 0.2164, 0.0189, 2, 0.57, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'l':\n self.ik_frame = 'l_wrist_roll_link'\n self.tool_frame = 'l_gripper_tool_frame'\n self.arm_obj = self.pr2.left\n ptopic = '/pressure/l_gripper_motor'\n else:\n self.ik_frame = 'r_wrist_roll_link'\n self.tool_frame = 'r_gripper_tool_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L111_C12", "label": "self.ik_frame =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2098, 0.0019, 3, 0.61, 0.0, 463, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.ik_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ik_frame = 'l_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L112_C12", "label": "self.tool_frame =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2117, 0.0019, 3, 0.61, 0.1429, 392, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.tool_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tool_frame = 'l_gripper_tool_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L113_C12", "label": "self.arm_obj =", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2136, 0.0019, 3, 0.61, 0.2857, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_obj = self.pr2.left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L114_C12", "label": "ptopic =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2155, 0.0019, 3, 0.61, 0.4286, 554, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ptopic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ptopic = '/pressure/l_gripper_motor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L116_C12", "label": "self.ik_frame =", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2193, 0.0019, 3, 0.61, 0.5714, 463, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.ik_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ik_frame = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L117_C12", "label": "self.tool_frame =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2212, 0.0019, 3, 0.61, 0.7143, 392, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.tool_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tool_frame = 'r_gripper_tool_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L118_C12", "label": "self.arm_obj =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.2231, 0.0019, 3, 0.61, 0.8571, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_obj = self.pr2.right"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L119_C12", "label": "ptopic =", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "vector": [14, 3, 0.225, 0.0019, 3, 0.61, 1.0, 554, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ptopic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ptopic = '/pressure/r_gripper_motor'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L121_C8", "label": "self.pressure_listener = PressureListener()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [14, 2, 0.2287, 0.0019, 2, 0.57, 0.3333, 190, 3, 2, 0, 0, 422, 10, 1], "semantic": {"name": "self.pressure_listener", "arg_names": [], "import_names": [], "rhs_call_name": "PressureListener", "annotation": ""}, "snippet": " self.pressure_listener = pm.PressureListener(ptopic, 5000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L123_C8", "label": "print()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [8, 2, 0.2325, 0.0019, 2, 0.57, 0.4444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('INITIALIZING CONTROLLER MANAGER')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L124_C8", "label": "self.cman = ControllerManager()", "type": "assigned_variable", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [14, 2, 0.2353, 0.0038, 2, 0.57, 0.5556, 38, 3, 4, 0, 0, 16, 10, 1], "semantic": {"name": "self.cman", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerManager", "annotation": ""}, "snippet": " self.cman = con.ControllerManager(arm, self.tf_listener, using_slip_controller,\n using_slip_detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L126_C8", "label": "print()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [8, 2, 0.2382, 0.0019, 2, 0.57, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('INITIALIZAING REACTIVE GRASPER')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L127_C8", "label": "self.reactive_gr = ReactiveGrasper()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [14, 2, 0.2401, 0.0019, 2, 0.57, 0.7778, 622, 3, 1, 0, 0, 321, 10, 1], "semantic": {"name": "self.reactive_gr", "arg_names": [], "import_names": [], "rhs_call_name": "ReactiveGrasper", "annotation": ""}, "snippet": " self.reactive_gr = rgr.ReactiveGrasper(self.cman)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L135_C8", "label": "self.movement_mode =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [14, 2, 0.2552, 0.0019, 2, 0.57, 0.8889, 600, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.movement_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.movement_mode = 'cart' #or cart"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L138_C8", "label": "self.timeout =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "vector": [14, 2, 0.2609, 0.0019, 2, 0.57, 1.0, 621, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.timeout = 50."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "label": "move_absolute_old", "type": "function", "loc": [153, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.3015, 0.0265, 1, 0.06, 0.0625, 932, 0, 4, 1, 0, 0, 0, 12], "semantic": {"name": "move_absolute_old", "arg_names": ["self", "loc", "stop", "pressure"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_absolute_old(self, loc, stop='pressure_accel', pressure=300):\n self.set_pressure_threshold(pressure)\n stop_funcs = self._process_stop_option(stop)\n self.set_movement_mode_cart()\n #pdb.set_trace()\n self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout, settling_time=5.0)\n self.set_movement_mode_ik()\n r = self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout, settling_time=5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L154_C8", "label": "set_pressure_threshold()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [8, 2, 0.2911, 0.0019, 2, 0.26, 0.0, 585, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_pressure_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "set_pressure_threshold", "annotation": ""}, "snippet": " self.set_pressure_threshold(pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L155_C8", "label": "stop_funcs = _process_stop_option()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [14, 2, 0.293, 0.0019, 2, 0.26, 0.1111, 684, 3, 1, 0, 0, 699, 10, 1], "semantic": {"name": "stop_funcs", "arg_names": [], "import_names": [], "rhs_call_name": "_process_stop_option", "annotation": ""}, "snippet": " stop_funcs = self._process_stop_option(stop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L156_C8", "label": "set_movement_mode_cart()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [8, 2, 0.2949, 0.0019, 2, 0.26, 0.2222, 120, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_movement_mode_cart", "arg_names": [], "import_names": [], "rhs_call_name": "set_movement_mode_cart", "annotation": ""}, "snippet": " self.set_movement_mode_cart()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L158_C8", "label": "_move_cartesian()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [8, 2, 0.2987, 0.0019, 2, 0.26, 0.3333, 489, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "_move_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "_move_cartesian", "annotation": ""}, "snippet": " self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout, settling_time=5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L159_C8", "label": "set_movement_mode_ik()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [8, 2, 0.3006, 0.0019, 2, 0.26, 0.4444, 646, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_movement_mode_ik", "arg_names": [], "import_names": [], "rhs_call_name": "set_movement_mode_ik", "annotation": ""}, "snippet": " self.set_movement_mode_ik()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L160_C8", "label": "r = _move_cartesian()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [14, 2, 0.3025, 0.0019, 2, 0.26, 0.5556, 436, 3, 5, 0, 0, 489, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "_move_cartesian", "annotation": ""}, "snippet": " r = self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout, settling_time=5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L163_C8", "label": "diff =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [14, 2, 0.3081, 0.0019, 2, 0.26, 0.6667, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = loc[0] - self.arm_obj.pose_cartesian_tf()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L164_C8", "label": "loginfo()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [8, 2, 0.31, 0.0019, 2, 0.26, 0.7778, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('move_absolute: diff is %s' % str(diff.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L165_C8", "label": "loginfo()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [8, 2, 0.3119, 0.0019, 2, 0.26, 0.8889, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('move_absolute: dist %.3f' % np.linalg.norm(diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L166_C8", "label": "return", "type": "return", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "vector": [13, 2, 0.3138, 0.0019, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r, np.linalg.norm(diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "label": "move_absolute", "type": "function", "loc": [169, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.327, 0.017, 1, 0.06, 0.125, 538, 0, 5, 1, 0, 0, 0, 9], "semantic": {"name": "move_absolute", "arg_names": ["self", "loc", "stop", "pressure", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_absolute(self, loc, stop='pressure_accel', pressure=300, frame='base_link'):\n self.set_pressure_threshold(pressure)\n stop_funcs = self._process_stop_option(stop)\n r = self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout,\n settling_time=5.0, frame=frame)\n diff = loc[0] - self.arm_obj.pose_cartesian_tf()[0]\n rospy.loginfo('move_absolute: diff is %s' % str(diff.T))\n rospy.loginfo('move_absolute: dist %.3f' % np.linalg.norm(diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L170_C8", "label": "set_pressure_threshold()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [8, 2, 0.3214, 0.0019, 2, 0.32, 0.0, 585, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_pressure_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "set_pressure_threshold", "annotation": ""}, "snippet": " self.set_pressure_threshold(pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L171_C8", "label": "stop_funcs = _process_stop_option()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [14, 2, 0.3233, 0.0019, 2, 0.32, 0.1667, 684, 3, 1, 0, 0, 699, 10, 1], "semantic": {"name": "stop_funcs", "arg_names": [], "import_names": [], "rhs_call_name": "_process_stop_option", "annotation": ""}, "snippet": " stop_funcs = self._process_stop_option(stop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L172_C8", "label": "r = _move_cartesian()", "type": "assigned_variable", "loc": [172, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [14, 2, 0.3261, 0.0038, 2, 0.32, 0.3333, 436, 3, 6, 0, 0, 489, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "_move_cartesian", "annotation": ""}, "snippet": " r = self._move_cartesian(loc[0], loc[1], stop_funcs, timeout=self.timeout,\n settling_time=5.0, frame=frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L174_C8", "label": "diff =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [14, 2, 0.3289, 0.0019, 2, 0.32, 0.5, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = loc[0] - self.arm_obj.pose_cartesian_tf()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L175_C8", "label": "loginfo()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [8, 2, 0.3308, 0.0019, 2, 0.32, 0.6667, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('move_absolute: diff is %s' % str(diff.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L176_C8", "label": "loginfo()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [8, 2, 0.3327, 0.0019, 2, 0.32, 0.8333, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('move_absolute: dist %.3f' % np.linalg.norm(diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L177_C8", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "vector": [13, 2, 0.3346, 0.0019, 2, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r, np.linalg.norm(diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "label": "move_relative", "type": "function", "loc": [186, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.3544, 0.0076, 1, 0.06, 0.1875, 29, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "move_relative", "arg_names": ["self", "movement_target", "target_frame", "stop", "pressure"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_relative(self, movement_target, target_frame, stop='pressure_accel', pressure=150):\n base_T_target = tfu.transform('base_link', target_frame, self.tf_listener)\n movement_base = base_T_target[0:3, 0:3] * movement_target\n return self.move_relative_base(movement_base, stop=stop, pressure=pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L187_C8", "label": "base_T_target = transform()", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "vector": [14, 2, 0.3535, 0.0019, 2, 0.13, 0.0, 890, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "base_T_target", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " base_T_target = tfu.transform('base_link', target_frame, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L188_C8", "label": "movement_base =", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "vector": [14, 2, 0.3554, 0.0019, 2, 0.13, 0.5, 731, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "movement_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " movement_base = base_T_target[0:3, 0:3] * movement_target"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L189_C8", "label": "return", "type": "return", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "vector": [13, 2, 0.3573, 0.0019, 2, 0.13, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.move_relative_base(movement_base, stop=stop, pressure=pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "label": "move_relative_gripper", "type": "function", "loc": [197, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.3752, 0.0076, 1, 0.06, 0.25, 965, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "move_relative_gripper", "arg_names": ["self", "movement_tool", "stop", "pressure"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_relative_gripper(self, movement_tool, stop='pressure_accel', pressure=150):\n base_T_tool = tfu.transform('base_link', self.tool_frame, self.tf_listener)\n movement_base = base_T_tool[0:3, 0:3] * movement_tool # np.concatenate((movement_tool, np.matrix([1])))\n return self.move_relative_base(movement_base, stop=stop, pressure=pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L198_C8", "label": "base_T_tool = transform()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "vector": [14, 2, 0.3743, 0.0019, 2, 0.52, 0.0, 230, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "base_T_tool", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " base_T_tool = tfu.transform('base_link', self.tool_frame, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L199_C8", "label": "movement_base =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "vector": [14, 2, 0.3762, 0.0019, 2, 0.52, 0.5, 731, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "movement_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " movement_base = base_T_tool[0:3, 0:3] * movement_tool # np.concatenate((movement_tool, np.matrix([1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L200_C8", "label": "return", "type": "return", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "vector": [13, 2, 0.3781, 0.0019, 2, 0.52, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.move_relative_base(movement_base, stop=stop, pressure=pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "label": "move_relative_base", "type": "function", "loc": [208, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4045, 0.0246, 1, 0.06, 0.3125, 101, 0, 4, 1, 0, 0, 0, 10], "semantic": {"name": "move_relative_base", "arg_names": ["self", "movement", "stop", "pressure"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_relative_base(self, movement, stop='pressure_accel', pressure=150):\n self.set_pressure_threshold(pressure)\n trans, rot = self.arm_obj.pose_cartesian_tf()\n ntrans = trans + movement\n stop_funcs = self._process_stop_option(stop)\n r = self._move_cartesian(ntrans, rot, stop_funcs, \\\n timeout=self.timeout, settling_time=5.0)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L209_C8", "label": "set_pressure_threshold()", "type": "expression", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [8, 2, 0.3951, 0.0019, 2, 0.69, 0.0, 585, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_pressure_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "set_pressure_threshold", "annotation": ""}, "snippet": " self.set_pressure_threshold(pressure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L210_C8", "label": "trans, rot = pose_cartesian_tf()", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [14, 2, 0.397, 0.0019, 2, 0.69, 0.125, 330, 3, 0, 0, 0, 752, 10, 1], "semantic": {"name": "trans, rot", "arg_names": [], "import_names": [], "rhs_call_name": "pose_cartesian_tf", "annotation": ""}, "snippet": " trans, rot = self.arm_obj.pose_cartesian_tf()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L211_C8", "label": "ntrans =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [14, 2, 0.3989, 0.0019, 2, 0.69, 0.25, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ntrans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ntrans = trans + movement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L212_C8", "label": "stop_funcs = _process_stop_option()", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [14, 2, 0.4008, 0.0019, 2, 0.69, 0.375, 684, 3, 1, 0, 0, 699, 10, 1], "semantic": {"name": "stop_funcs", "arg_names": [], "import_names": [], "rhs_call_name": "_process_stop_option", "annotation": ""}, "snippet": " stop_funcs = self._process_stop_option(stop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L213_C8", "label": "r = _move_cartesian()", "type": "assigned_variable", "loc": [213, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [14, 2, 0.4036, 0.0038, 2, 0.69, 0.5, 436, 3, 5, 0, 0, 489, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "_move_cartesian", "annotation": ""}, "snippet": " r = self._move_cartesian(ntrans, rot, stop_funcs, \\\n timeout=self.timeout, settling_time=5.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L217_C8", "label": "diff =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [14, 2, 0.4102, 0.0019, 2, 0.69, 0.625, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = self.arm_obj.pose_cartesian_tf()[0] - (trans + movement)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L218_C8", "label": "loginfo()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [8, 2, 0.4121, 0.0019, 2, 0.69, 0.75, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('move_relative_base: diff is ' + str(diff.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L219_C8", "label": "loginfo()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [8, 2, 0.414, 0.0019, 2, 0.69, 0.875, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('move_relative_base: dist %.3f' % np.linalg.norm(diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L220_C8", "label": "return", "type": "return", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "vector": [13, 2, 0.4159, 0.0019, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r, np.linalg.norm(diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L224_C4", "label": "gripper_close", "type": "function", "loc": [224, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4244, 0.0038, 1, 0.06, 0.375, 674, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "gripper_close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def gripper_close(self):\n self.reactive_gr.compliant_close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L225_C8", "label": "compliant_close()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L224_C4", "vector": [8, 2, 0.4253, 0.0019, 2, 0.79, 0.0, 975, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "compliant_close", "arg_names": [], "import_names": [], "rhs_call_name": "compliant_close", "annotation": ""}, "snippet": " self.reactive_gr.compliant_close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L229_C4", "label": "gripper_open", "type": "function", "loc": [229, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4338, 0.0038, 1, 0.06, 0.4375, 27, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "gripper_open", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def gripper_open(self):\n self.reactive_gr.cm.command_gripper(.1, -1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L230_C8", "label": "command_gripper()", "type": "expression", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L229_C4", "vector": [8, 2, 0.4348, 0.0019, 2, 0.67, 0.0, 250, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "command_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "command_gripper", "annotation": ""}, "snippet": " self.reactive_gr.cm.command_gripper(.1, -1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L232_C4", "label": "set_pressure_threshold", "type": "function", "loc": [232, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4395, 0.0038, 1, 0.06, 0.5, 585, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_pressure_threshold", "arg_names": ["self", "t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_pressure_threshold(self, t):\n self.pressure_listener.set_threshold(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L233_C8", "label": "set_threshold()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L232_C4", "vector": [8, 2, 0.4405, 0.0019, 2, 0.6, 0.0, 794, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "set_threshold", "annotation": ""}, "snippet": " self.pressure_listener.set_threshold(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "label": "set_movement_mode_ik", "type": "function", "loc": [237, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4509, 0.0076, 1, 0.06, 0.5625, 646, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_movement_mode_ik", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_movement_mode_ik(self):\n self.movement_mode = 'ik'\n self.reactive_gr.cm.switch_to_joint_mode()\n self.reactive_gr.cm.freeze_arm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L238_C8", "label": "self.movement_mode =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "vector": [14, 2, 0.4499, 0.0019, 2, 0.53, 0.0, 600, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.movement_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.movement_mode = 'ik'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L239_C8", "label": "switch_to_joint_mode()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "vector": [8, 2, 0.4518, 0.0019, 2, 0.53, 0.5, 340, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "switch_to_joint_mode", "arg_names": [], "import_names": [], "rhs_call_name": "switch_to_joint_mode", "annotation": ""}, "snippet": " self.reactive_gr.cm.switch_to_joint_mode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L240_C8", "label": "freeze_arm()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "vector": [8, 2, 0.4537, 0.0019, 2, 0.53, 1.0, 19, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "freeze_arm", "arg_names": [], "import_names": [], "rhs_call_name": "freeze_arm", "annotation": ""}, "snippet": " self.reactive_gr.cm.freeze_arm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L244_C4", "label": "set_movement_mode_cart", "type": "function", "loc": [244, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4622, 0.0038, 1, 0.06, 0.625, 120, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "set_movement_mode_cart", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_movement_mode_cart(self):\n self.movement_mode = 'cart'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L245_C8", "label": "self.movement_mode =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L244_C4", "vector": [14, 2, 0.4631, 0.0019, 2, 0.78, 0.0, 600, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.movement_mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.movement_mode = 'cart'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L247_C4", "label": "_move_cartesian", "type": "function", "loc": [247, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.4745, 0.017, 1, 0.06, 0.6875, 489, 0, 8, 1, 0, 0, 0, 2], "semantic": {"name": "_move_cartesian", "arg_names": ["self", "position", "orientation", "stop_funcs", "timeout", "settling_time", "frame", "vel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _move_cartesian(self, position, orientation, \\\n stop_funcs=[], timeout = 3.0, settling_time = 0.5, \\\n frame='base_link', vel=.15):\n if self.movement_mode == 'ik':\n return self._move_cartesian_ik(position, orientation, stop_funcs, \\\n timeout, settling_time, frame, vel=.15)\n elif self.movement_mode == 'cart':\n return self._move_cartesian_cart(position, orientation, stop_funcs, \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L250_C8", "label": "if", "type": "if", "loc": [250, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L247_C4", "vector": [4, 2, 0.4773, 0.0113, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.movement_mode == 'ik':\n return self._move_cartesian_ik(position, orientation, stop_funcs, \\\n timeout, settling_time, frame, vel=.15)\n elif self.movement_mode == 'cart':\n return self._move_cartesian_cart(position, orientation, stop_funcs, \\\n timeout, settling_time, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L251_C12", "label": "return", "type": "return", "loc": [251, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L250_C8", "vector": [13, 3, 0.4754, 0.0038, 3, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._move_cartesian_ik(position, orientation, stop_funcs, \\\n timeout, settling_time, frame, vel=.15)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L253_C8", "label": "if", "type": "if", "loc": [253, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L250_C8", "vector": [4, 3, 0.4802, 0.0057, 3, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.movement_mode == 'cart':\n return self._move_cartesian_cart(position, orientation, stop_funcs, \\\n timeout, settling_time, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L254_C12", "label": "return", "type": "return", "loc": [254, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L253_C8", "vector": [13, 4, 0.4811, 0.0038, 4, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._move_cartesian_cart(position, orientation, stop_funcs, \\\n timeout, settling_time, frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "label": "_move_cartesian_cart", "type": "function", "loc": [261, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.5822, 0.1796, 1, 0.06, 0.75, 371, 0, 7, 1, 0, 0, 0, 33], "semantic": {"name": "_move_cartesian_cart", "arg_names": ["self", "position", "orientation", "stop_funcs", "timeout", "settling_time", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _move_cartesian_cart(self, position, orientation, \\\n stop_funcs=[], timeout = 3.0, settling_time = 0.5, frame='base_link'):\n\n # TODO: Test this function...\n # Transform the pose from 'frame' to 'base_link'\n self.tf_listener.waitForTransform('base_link', frame, rospy.Time(),\n rospy.Duration(10))\n frame_T_base = tfu.transform('base_link', frame, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L266_C8", "label": "waitForTransform()", "type": "expression", "loc": [266, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [8, 2, 0.5038, 0.0038, 2, 0.22, 0.0, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tf_listener.waitForTransform('base_link', frame, rospy.Time(),\n rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L268_C8", "label": "frame_T_base = transform()", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5066, 0.0019, 2, 0.22, 0.0526, 959, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "frame_T_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " frame_T_base = tfu.transform('base_link', frame, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L269_C8", "label": "init_cart_pose = tf_as_matrix()", "type": "assigned_variable", "loc": [269, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5095, 0.0038, 2, 0.22, 0.1053, 359, 3, 1, 0, 0, 197, 10, 3], "semantic": {"name": "init_cart_pose", "arg_names": [], "import_names": [], "rhs_call_name": "tf_as_matrix", "annotation": ""}, "snippet": " init_cart_pose = tfu.tf_as_matrix((position.A1.tolist(),\n orientation.A1.tolist()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L271_C8", "label": "base_cart_pose =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5123, 0.0019, 2, 0.22, 0.1579, 747, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_cart_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_cart_pose = frame_T_base*init_cart_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L274_C8", "label": "waitForTransform()", "type": "expression", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [8, 2, 0.518, 0.0019, 2, 0.22, 0.2105, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tf_listener.waitForTransform(self.ik_frame, self.tool_frame, rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L275_C8", "label": "toolframe_T_ikframe = transform()", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5198, 0.0019, 2, 0.22, 0.2632, 194, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "toolframe_T_ikframe", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " toolframe_T_ikframe = tfu.transform(self.tool_frame, self.ik_frame, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L277_C8", "label": "base_cart_pose =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5236, 0.0019, 2, 0.22, 0.3158, 747, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_cart_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_cart_pose = base_cart_pose * toolframe_T_ikframe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L278_C8", "label": "base_position, base_orientation = matrix_as_tf()", "type": "assigned_variable", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5255, 0.0019, 2, 0.22, 0.3684, 624, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "base_position, base_orientation", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " base_position, base_orientation = tfu.matrix_as_tf(base_cart_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L280_C8", "label": "pose_stamped = create_pose_stamped()", "type": "assigned_variable", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5293, 0.0019, 2, 0.22, 0.4211, 678, 3, 1, 0, 0, 262, 10, 3], "semantic": {"name": "pose_stamped", "arg_names": [], "import_names": [], "rhs_call_name": "create_pose_stamped", "annotation": ""}, "snippet": " pose_stamped = cf.create_pose_stamped(base_position.tolist() + base_orientation.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L281_C8", "label": "rg =", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5312, 0.0019, 2, 0.22, 0.4737, 861, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rg = self.reactive_gr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L282_C8", "label": "check_preempt()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [8, 2, 0.5331, 0.0019, 2, 0.22, 0.5263, 795, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "check_preempt", "annotation": ""}, "snippet": " rg.check_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L286_C8", "label": "pos, rot = pose_stamped_to_lists()", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5406, 0.0019, 2, 0.22, 0.5789, 298, 3, 3, 0, 0, 655, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "pose_stamped_to_lists", "annotation": ""}, "snippet": " (pos, rot) = cf.pose_stamped_to_lists(rg.cm.tf_listener, pose_stamped, 'base_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L287_C8", "label": "move_cartesian_step()", "type": "expression", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [8, 2, 0.5425, 0.0019, 2, 0.22, 0.6316, 746, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_cartesian_step", "arg_names": [], "import_names": [], "rhs_call_name": "move_cartesian_step", "annotation": ""}, "snippet": " rg.move_cartesian_step(pos+rot, timeout, settling_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L290_C8", "label": "start_time = get_rostime()", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5482, 0.0019, 2, 0.22, 0.6842, 511, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " start_time = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L291_C8", "label": "done_time =", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5501, 0.0019, 2, 0.22, 0.7368, 948, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "done_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done_time = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L293_C8", "label": "stop_trigger =", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5539, 0.0019, 2, 0.22, 0.7895, 643, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "stop_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop_trigger = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L295_C8", "label": "stop_detector = ArmStoppedDetector()", "type": "assigned_variable", "loc": [295, 295], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [14, 2, 0.5577, 0.0019, 2, 0.22, 0.8421, 116, 3, 0, 0, 0, 521, 10, 1], "semantic": {"name": "stop_detector", "arg_names": [], "import_names": [], "rhs_call_name": "ArmStoppedDetector", "annotation": ""}, "snippet": " stop_detector = ArmStoppedDetector()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "label": "while", "type": "while", "loc": [296, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [5, 2, 0.5888, 0.0605, 2, 0.22, 0.8947, 0, 1, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while(1):\n\n rg.check_preempt()\n if len(stop_funcs) > 0:\n for f, name in stop_funcs:\n if f():\n rg.cm.switch_to_joint_mode()\n rg.cm.freeze_arm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L298_C12", "label": "check_preempt()", "type": "expression", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "vector": [8, 3, 0.5633, 0.0019, 3, 0.04, 0.0, 795, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_preempt", "arg_names": [], "import_names": [], "rhs_call_name": "check_preempt", "annotation": ""}, "snippet": " rg.check_preempt()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L299_C12", "label": "if", "type": "if", "loc": [299, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "vector": [4, 3, 0.5747, 0.0208, 3, 0.04, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(stop_funcs) > 0:\n for f, name in stop_funcs:\n if f():\n rg.cm.switch_to_joint_mode()\n rg.cm.freeze_arm()\n #stopped = True\n stop_trigger = name\n rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L300_C16", "label": "for f, name", "type": "for", "loc": [300, 307], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L299_C12", "vector": [6, 4, 0.5737, 0.0151, 4, 0.58, 0.0, 825, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "f, name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, name in stop_funcs:\n if f():\n rg.cm.switch_to_joint_mode()\n rg.cm.freeze_arm()\n #stopped = True\n stop_trigger = name\n rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "label": "if", "type": "if", "loc": [301, 307], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L300_C16", "vector": [4, 5, 0.5747, 0.0132, 5, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f():\n rg.cm.switch_to_joint_mode()\n rg.cm.freeze_arm()\n #stopped = True\n stop_trigger = name\n rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L302_C24", "label": "switch_to_joint_mode()", "type": "expression", "loc": [302, 302], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "vector": [8, 6, 0.5709, 0.0019, 6, 0.97, 0.0, 340, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "switch_to_joint_mode", "arg_names": [], "import_names": [], "rhs_call_name": "switch_to_joint_mode", "annotation": ""}, "snippet": " rg.cm.switch_to_joint_mode()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L303_C24", "label": "freeze_arm()", "type": "expression", "loc": [303, 303], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "vector": [8, 6, 0.5728, 0.0019, 6, 0.97, 0.3333, 19, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "freeze_arm", "arg_names": [], "import_names": [], "rhs_call_name": "freeze_arm", "annotation": ""}, "snippet": " rg.cm.freeze_arm()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L305_C24", "label": "stop_trigger =", "type": "assigned_variable", "loc": [305, 305], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "vector": [14, 6, 0.5766, 0.0019, 6, 0.97, 0.6667, 643, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop_trigger = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L306_C24", "label": "loginfo()", "type": "expression", "loc": [306, 306], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "vector": [8, 6, 0.5784, 0.0019, 6, 0.97, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L308_C16", "label": "if", "type": "if", "loc": [308, 309], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L299_C12", "vector": [4, 4, 0.5832, 0.0038, 4, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop_trigger != None:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L318_C12", "label": "if", "type": "if", "loc": [318, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "vector": [4, 3, 0.604, 0.0076, 3, 0.04, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rg.cm.check_cartesian_near_pose(pose_stamped, .0025, .05):\n rospy.loginfo(\"_move_cartesian_cart: reached pose\")\n #stop_trigger = 'at_pose'\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L319_C16", "label": "loginfo()", "type": "expression", "loc": [319, 319], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L318_C12", "vector": [8, 4, 0.603, 0.0019, 4, 0.64, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"_move_cartesian_cart: reached pose\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L323_C12", "label": "record_diff()", "type": "expression", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "vector": [8, 3, 0.6106, 0.0019, 3, 0.04, 0.75, 83, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "record_diff", "arg_names": [], "import_names": [], "rhs_call_name": "record_diff", "annotation": ""}, "snippet": " stop_detector.record_diff(self.arm_obj.pose_cartesian())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L324_C12", "label": "if", "type": "if", "loc": [324, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "vector": [4, 3, 0.6153, 0.0076, 3, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop_detector.is_stopped():\n rospy.loginfo(\"_move_cartesian_cart: arm stopped\")\n #stop_trigger = 'stopped'\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L325_C16", "label": "loginfo()", "type": "expression", "loc": [325, 325], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L324_C12", "vector": [8, 4, 0.6144, 0.0019, 4, 0.54, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"_move_cartesian_cart: arm stopped\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L349_C8", "label": "if", "type": "if", "loc": [349, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [4, 2, 0.6607, 0.0038, 2, 0.22, 0.9474, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop_trigger == 'pressure_safety':\n print('ROBOT SAFETY ERROR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L350_C12", "label": "print()", "type": "expression", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L349_C8", "vector": [8, 3, 0.6616, 0.0019, 3, 0.4, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROBOT SAFETY ERROR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L355_C8", "label": "return", "type": "return", "loc": [355, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "vector": [13, 2, 0.6711, 0.0019, 2, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop_trigger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "label": "_move_cartesian_ik", "type": "function", "loc": [357, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.724, 0.1002, 1, 0.06, 0.8125, 111, 0, 8, 1, 0, 0, 0, 27], "semantic": {"name": "_move_cartesian_ik", "arg_names": ["self", "position", "orientation", "stop_funcs", "timeout", "settling_time", "frame", "vel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _move_cartesian_ik(self, position, orientation, \\\n stop_funcs=[], timeout = 30., settling_time = 0.25, \\\n frame='base_link', vel=.15):\n #pdb.set_trace()\n #self.arm_obj.set_cart_pose_ik(cart_pose, total_time=motion_length, frame=frame, block=False)\n #cart_pose = tfu.tf_as_matrix((position.A1.tolist(), orientation.A1.tolist()))\n\n self.tf_listener.waitForTransform(self.ik_frame, self.tool_frame, rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L364_C8", "label": "waitForTransform()", "type": "expression", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [8, 2, 0.6881, 0.0019, 2, 0.73, 0.0, 900, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "waitForTransform", "arg_names": [], "import_names": [], "rhs_call_name": "waitForTransform", "annotation": ""}, "snippet": " self.tf_listener.waitForTransform(self.ik_frame, self.tool_frame, rospy.Time(), rospy.Duration(10))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L365_C8", "label": "toolframe_T_ikframe = transform()", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.69, 0.0019, 2, 0.73, 0.0769, 194, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "toolframe_T_ikframe", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " toolframe_T_ikframe = tfu.transform(self.tool_frame, self.ik_frame, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L366_C8", "label": "cart_pose = tf_as_matrix()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.6919, 0.0019, 2, 0.73, 0.1538, 238, 3, 1, 0, 0, 197, 10, 3], "semantic": {"name": "cart_pose", "arg_names": [], "import_names": [], "rhs_call_name": "tf_as_matrix", "annotation": ""}, "snippet": " cart_pose = tfu.tf_as_matrix((position.A1.tolist(), orientation.A1.tolist()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L367_C8", "label": "cart_pose =", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.6938, 0.0019, 2, 0.73, 0.2308, 238, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cart_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cart_pose = cart_pose * toolframe_T_ikframe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L368_C8", "label": "position, orientation = matrix_as_tf()", "type": "assigned_variable", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.6957, 0.0019, 2, 0.73, 0.3077, 548, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "position, orientation", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " position, orientation = tfu.matrix_as_tf(cart_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L371_C8", "label": "goal_pose_ps = create_pose_stamped()", "type": "assigned_variable", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.7013, 0.0019, 2, 0.73, 0.3846, 288, 3, 2, 0, 0, 262, 10, 3], "semantic": {"name": "goal_pose_ps", "arg_names": [], "import_names": [], "rhs_call_name": "create_pose_stamped", "annotation": ""}, "snippet": " goal_pose_ps = cf.create_pose_stamped(position.tolist() + orientation.tolist(), frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L372_C8", "label": "r = move_cartesian_ik()", "type": "assigned_variable", "loc": [372, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.7051, 0.0057, 2, 0.73, 0.4615, 436, 3, 8, 0, 0, 685, 10, 3], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "move_cartesian_ik", "annotation": ""}, "snippet": " r = self.reactive_gr.cm.move_cartesian_ik(goal_pose_ps, blocking=0, step_size=.005, \\\n pos_thres=.02, rot_thres=.1, timeout=rospy.Duration(timeout),\n settling_time=rospy.Duration(settling_time), vel=vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L375_C8", "label": "if", "type": "if", "loc": [375, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [4, 2, 0.7098, 0.0038, 2, 0.73, 0.5385, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (r == 'sent goal' or r == 'success'):\n return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L376_C12", "label": "return", "type": "return", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L375_C8", "vector": [13, 3, 0.7108, 0.0019, 3, 0.61, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L383_C8", "label": "stop_trigger =", "type": "assigned_variable", "loc": [383, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.724, 0.0019, 2, 0.73, 0.6154, 643, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "stop_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop_trigger = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L384_C8", "label": "done_time =", "type": "assigned_variable", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.7259, 0.0019, 2, 0.73, 0.6923, 948, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "done_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " done_time = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L385_C8", "label": "start_time = get_rostime()", "type": "assigned_variable", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [14, 2, 0.7278, 0.0019, 2, 0.73, 0.7692, 511, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " start_time = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "label": "while", "type": "while", "loc": [386, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [5, 2, 0.7467, 0.0359, 2, 0.73, 0.8462, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while stop_trigger == None:\n for f, name in stop_funcs:\n if f():\n self.arm_obj.stop_trajectory_execution()\n stop_trigger = name\n rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))\n break\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L387_C12", "label": "for f, name", "type": "for", "loc": [387, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "vector": [6, 3, 0.7363, 0.0113, 3, 0.91, 0.0, 825, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "f, name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, name in stop_funcs:\n if f():\n self.arm_obj.stop_trajectory_execution()\n stop_trigger = name\n rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "label": "if", "type": "if", "loc": [388, 392], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L387_C12", "vector": [4, 4, 0.7372, 0.0095, 4, 0.08, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f():\n self.arm_obj.stop_trajectory_execution()\n stop_trigger = name\n rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L389_C20", "label": "stop_trajectory_execution()", "type": "expression", "loc": [389, 389], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "vector": [8, 5, 0.7353, 0.0019, 5, 0.51, 0.0, 279, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_trajectory_execution", "arg_names": [], "import_names": [], "rhs_call_name": "stop_trajectory_execution", "annotation": ""}, "snippet": " self.arm_obj.stop_trajectory_execution()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L390_C20", "label": "stop_trigger =", "type": "assigned_variable", "loc": [390, 390], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "vector": [14, 5, 0.7372, 0.0019, 5, 0.51, 0.5, 643, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop_trigger = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L391_C20", "label": "loginfo()", "type": "expression", "loc": [391, 391], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "vector": [8, 5, 0.7391, 0.0019, 5, 0.51, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('\"%s\" requested that motion should be stopped.' % (name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L394_C12", "label": "if", "type": "if", "loc": [394, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "vector": [4, 3, 0.7467, 0.0057, 3, 0.91, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timeout != 0. and rospy.get_rostime() - start_time > rospy.Duration(timeout):\n rospy.loginfo(\"_move_cartesian_ik: motion timed out\")\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L395_C16", "label": "loginfo()", "type": "expression", "loc": [395, 395], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L394_C12", "vector": [8, 4, 0.7467, 0.0019, 4, 0.33, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"_move_cartesian_ik: motion timed out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L398_C12", "label": "if", "type": "if", "loc": [398, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "vector": [4, 3, 0.7543, 0.0057, 3, 0.91, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not done_time) and (not self.arm_obj.has_active_goal()):\n #rospy.loginfo(\"check_cartesian_done returned 1\")\n done_time = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L400_C16", "label": "done_time = get_rostime()", "type": "assigned_variable", "loc": [400, 400], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L398_C12", "vector": [14, 4, 0.7561, 0.0019, 4, 0.58, 0.0, 948, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "done_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " done_time = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L402_C12", "label": "if", "type": "if", "loc": [402, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "vector": [4, 3, 0.7618, 0.0057, 3, 0.91, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if done_time and rospy.get_rostime() - done_time > rospy.Duration(settling_time):\n rospy.loginfo(\"_move_cartesian_ik: done settling\")\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L403_C16", "label": "loginfo()", "type": "expression", "loc": [403, 403], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L402_C12", "vector": [8, 4, 0.7618, 0.0019, 4, 0.6, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"_move_cartesian_ik: done settling\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L406_C8", "label": "if", "type": "if", "loc": [406, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [4, 2, 0.7684, 0.0038, 2, 0.73, 0.9231, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop_trigger == 'pressure_safety':\n print('ROBOT SAFETY ERROR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L407_C12", "label": "print()", "type": "expression", "loc": [407, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L406_C8", "vector": [8, 3, 0.7694, 0.0019, 3, 0.51, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROBOT SAFETY ERROR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L409_C8", "label": "return", "type": "return", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "vector": [13, 2, 0.7732, 0.0019, 2, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop_trigger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L411_C4", "label": "_check_gripper_event", "type": "function", "loc": [411, 418], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.7836, 0.0151, 1, 0.06, 0.875, 253, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_check_gripper_event", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _check_gripper_event(self):\n #state = self.gripper_event_detector_action_client.get_state()\n state = self.cman.get_gripper_event_detector_state()\n if state not in [GoalStatus.ACTIVE, GoalStatus.PENDING]:\n rospy.loginfo('Gripper event detected.')\n return True \n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L413_C8", "label": "state = get_gripper_event_detector_state()", "type": "assigned_variable", "loc": [413, 413], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L411_C4", "vector": [14, 2, 0.7807, 0.0019, 2, 0.18, 0.0, 688, 3, 0, 0, 0, 503, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_gripper_event_detector_state", "annotation": ""}, "snippet": " state = self.cman.get_gripper_event_detector_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "label": "if", "type": "if", "loc": [414, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L411_C4", "vector": [4, 2, 0.7864, 0.0095, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state not in [GoalStatus.ACTIVE, GoalStatus.PENDING]:\n rospy.loginfo('Gripper event detected.')\n return True \n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L415_C12", "label": "loginfo()", "type": "expression", "loc": [415, 415], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "vector": [8, 3, 0.7845, 0.0019, 3, 0.88, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Gripper event detected.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L416_C12", "label": "return", "type": "return", "loc": [416, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "vector": [13, 3, 0.7864, 0.0019, 3, 0.88, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L418_C12", "label": "return", "type": "return", "loc": [418, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "vector": [13, 3, 0.7902, 0.0019, 3, 0.88, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "label": "_start_gripper_event_detector", "type": "function", "loc": [423, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.8299, 0.0624, 1, 0.06, 0.9375, 70, 0, 6, 1, 0, 0, 0, 8], "semantic": {"name": "_start_gripper_event_detector", "arg_names": ["self", "event_type", "accel", "slip", "blocking", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start_gripper_event_detector(self, event_type = 'all', accel = 8.25, slip=.008, blocking = 0, timeout = 15.):\n \n goal = PR2GripperEventDetectorGoal()\n if event_type == 'accel':\n goal.command.trigger_conditions = goal.command.ACC\n elif event_type == 'slip':\n goal.command.trigger_conditions = goal.command.SLIP\n elif event_type == 'press_accel':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L425_C8", "label": "goal = PR2GripperEventDetectorGoal()", "type": "assigned_variable", "loc": [425, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [14, 2, 0.8034, 0.0019, 2, 0.39, 0.0, 914, 3, 0, 0, 0, 6, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "PR2GripperEventDetectorGoal", "annotation": ""}, "snippet": " goal = PR2GripperEventDetectorGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L426_C8", "label": "if", "type": "if", "loc": [426, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [4, 2, 0.8138, 0.0189, 2, 0.39, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event_type == 'accel':\n goal.command.trigger_conditions = goal.command.ACC\n elif event_type == 'slip':\n goal.command.trigger_conditions = goal.command.SLIP\n elif event_type == 'press_accel':\n goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_ACC\n elif event_type == 'slip_accel':\n goal.command.trigger_conditions = goal.command.SLIP_AND_ACC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L427_C12", "label": "goal.command.trigger_conditions =", "type": "assigned_variable", "loc": [427, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L426_C8", "vector": [14, 3, 0.8072, 0.0019, 3, 0.31, 0.0, 755, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.trigger_conditions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.trigger_conditions = goal.command.ACC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L428_C8", "label": "if", "type": "if", "loc": [428, 435], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L426_C8", "vector": [4, 3, 0.8157, 0.0151, 3, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event_type == 'slip':\n goal.command.trigger_conditions = goal.command.SLIP\n elif event_type == 'press_accel':\n goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_ACC\n elif event_type == 'slip_accel':\n goal.command.trigger_conditions = goal.command.SLIP_AND_ACC\n else:\n goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC #use either slip or acceleration as a contact condition"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L429_C12", "label": "goal.command.trigger_conditions =", "type": "assigned_variable", "loc": [429, 429], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L428_C8", "vector": [14, 4, 0.811, 0.0019, 4, 0.18, 0.0, 755, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.trigger_conditions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.trigger_conditions = goal.command.SLIP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L430_C8", "label": "if", "type": "if", "loc": [430, 435], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L428_C8", "vector": [4, 4, 0.8176, 0.0113, 4, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event_type == 'press_accel':\n goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_ACC\n elif event_type == 'slip_accel':\n goal.command.trigger_conditions = goal.command.SLIP_AND_ACC\n else:\n goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC #use either slip or acceleration as a contact condition"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L431_C12", "label": "goal.command.trigger_conditions =", "type": "assigned_variable", "loc": [431, 431], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L430_C8", "vector": [14, 5, 0.8147, 0.0019, 5, 0.28, 0.0, 755, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.trigger_conditions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_ACC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L432_C8", "label": "if", "type": "if", "loc": [432, 435], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L430_C8", "vector": [4, 5, 0.8195, 0.0076, 5, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event_type == 'slip_accel':\n goal.command.trigger_conditions = goal.command.SLIP_AND_ACC\n else:\n goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC #use either slip or acceleration as a contact condition"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L433_C12", "label": "goal.command.trigger_conditions =", "type": "assigned_variable", "loc": [433, 433], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L432_C8", "vector": [14, 6, 0.8185, 0.0019, 6, 0.58, 0.0, 755, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.trigger_conditions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.trigger_conditions = goal.command.SLIP_AND_ACC"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L435_C12", "label": "goal.command.trigger_conditions =", "type": "assigned_variable", "loc": [435, 435], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L432_C8", "vector": [14, 6, 0.8223, 0.0019, 6, 0.58, 1.0, 755, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.trigger_conditions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.trigger_conditions = goal.command.FINGER_SIDE_IMPACT_OR_SLIP_OR_ACC #use either slip or acceleration as a contact condition"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L438_C8", "label": "goal.command.acceleration_trigger_magnitude =", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [14, 2, 0.828, 0.0019, 2, 0.39, 0.3333, 470, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.acceleration_trigger_magnitude", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.acceleration_trigger_magnitude = accel #contact acceleration used to trigger "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L439_C8", "label": "goal.command.slip_trigger_magnitude =", "type": "assigned_variable", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [14, 2, 0.8299, 0.0019, 2, 0.39, 0.5, 254, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.command.slip_trigger_magnitude", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.command.slip_trigger_magnitude = slip #contact slip used to trigger "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L441_C8", "label": "loginfo()", "type": "expression", "loc": [441, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [8, 2, 0.8336, 0.0019, 2, 0.39, 0.6667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"starting gripper event detector\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L442_C8", "label": "send_goal()", "type": "expression", "loc": [442, 442], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [8, 2, 0.8355, 0.0019, 2, 0.39, 0.8333, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.cman.gripper_event_detector_action_client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "label": "if", "type": "if", "loc": [445, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "vector": [4, 2, 0.8507, 0.0208, 2, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if blocking:\n finished_within_time = self.cman.gripper_event_detector_action_client.wait_for_result(rospy.Duration(timeout))\n if not finished_within_time:\n rospy.logerr(\"Gripper didn't see the desired event trigger before timing out\")\n return 0\n state = self.cman.gripper_event_detector_action_client.get_state()\n if state == GoalStatus.SUCCEEDED:\n result = self.cman.gripper_event_detector_action_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L446_C12", "label": "finished_within_time = wait_for_result()", "type": "assigned_variable", "loc": [446, 446], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "vector": [14, 3, 0.8431, 0.0019, 3, 0.64, 0.0, 778, 3, 1, 0, 0, 328, 10, 2], "semantic": {"name": "finished_within_time", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " finished_within_time = self.cman.gripper_event_detector_action_client.wait_for_result(rospy.Duration(timeout))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L447_C12", "label": "if", "type": "if", "loc": [447, 449], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "vector": [4, 3, 0.8469, 0.0057, 3, 0.64, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not finished_within_time:\n rospy.logerr(\"Gripper didn't see the desired event trigger before timing out\")\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L448_C16", "label": "logerr()", "type": "expression", "loc": [448, 448], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L447_C12", "vector": [8, 4, 0.8469, 0.0019, 4, 0.77, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr(\"Gripper didn't see the desired event trigger before timing out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L449_C16", "label": "return", "type": "return", "loc": [449, 449], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L447_C12", "vector": [13, 4, 0.8488, 0.0019, 4, 0.77, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L450_C12", "label": "state = get_state()", "type": "assigned_variable", "loc": [450, 450], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "vector": [14, 3, 0.8507, 0.0019, 3, 0.64, 0.5, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = self.cman.gripper_event_detector_action_client.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L451_C12", "label": "if", "type": "if", "loc": [451, 454], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "vector": [4, 3, 0.8554, 0.0076, 3, 0.64, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state == GoalStatus.SUCCEEDED:\n result = self.cman.gripper_event_detector_action_client.get_result()\n if result.data.placed:\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L452_C16", "label": "result = get_result()", "type": "assigned_variable", "loc": [452, 452], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L451_C12", "vector": [14, 4, 0.8544, 0.0019, 4, 0.45, 0.0, 51, 3, 0, 0, 0, 569, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "get_result", "annotation": ""}, "snippet": " result = self.cman.gripper_event_detector_action_client.get_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L453_C16", "label": "if", "type": "if", "loc": [453, 454], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L451_C12", "vector": [4, 4, 0.8573, 0.0038, 4, 0.45, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result.data.placed:\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L454_C20", "label": "return", "type": "return", "loc": [454, 454], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L453_C16", "vector": [13, 5, 0.8582, 0.0019, 5, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L455_C12", "label": "return", "type": "return", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "vector": [13, 3, 0.8601, 0.0019, 3, 0.64, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "label": "_process_stop_option", "type": "function", "loc": [457, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "vector": [2, 1, 0.8837, 0.0416, 1, 0.06, 1.0, 699, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "_process_stop_option", "arg_names": ["self", "stop"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_stop_option(self, stop):\n stop_funcs = []\n self.pressure_listener.check_safety_threshold()\n #self.collision_monitor.check_self_contacts()\n\n #stop_funcs.append([self.pressure_listener.check_safety_threshold, 'pressure_safety'])\n #stop_funcs.append([self.collision_monitor.check_self_contacts, 'self_collision'])\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L458_C8", "label": "stop_funcs =", "type": "assigned_variable", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "vector": [14, 2, 0.8658, 0.0019, 2, 0.07, 0.0, 684, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stop_funcs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop_funcs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L459_C8", "label": "check_safety_threshold()", "type": "expression", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "vector": [8, 2, 0.8677, 0.0019, 2, 0.07, 0.3333, 404, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_safety_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "check_safety_threshold", "annotation": ""}, "snippet": " self.pressure_listener.check_safety_threshold()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "label": "if", "type": "if", "loc": [465, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "vector": [4, 2, 0.8894, 0.0227, 2, 0.07, 0.6667, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stop == 'pressure':\n self.pressure_listener.check_threshold()\n stop_funcs.append([self.pressure_listener.check_threshold, 'pressure'])\n\n elif stop == 'pressure_accel':\n #print 'USING ACCELEROMETERS'\n #set a threshold for pressure & check for accelerometer readings\n self.pressure_listener.check_threshold()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L466_C12", "label": "check_threshold()", "type": "expression", "loc": [466, 466], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "vector": [8, 3, 0.8809, 0.0019, 3, 0.97, 0.0, 347, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "check_threshold", "annotation": ""}, "snippet": " self.pressure_listener.check_threshold()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L467_C12", "label": "append()", "type": "expression", "loc": [467, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "vector": [8, 3, 0.8828, 0.0019, 3, 0.97, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stop_funcs.append([self.pressure_listener.check_threshold, 'pressure'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "label": "if", "type": "if", "loc": [469, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "vector": [4, 3, 0.8932, 0.0151, 3, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif stop == 'pressure_accel':\n #print 'USING ACCELEROMETERS'\n #set a threshold for pressure & check for accelerometer readings\n self.pressure_listener.check_threshold()\n stop_funcs.append([self.pressure_listener.check_threshold, 'pressure'])\n\n self._start_gripper_event_detector(event_type='accel', timeout=self.timeout)\n stop_funcs.append([self._check_gripper_event, 'accel'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L472_C12", "label": "check_threshold()", "type": "expression", "loc": [472, 472], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "vector": [8, 4, 0.8922, 0.0019, 4, 0.33, 0.0, 347, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "check_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "check_threshold", "annotation": ""}, "snippet": " self.pressure_listener.check_threshold()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L473_C12", "label": "append()", "type": "expression", "loc": [473, 473], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "vector": [8, 4, 0.8941, 0.0019, 4, 0.33, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stop_funcs.append([self.pressure_listener.check_threshold, 'pressure'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L475_C12", "label": "_start_gripper_event_detector()", "type": "expression", "loc": [475, 475], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "vector": [8, 4, 0.8979, 0.0019, 4, 0.33, 0.6667, 70, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_start_gripper_event_detector", "arg_names": [], "import_names": [], "rhs_call_name": "_start_gripper_event_detector", "annotation": ""}, "snippet": " self._start_gripper_event_detector(event_type='accel', timeout=self.timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L476_C12", "label": "append()", "type": "expression", "loc": [476, 476], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "vector": [8, 4, 0.8998, 0.0019, 4, 0.33, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stop_funcs.append([self._check_gripper_event, 'accel'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L478_C8", "label": "return", "type": "return", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "vector": [13, 2, 0.9036, 0.0019, 2, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop_funcs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L483_C0", "label": "if", "type": "if", "loc": [483, 529], "level": 0, "parent": null, "vector": [4, 0, 0.9565, 0.0888, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n mode = 'run'\n\n if mode == 'plot':\n import pylab as pb\n import sys\n \n a = ut.load_pickle(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L484_C4", "label": "mode =", "type": "assigned_variable", "loc": [484, 484], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L483_C0", "vector": [14, 1, 0.9149, 0.0019, 1, 0.4, 0.0, 991, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "mode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mode = 'run'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "label": "if", "type": "if", "loc": [486, 529], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L483_C0", "vector": [4, 1, 0.9594, 0.0832, 1, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mode == 'plot':\n import pylab as pb\n import sys\n \n a = ut.load_pickle(sys.argv[1])\n print(len(a.pos_diff))\n pb.plot(a.pos_diff)\n pb.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L487_C8", "label": "pylab import pb", "type": "import", "loc": [487, 487], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [1, 2, 0.9206, 0.0019, 2, 0.8, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "pylab", "arg_names": [], "import_names": ["pb"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pylab as pb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L488_C8", "label": "sys import sys", "type": "import", "loc": [488, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [1, 2, 0.9225, 0.0019, 2, 0.8, 0.0769, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L490_C8", "label": "a = load_pickle()", "type": "assigned_variable", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [14, 2, 0.9263, 0.0019, 2, 0.8, 0.1538, 475, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " a = ut.load_pickle(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L491_C8", "label": "print()", "type": "expression", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [8, 2, 0.9282, 0.0019, 2, 0.8, 0.2308, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(len(a.pos_diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L492_C8", "label": "plot()", "type": "expression", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [8, 2, 0.9301, 0.0019, 2, 0.8, 0.3077, 929, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " pb.plot(a.pos_diff)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L493_C8", "label": "show()", "type": "expression", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [8, 2, 0.9319, 0.0019, 2, 0.8, 0.3846, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " pb.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L495_C8", "label": "exit()", "type": "expression", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [8, 2, 0.9357, 0.0019, 2, 0.8, 0.4615, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L499_C8", "label": "hrl_pr2_lib.pr2 import pr2", "type": "import", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [1, 2, 0.9433, 0.0019, 2, 0.8, 0.5385, 137, 0, 1, 0, 0, 137, 0, 0], "semantic": {"name": "hrl_pr2_lib.pr2", "arg_names": [], "import_names": ["pr2"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_pr2_lib.pr2 as pr2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L500_C8", "label": "init_node()", "type": "expression", "loc": [500, 500], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [8, 2, 0.9452, 0.0019, 2, 0.8, 0.6154, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('test_linear_move')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L501_C8", "label": "arm =", "type": "assigned_variable", "loc": [501, 501], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [14, 2, 0.9471, 0.0019, 2, 0.8, 0.6923, 413, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 'r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L502_C8", "label": "tflistener = TransformListener()", "type": "assigned_variable", "loc": [502, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [14, 2, 0.949, 0.0019, 2, 0.8, 0.7692, 313, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "tflistener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " tflistener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L503_C8", "label": "robot = PR2()", "type": "assigned_variable", "loc": [503, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [14, 2, 0.9509, 0.0019, 2, 0.8, 0.8462, 735, 3, 1, 0, 0, 573, 10, 1], "semantic": {"name": "robot", "arg_names": [], "import_names": [], "rhs_call_name": "PR2", "annotation": ""}, "snippet": " robot = pr2.PR2(tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L504_C8", "label": "movement = LinearReactiveMovement()", "type": "assigned_variable", "loc": [504, 504], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [14, 2, 0.9527, 0.0019, 2, 0.8, 0.9231, 668, 3, 3, 0, 0, 508, 10, 1], "semantic": {"name": "movement", "arg_names": [], "import_names": [], "rhs_call_name": "LinearReactiveMovement", "annotation": ""}, "snippet": " movement = LinearReactiveMovement(arm, robot, tflistener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "label": "if", "type": "if", "loc": [506, 529], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "vector": [4, 2, 0.9783, 0.0454, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mode == 'save':\n poses = []\n print('going.....')\n while True:\n print('waiting for input')\n r = raw_input()\n if r != 's':\n print('getting pose.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L507_C12", "label": "poses =", "type": "assigned_variable", "loc": [507, 507], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "vector": [14, 3, 0.9584, 0.0019, 3, 0.6, 0.0, 415, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "poses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " poses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L508_C12", "label": "print()", "type": "expression", "loc": [508, 508], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "vector": [8, 3, 0.9603, 0.0019, 3, 0.6, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('going.....')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "label": "while", "type": "while", "loc": [509, 518], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "vector": [5, 3, 0.9707, 0.0189, 3, 0.6, 0.5, 0, 1, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n print('waiting for input')\n r = raw_input()\n if r != 's':\n print('getting pose.')\n p = movement.arm_obj.pose_cartesian()\n print('pose is', p)\n poses.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L510_C16", "label": "print()", "type": "expression", "loc": [510, 510], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "vector": [8, 4, 0.9641, 0.0019, 4, 0.68, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waiting for input')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L511_C16", "label": "r = raw_input()", "type": "assigned_variable", "loc": [511, 511], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "vector": [14, 4, 0.966, 0.0019, 4, 0.68, 0.5, 436, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " r = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "label": "if", "type": "if", "loc": [512, 518], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "vector": [4, 4, 0.9735, 0.0132, 4, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if r != 's':\n print('getting pose.')\n p = movement.arm_obj.pose_cartesian()\n print('pose is', p)\n poses.append(p)\n else:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L513_C20", "label": "print()", "type": "expression", "loc": [513, 513], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "vector": [8, 5, 0.9698, 0.0019, 5, 0.14, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('getting pose.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L514_C20", "label": "p = pose_cartesian()", "type": "assigned_variable", "loc": [514, 514], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "vector": [14, 5, 0.9716, 0.0019, 5, 0.14, 0.3333, 491, 3, 0, 0, 0, 371, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "pose_cartesian", "annotation": ""}, "snippet": " p = movement.arm_obj.pose_cartesian()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L515_C20", "label": "print()", "type": "expression", "loc": [515, 515], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "vector": [8, 5, 0.9735, 0.0019, 5, 0.14, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pose is', p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L516_C20", "label": "append()", "type": "expression", "loc": [516, 516], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "vector": [8, 5, 0.9754, 0.0019, 5, 0.14, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " poses.append(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L520_C12", "label": "save_pickle()", "type": "expression", "loc": [520, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "vector": [8, 3, 0.983, 0.0019, 3, 0.6, 0.75, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(poses, 'saved_poses.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L522_C8", "label": "if", "type": "if", "loc": [522, 529], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "vector": [4, 3, 0.9934, 0.0151, 3, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif mode == 'run':\n poses = ut.load_pickle('saved_poses.pkl')\n for p in poses:\n print('hit enter to move')\n r = raw_input()\n pos, rot = tfu.matrix_as_tf(p)\n movement.set_movement_mode_cart()\n movement.move_absolute2((np.matrix(pos), np.matrix(rot)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L523_C12", "label": "poses = load_pickle()", "type": "assigned_variable", "loc": [523, 523], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L522_C8", "vector": [14, 4, 0.9887, 0.0019, 4, 0.19, 0.0, 415, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "poses", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " poses = ut.load_pickle('saved_poses.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "label": "for p", "type": "for", "loc": [524, 529], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L522_C8", "vector": [6, 4, 0.9953, 0.0113, 4, 0.19, 1.0, 491, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for p in poses:\n print('hit enter to move')\n r = raw_input()\n pos, rot = tfu.matrix_as_tf(p)\n movement.set_movement_mode_cart()\n movement.move_absolute2((np.matrix(pos), np.matrix(rot)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L525_C16", "label": "print()", "type": "expression", "loc": [525, 525], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "vector": [8, 5, 0.9924, 0.0019, 5, 0.29, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('hit enter to move')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L526_C16", "label": "r = raw_input()", "type": "assigned_variable", "loc": [526, 526], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "vector": [14, 5, 0.9943, 0.0019, 5, 0.29, 0.25, 436, 3, 0, 0, 0, 821, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " r = raw_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L527_C16", "label": "pos, rot = matrix_as_tf()", "type": "assigned_variable", "loc": [527, 527], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "vector": [14, 5, 0.9962, 0.0019, 5, 0.29, 0.5, 298, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " pos, rot = tfu.matrix_as_tf(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L528_C16", "label": "set_movement_mode_cart()", "type": "expression", "loc": [528, 528], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "vector": [8, 5, 0.9981, 0.0019, 5, 0.29, 0.75, 120, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_movement_mode_cart", "arg_names": [], "import_names": [], "rhs_call_name": "set_movement_mode_cart", "annotation": ""}, "snippet": " movement.set_movement_mode_cart()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L529_C16", "label": "move_absolute2()", "type": "expression", "loc": [529, 529], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "vector": [8, 5, 1.0, 0.0019, 5, 0.29, 1.0, 0, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "move_absolute2", "arg_names": [], "import_names": [], "rhs_call_name": "move_absolute2", "annotation": ""}, "snippet": " movement.move_absolute2((np.matrix(pos), np.matrix(rot)))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L53_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L56_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L52_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L76_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L79_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L250_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L250_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L287_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L299_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L300_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L300_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L302_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L303_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L305_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L301_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L306_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L299_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L308_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L318_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L318_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L319_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L296_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L324_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L325_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L387_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L387_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L389_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L390_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L388_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L391_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L394_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L394_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L395_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L398_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L400_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L386_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L402_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L403_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L406_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L407_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L357_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L415_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L414_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L425_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L426_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L427_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L426_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L428_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L428_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L429_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L428_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L432_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L433_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L432_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L435_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L441_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L442_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L423_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L447_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L447_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L448_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L447_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L449_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L450_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L451_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L451_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L452_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L451_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L453_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L453_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L454_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:ClassDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L466_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L467_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L473_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L475_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Return_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L483_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L484_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L483_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L487_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L491_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Import_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L500_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L501_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L502_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L503_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L486_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L507_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L508_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L510_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L511_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:While_L509_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L513_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L514_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L515_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L512_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L516_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L522_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L522_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L523_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:If_L522_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L525_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L526_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Assign_L527_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L528_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99215:For_L524_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99215:Expr_L529_C16"}] |
import numpy as np, math
import copy
from threading import RLock
import roslib; roslib.load_manifest('hrl_pr2_lib')
roslib.load_manifest('equilibrium_point_control')
import rospy
from equilibrium_point_control.msg import MechanismKinematicsRot
from equilibrium_point_control.msg import MechanismKinematicsJac
from equilibrium_point_control.msg import ForceTrajectory
from geometry_msgs.msg import Point32
from std_msgs.msg import Empty
import epc
import hrl_lib.util as ut
class Door_EPC(epc.EPC):
def __init__(self, robot):
epc.EPC.__init__(self, robot)
self.mech_kinematics_lock = RLock()
self.fit_circle_lock = RLock()
rospy.Subscriber('mechanism_kinematics_rot',
MechanismKinematicsRot,
self.mechanism_kinematics_rot_cb)
rospy.Subscriber('epc/stop', Empty, self.stop_cb)
# used in the ROS stop_cb and equi_pt_generator_control_radial_force
self.force_traj_pub = rospy.Publisher('epc/force_test', ForceTrajectory)
self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32)
def init_log(self):
self.f_list = []
self.cep_list = []
self.ee_list = []
self.ft = ForceTrajectory()
if self.mechanism_type != '':
self.ft.type = self.mechanism_type
else:
self.ft.type = 'rotary'
def log_state(self, arm):
# only logging the right arm.
f = self.robot.get_wrist_force(arm, base_frame=True)
self.f_list.append(f.A1.tolist())
cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True)
self.cep_list.append(cep.A1.tolist())
ee, _ = self.robot.get_ee_jtt(arm)
self.ee_list.append(ee.A1.tolist())
if self.started_pulling_on_handle == False:
if f[0,0] > 5.:
self.started_pulling_on_handle_count += 1
else:
self.started_pulling_on_handle_count = 0
self.init_log() # reset logs until started pulling on the handle.
self.init_tangent_vector = None
if self.started_pulling_on_handle_count > 1:
self.started_pulling_on_handle = True
return ''
## ROS callback. Stop and maintain position.
def stop_cb(self, cmd):
self.stopping_string = 'stop_cb called.'
def common_stopping_conditions(self):
stop = ''
# right arm only.
wrist_force = self.robot.get_wrist_force(0, base_frame=True)
print 'wrist_force:', wrist_force
mag = np.linalg.norm(wrist_force)
if mag > self.eq_force_threshold:
stop = 'force exceed'
if mag < 1.2 and self.hooked_location_moved:
if (self.prev_force_mag - mag) > 30.:
stop = 'slip: force step decrease and below thresold.'
else:
self.slip_count += 1
else:
self.slip_count = 0
if self.slip_count == 10:
stop = 'slip: force below threshold for too long.'
return stop
def mechanism_kinematics_rot_cb(self, mk):
self.fit_circle_lock.acquire()
self.cx_start = mk.cx
self.cy_start = mk.cy
self.cz_start = mk.cz
self.rad = mk.rad
self.fit_circle_lock.release()
## constantly update the estimate of the kinematics and move the
# equilibrium point along the tangent of the estimated arc, and
# try to keep the radial force constant.
# @param h_force_possible - True (hook side) or False (hook up).
# @param v_force_possible - False (hook side) or True (hook up).
# Is maintaining a radial force possible or not (based on hook
# geometry and orientation)
# @param cep_vel - tangential velocity of the cep in m/s
def cep_gen_control_radial_force(self, arm, cep, cep_vel):
self.log_state(arm)
if self.started_pulling_on_handle == False:
cep_vel = 0.02
#step_size = 0.01 * cep_vel
step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)
stop = self.common_stopping_conditions()
wrist_force = self.robot.get_wrist_force(arm, base_frame=True)
mag = np.linalg.norm(wrist_force)
curr_pos, _ = self.robot.get_ee_jtt(arm)
if len(self.ee_list)>1:
start_pos = np.matrix(self.ee_list[0]).T
else:
start_pos = curr_pos
#mechanism kinematics.
if self.started_pulling_on_handle:
self.mech_traj_pub.publish(Point32(curr_pos[0,0],
curr_pos[1,0], curr_pos[2,0]))
self.fit_circle_lock.acquire()
rad = self.rad
cx_start, cy_start = self.cx_start, self.cy_start
cz_start = self.cz_start
self.fit_circle_lock.release()
cx, cy = cx_start, cy_start
cz = cz_start
print 'cx, cy, r:', cx, cy, rad
radial_vec = curr_pos - np.matrix([cx,cy,cz]).T
radial_vec = radial_vec/np.linalg.norm(radial_vec)
if cy_start < start_pos[1,0]:
tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]
else:
tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]
if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09:
tan_x = -tan_x
tan_y = -tan_y
if cy_start > start_pos[1,0]:
radial_vec = -radial_vec # axis to the left, want force in
# anti-radial direction.
rv = radial_vec
force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T
tangential_vec = np.matrix([tan_x, tan_y, 0.]).T
tangential_vec_ts = tangential_vec
radial_vec_ts = radial_vec
force_vec_ts = force_vec
if arm == 'right_arm' or arm == 0:
if force_vec_ts[1,0] < 0.: # only allowing force to the left
force_vec_ts = -force_vec_ts
else:
if force_vec_ts[1,0] > 0.: # only allowing force to the right
force_vec_ts = -force_vec_ts
f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0],
wrist_force[2,0]])
f_rad_mag = np.dot(f_vec, force_vec.A1)
err = f_rad_mag-2.
if err>0.:
kp = -0.1
else:
kp = -0.2
radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size)
radial_motion_vec = force_vec * radial_motion_mag
eq_motion_vec = copy.copy(tangential_vec)
eq_motion_vec += radial_motion_vec
self.prev_force_mag = mag
if self.init_tangent_vector == None or self.started_pulling_on_handle == False:
self.init_tangent_vector = copy.copy(tangential_vec_ts)
c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1)
ang = np.arccos(c)
if np.isnan(ang):
ang = 0.
tangential_vec = tangential_vec / np.linalg.norm(tangential_vec) # paranoia abot vectors not being unit vectors.
dist_moved = np.dot((curr_pos - start_pos).A1, tangential_vec_ts.A1)
ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1))
self.ft.tangential_force.append(ftan)
self.ft.radial_force.append(f_rad_mag)
if self.ft.type == 'rotary':
self.ft.configuration.append(ang)
else: # drawer
print 'dist_moved:', dist_moved
self.ft.configuration.append(dist_moved)
if self.started_pulling_on_handle:
self.force_traj_pub.publish(self.ft)
# if self.started_pulling_on_handle == False:
# ftan_pull_test = -np.dot(wrist_force.A1, tangential_vec.A1)
# print 'ftan_pull_test:', ftan_pull_test
# if ftan_pull_test > 5.:
# self.started_pulling_on_handle_count += 1
# else:
# self.started_pulling_on_handle_count = 0
# self.init_log() # reset logs until started pulling on the handle.
# self.init_tangent_vector = None
#
# if self.started_pulling_on_handle_count > 1:
# self.started_pulling_on_handle = True
if abs(dist_moved) > 0.09 and self.hooked_location_moved == False:
# change the force threshold once the hook has started pulling.
self.hooked_location_moved = True
self.eq_force_threshold = ut.bound(mag+30.,20.,80.)
self.ftan_threshold = 1.2 * self.ftan_threshold + 20.
if self.hooked_location_moved:
if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:
stop = 'ftan threshold exceed: %f'%ftan
else:
self.ftan_threshold = max(self.ftan_threshold, ftan)
if self.hooked_location_moved and ang > math.radians(90.):
print 'Angle:', math.degrees(ang)
self.open_ang_exceed_count += 1
if self.open_ang_exceed_count > 2:
stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))
else:
self.open_ang_exceed_count = 0
cep_t = cep + eq_motion_vec * step_size
cep_t = cep + np.matrix([-1., 0., 0.]).T * step_size
if cep_t[0,0] > 0.1:
cep[0,0] = cep_t[0,0]
cep[1,0] = cep_t[1,0]
cep[2,0] = cep_t[2,0]
print 'CEP:', cep.A1
stop = stop + self.stopping_string
return stop, (cep, None)
def pull(self, arm, force_threshold, cep_vel, mechanism_type=''):
self.mechanism_type = mechanism_type
self.stopping_string = ''
self.eq_pt_not_moving_counter = 0
self.init_log()
self.init_tangent_vector = None
self.open_ang_exceed_count = 0.
self.eq_force_threshold = force_threshold
self.ftan_threshold = 2.
self.hooked_location_moved = False # flag to indicate when the hooking location started moving.
self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm))
self.slip_count = 0
self.started_pulling_on_handle = False
self.started_pulling_on_handle_count = 0
ee_pos, _ = self.robot.get_ee_jtt(arm)
self.cx_start = ee_pos[0,0]
self.rad = 10.0
self.cy_start = ee_pos[1,0]-self.rad
self.cz_start = ee_pos[2,0]
cep, _ = self.robot.get_cep_jtt(arm)
arg_list = [arm, cep, cep_vel]
result, _ = self.epc_motion(self.cep_gen_control_radial_force,
0.1, arm, arg_list, self.log_state,
#0.01, arm, arg_list,
control_function = self.robot.set_cep_jtt)
print 'EPC motion result:', result
print 'Original force threshold:', force_threshold
print 'Adapted force threshold:', self.eq_force_threshold
print 'Adapted ftan threshold:', self.ftan_threshold
d = {
'f_list': self.f_list, 'ee_list': self.ee_list,
'cep_list': self.cep_list, 'ftan_list': self.ft.tangential_force,
'config_list': self.ft.configuration, 'frad_list': self.ft.radial_force
}
ut.save_pickle(d,'pr2_pull_'+ut.formatted_time()+'.pkl')
def search_and_hook(self, arm, hook_loc, hooking_force_threshold = 5.,
hit_threshold=2., hit_motions = 1,
hook_direction = 'left'):
# this needs to be debugged. Hardcoded for now.
#if arm == 'right_arm' or arm == 0:
# hook_dir = np.matrix([0., 1., 0.]).T # hook direc in home position
# offset = -0.03
#elif arm == 'left_arm' or arm == 1:
# hook_dir = np.matrix([0., -1., 0.]).T # hook direc in home position
# offset = -0.03
#else:
# raise RuntimeError('Unknown arm: %s', arm)
#start_loc = hook_loc + rot_mat.T * hook_dir * offset
if hook_direction == 'left':
offset = np.matrix([0., -0.03, 0.]).T
move_dir = np.matrix([0., 1., 0.]).T
elif hook_direction == 'up':
offset = np.matrix([0., 0., -0.03]).T
move_dir = np.matrix([0., 0., 1.]).T
start_loc = hook_loc + offset
# vector normal to surface and pointing into the surface.
normal_tl = np.matrix([1.0, 0., 0.]).T
pt1 = start_loc - normal_tl * 0.1
self.robot.go_cep_jtt(arm, pt1)
raw_input('Hit ENTER to go')
vec = normal_tl * 0.2
rospy.sleep(1.)
for i in range(hit_motions):
s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)
cep_start, _ = self.robot.get_cep_jtt(arm)
cep = copy.copy(cep_start)
arg_list = [arm, move_dir, hooking_force_threshold, cep, cep_start]
s = self.epc_motion(self.cep_gen_surface_follow, 0.1, arm,
arg_list, control_function = self.robot.set_cep_jtt)
return s
if __name__ == '__main__':
import pr2_arms as pa
rospy.init_node('epc_pr2', anonymous = True)
rospy.logout('epc_pr2: ready')
pr2_arms = pa.PR2Arms()
door_epc = Door_EPC(pr2_arms)
r_arm, l_arm = 0, 1
arm = r_arm
raw_input('Hit ENTER to close')
pr2_arms.close_gripper(arm)
raw_input('Hit ENTER to start Door Opening')
# for cabinets.
#p1 = np.matrix([0.8, -0.40, -0.04]).T # pos 3
#p1 = np.matrix([0.8, -0.10, -0.04]).T # pos 2
p1 = np.matrix([0.8, -0.1, -0.04]).T # pos 1
door_epc.search_and_hook(arm, p1, hook_direction='left')
door_epc.pull(arm, force_threshold=40., cep_vel=0.05)
# # hrl toolchest drawer.
# p1 = np.matrix([0.8, -0.2, -0.17]).T
# door_epc.search_and_hook(arm, p1, hook_direction='up')
# door_epc.pull(arm, force_threshold=40., cep_vel=0.05)
| ajibawa-2023/Python-Code-Large/train/row_99217 | 224 | 363 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L2_C0", "label": "numpy import np, math", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0055, 0.0028, 0, 0.66, 0.0, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L3_C0", "label": "copy import copy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0028, 0, 0.66, 0.0667, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ImportFrom_L4_C0", "label": "from threading import RLock", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.011, 0.0028, 0, 0.66, 0.1333, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0165, 0.0028, 0, 0.66, 0.2, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L6_C15", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0165, 0.0028, 0, 0.66, 0.2667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0193, 0.0028, 0, 0.66, 0.3333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('equilibrium_point_control')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.022, 0.0028, 0, 0.66, 0.4, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ImportFrom_L10_C0", "label": "from equilibrium_point_control.msg import MechanismKinematicsRot", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0275, 0.0028, 0, 0.66, 0.4667, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["MechanismKinematicsRot"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import MechanismKinematicsRot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ImportFrom_L11_C0", "label": "from equilibrium_point_control.msg import MechanismKinematicsJac", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0028, 0, 0.66, 0.5333, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["MechanismKinematicsJac"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import MechanismKinematicsJac"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ImportFrom_L12_C0", "label": "from equilibrium_point_control.msg import ForceTrajectory", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0331, 0.0028, 0, 0.66, 0.6, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "equilibrium_point_control.msg", "arg_names": [], "import_names": ["ForceTrajectory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.msg import ForceTrajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ImportFrom_L13_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0358, 0.0028, 0, 0.66, 0.6667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ImportFrom_L14_C0", "label": "from std_msgs.msg import Empty", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0386, 0.0028, 0, 0.66, 0.7333, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Empty"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Empty"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L16_C0", "label": "epc import epc", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0028, 0, 0.66, 0.8, 304, 0, 1, 0, 0, 304, 0, 0], "semantic": {"name": "epc", "arg_names": [], "import_names": ["epc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import epc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L17_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0468, 0.0028, 0, 0.66, 0.8667, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "label": "Door_EPC", "type": "class", "loc": [19, 333], "level": 0, "parent": null, "vector": [3, 0, 0.4848, 0.8678, 0, 0.66, 0.9333, 468, 0, 9, 0, 0, 62, 0, 91], "semantic": {"name": "Door_EPC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Door_EPC(epc.EPC):\n def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.0716, 0.0358, 1, 0.24, 0.0, 555, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "robot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot):\n epc.EPC.__init__(self, robot)\n\n self.mech_kinematics_lock = RLock()\n self.fit_circle_lock = RLock()\n\n rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L21_C8", "label": "__init__()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [8, 2, 0.0579, 0.0028, 2, 0.42, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " epc.EPC.__init__(self, robot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L23_C8", "label": "self.mech_kinematics_lock = RLock()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [14, 2, 0.0634, 0.0028, 2, 0.42, 0.1667, 542, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.mech_kinematics_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.mech_kinematics_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L24_C8", "label": "self.fit_circle_lock = RLock()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [14, 2, 0.0661, 0.0028, 2, 0.42, 0.3333, 336, 3, 0, 0, 0, 207, 10, 1], "semantic": {"name": "self.fit_circle_lock", "arg_names": [], "import_names": [], "rhs_call_name": "RLock", "annotation": ""}, "snippet": " self.fit_circle_lock = RLock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L26_C8", "label": "Subscriber()", "type": "expression", "loc": [26, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [8, 2, 0.0744, 0.0083, 2, 0.42, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('mechanism_kinematics_rot',\n MechanismKinematicsRot,\n self.mechanism_kinematics_rot_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L29_C8", "label": "Subscriber()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [8, 2, 0.0799, 0.0028, 2, 0.42, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('epc/stop', Empty, self.stop_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L31_C8", "label": "self.force_traj_pub = Publisher()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [14, 2, 0.0854, 0.0028, 2, 0.42, 0.8333, 477, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_traj_pub = rospy.Publisher('epc/force_test', ForceTrajectory)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L32_C8", "label": "self.mech_traj_pub = Publisher()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "vector": [14, 2, 0.0882, 0.0028, 2, 0.42, 1.0, 690, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mech_traj_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mech_traj_pub = rospy.Publisher('mechanism_trajectory', Point32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "label": "init_log", "type": "function", "loc": [34, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.1047, 0.0248, 1, 0.24, 0.125, 377, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_log(self):\n self.f_list = []\n self.cep_list = []\n self.ee_list = []\n self.ft = ForceTrajectory()\n if self.mechanism_type != '':\n self.ft.type = self.mechanism_type\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L35_C8", "label": "self.f_list =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "vector": [14, 2, 0.0964, 0.0028, 2, 0.99, 0.0, 589, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.f_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.f_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L36_C8", "label": "self.cep_list =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "vector": [14, 2, 0.0992, 0.0028, 2, 0.99, 0.25, 867, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cep_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cep_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L37_C8", "label": "self.ee_list =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "vector": [14, 2, 0.1019, 0.0028, 2, 0.99, 0.5, 959, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ee_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ee_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L38_C8", "label": "self.ft = ForceTrajectory()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "vector": [14, 2, 0.1047, 0.0028, 2, 0.99, 0.75, 470, 3, 0, 0, 0, 306, 10, 1], "semantic": {"name": "self.ft", "arg_names": [], "import_names": [], "rhs_call_name": "ForceTrajectory", "annotation": ""}, "snippet": " self.ft = ForceTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L39_C8", "label": "if", "type": "if", "loc": [39, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "vector": [4, 2, 0.1116, 0.011, 2, 0.99, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.mechanism_type != '':\n self.ft.type = self.mechanism_type\n else:\n self.ft.type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L40_C12", "label": "self.ft.type =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L39_C8", "vector": [14, 3, 0.1102, 0.0028, 3, 0.72, 0.0, 531, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ft.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft.type = self.mechanism_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L42_C12", "label": "self.ft.type =", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L39_C8", "vector": [14, 3, 0.1157, 0.0028, 3, 0.72, 1.0, 531, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.ft.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ft.type = 'rotary'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "label": "log_state", "type": "function", "loc": [44, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.1488, 0.0579, 1, 0.24, 0.25, 805, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "log_state", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_state(self, arm):\n # only logging the right arm.\n f = self.robot.get_wrist_force(arm, base_frame=True)\n self.f_list.append(f.A1.tolist())\n cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True)\n self.cep_list.append(cep.A1.tolist())\n ee, _ = self.robot.get_ee_jtt(arm)\n self.ee_list.append(ee.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L46_C8", "label": "f = get_wrist_force()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [14, 2, 0.1267, 0.0028, 2, 0.0, 0.0, 899, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " f = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L47_C8", "label": "append()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [8, 2, 0.1295, 0.0028, 2, 0.0, 0.1429, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.f_list.append(f.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L48_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [14, 2, 0.1322, 0.0028, 2, 0.0, 0.2857, 705, 3, 2, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm, hook_tip=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L49_C8", "label": "append()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [8, 2, 0.135, 0.0028, 2, 0.0, 0.4286, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.cep_list.append(cep.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L50_C8", "label": "ee, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [14, 2, 0.1377, 0.0028, 2, 0.0, 0.5714, 241, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "ee, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " ee, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L51_C8", "label": "append()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [8, 2, 0.1405, 0.0028, 2, 0.0, 0.7143, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ee_list.append(ee.A1.tolist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L53_C8", "label": "if", "type": "if", "loc": [53, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [4, 2, 0.1584, 0.0275, 2, 0.0, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle == False:\n if f[0,0] > 5.:\n self.started_pulling_on_handle_count += 1\n else:\n self.started_pulling_on_handle_count = 0\n self.init_log() # reset logs until started pulling on the handle.\n self.init_tangent_vector = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "label": "if", "type": "if", "loc": [54, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L53_C8", "vector": [4, 3, 0.1556, 0.0165, 3, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f[0,0] > 5.:\n self.started_pulling_on_handle_count += 1\n else:\n self.started_pulling_on_handle_count = 0\n self.init_log() # reset logs until started pulling on the handle.\n self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L57_C16", "label": "self.started_pulling_on_handle_count =", "type": "assigned_variable", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "vector": [14, 4, 0.157, 0.0028, 4, 0.34, 0.0, 870, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.started_pulling_on_handle_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L58_C16", "label": "init_log()", "type": "expression", "loc": [58, 58], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "vector": [8, 4, 0.1598, 0.0028, 4, 0.34, 0.5, 377, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": " self.init_log() # reset logs until started pulling on the handle."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L59_C16", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "vector": [14, 4, 0.1625, 0.0028, 4, 0.34, 1.0, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L61_C12", "label": "if", "type": "if", "loc": [61, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L53_C8", "vector": [4, 3, 0.1694, 0.0055, 3, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle_count > 1:\n self.started_pulling_on_handle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L62_C16", "label": "self.started_pulling_on_handle =", "type": "assigned_variable", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L61_C12", "vector": [14, 4, 0.1708, 0.0028, 4, 0.75, 0.0, 945, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.started_pulling_on_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "vector": [13, 2, 0.1763, 0.0028, 2, 0.0, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L67_C4", "label": "stop_cb", "type": "function", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.186, 0.0055, 1, 0.24, 0.375, 430, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "stop_cb", "arg_names": ["self", "cmd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_cb(self, cmd):\n self.stopping_string = 'stop_cb called.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L68_C8", "label": "self.stopping_string =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L67_C4", "vector": [14, 2, 0.1873, 0.0028, 2, 0.47, 0.0, 265, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.stopping_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stopping_string = 'stop_cb called.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "label": "common_stopping_conditions", "type": "function", "loc": [70, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.219, 0.0551, 1, 0.24, 0.5, 763, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "common_stopping_conditions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def common_stopping_conditions(self):\n stop = ''\n # right arm only.\n wrist_force = self.robot.get_wrist_force(0, base_frame=True)\n print('wrist_force:', wrist_force)\n mag = np.linalg.norm(wrist_force)\n if mag > self.eq_force_threshold:\n stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L71_C8", "label": "stop =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [14, 2, 0.1956, 0.0028, 2, 0.97, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L73_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [14, 2, 0.2011, 0.0028, 2, 0.97, 0.1429, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(0, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L74_C8", "label": "print()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [8, 2, 0.2039, 0.0028, 2, 0.97, 0.2857, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('wrist_force:', wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L75_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [14, 2, 0.2066, 0.0028, 2, 0.97, 0.4286, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L76_C8", "label": "if", "type": "if", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [4, 2, 0.2107, 0.0055, 2, 0.97, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag > self.eq_force_threshold:\n stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L77_C12", "label": "stop =", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L76_C8", "vector": [14, 3, 0.2121, 0.0028, 3, 0.59, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'force exceed'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L79_C8", "label": "if", "type": "if", "loc": [79, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [4, 2, 0.2259, 0.0193, 2, 0.97, 0.7143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mag < 1.2 and self.hooked_location_moved:\n if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1\n else:\n self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L80_C12", "label": "if", "type": "if", "loc": [80, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L79_C8", "vector": [4, 3, 0.2245, 0.011, 3, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.prev_force_mag - mag) > 30.:\n stop = 'slip: force step decrease and below thresold.'\n else:\n self.slip_count += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L81_C16", "label": "stop =", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L80_C12", "vector": [14, 4, 0.2231, 0.0028, 4, 0.78, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force step decrease and below thresold.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L85_C12", "label": "self.slip_count =", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L79_C8", "vector": [14, 3, 0.2342, 0.0028, 3, 0.01, 1.0, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [4, 2, 0.241, 0.0055, 2, 0.97, 0.8571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.slip_count == 10:\n stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L88_C12", "label": "stop =", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L87_C8", "vector": [14, 3, 0.2424, 0.0028, 3, 0.8, 0.0, 343, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'slip: force below threshold for too long.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "vector": [13, 2, 0.2452, 0.0028, 2, 0.97, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "label": "mechanism_kinematics_rot_cb", "type": "function", "loc": [91, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.259, 0.0193, 1, 0.24, 0.625, 407, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "mechanism_kinematics_rot_cb", "arg_names": ["self", "mk"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mechanism_kinematics_rot_cb(self, mk):\n self.fit_circle_lock.acquire()\n self.cx_start = mk.cx\n self.cy_start = mk.cy\n self.cz_start = mk.cz\n self.rad = mk.rad\n self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L92_C8", "label": "acquire()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "vector": [8, 2, 0.2534, 0.0028, 2, 0.08, 0.0, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L93_C8", "label": "self.cx_start =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "vector": [14, 2, 0.2562, 0.0028, 2, 0.08, 0.2, 939, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = mk.cx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L94_C8", "label": "self.cy_start =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "vector": [14, 2, 0.259, 0.0028, 2, 0.08, 0.4, 418, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = mk.cy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L95_C8", "label": "self.cz_start =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "vector": [14, 2, 0.2617, 0.0028, 2, 0.08, 0.6, 113, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = mk.cz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L96_C8", "label": "self.rad =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "vector": [14, 2, 0.2645, 0.0028, 2, 0.08, 0.8, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = mk.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L97_C8", "label": "release()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "vector": [8, 2, 0.2672, 0.0028, 2, 0.08, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "label": "cep_gen_control_radial_force", "type": "function", "loc": [107, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.4862, 0.3857, 1, 0.24, 0.75, 877, 0, 4, 1, 0, 0, 0, 43], "semantic": {"name": "cep_gen_control_radial_force", "arg_names": ["self", "arm", "cep", "cep_vel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cep_gen_control_radial_force(self, arm, cep, cep_vel):\n self.log_state(arm)\n if self.started_pulling_on_handle == False:\n cep_vel = 0.02\n\n #step_size = 0.01 * cep_vel\n step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)\n stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L108_C8", "label": "log_state()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.2975, 0.0028, 2, 0.34, 0.0, 805, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_state", "arg_names": [], "import_names": [], "rhs_call_name": "log_state", "annotation": ""}, "snippet": " self.log_state(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L109_C8", "label": "if", "type": "if", "loc": [109, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.3017, 0.0055, 2, 0.34, 0.0179, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle == False:\n cep_vel = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L110_C12", "label": "cep_vel =", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L109_C8", "vector": [14, 3, 0.303, 0.0028, 3, 0.71, 0.0, 568, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "cep_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_vel = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L113_C8", "label": "step_size =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3113, 0.0028, 2, 0.34, 0.0357, 764, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.1 * cep_vel # 0.1 is the time interval between calls to the equi_generator function (see pull)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L114_C8", "label": "stop = common_stopping_conditions()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.314, 0.0028, 2, 0.34, 0.0536, 343, 3, 0, 0, 0, 763, 10, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "common_stopping_conditions", "annotation": ""}, "snippet": " stop = self.common_stopping_conditions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L115_C8", "label": "wrist_force = get_wrist_force()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3168, 0.0028, 2, 0.34, 0.0714, 483, 3, 2, 0, 0, 854, 10, 1], "semantic": {"name": "wrist_force", "arg_names": [], "import_names": [], "rhs_call_name": "get_wrist_force", "annotation": ""}, "snippet": " wrist_force = self.robot.get_wrist_force(arm, base_frame=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L116_C8", "label": "mag = norm()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3196, 0.0028, 2, 0.34, 0.0893, 533, 3, 1, 0, 0, 902, 10, 1], "semantic": {"name": "mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " mag = np.linalg.norm(wrist_force)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L118_C8", "label": "curr_pos, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3251, 0.0028, 2, 0.34, 0.1071, 183, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "curr_pos, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " curr_pos, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L119_C8", "label": "if", "type": "if", "loc": [119, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.332, 0.011, 2, 0.34, 0.125, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.ee_list)>1:\n start_pos = np.matrix(self.ee_list[0]).T\n else:\n start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L120_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L119_C8", "vector": [14, 3, 0.3306, 0.0028, 3, 0.42, 0.0, 12, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = np.matrix(self.ee_list[0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L122_C12", "label": "start_pos =", "type": "assigned_variable", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L119_C8", "vector": [14, 3, 0.3361, 0.0028, 3, 0.42, 1.0, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_pos = curr_pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L125_C8", "label": "if", "type": "if", "loc": [125, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.3471, 0.0083, 2, 0.34, 0.1429, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle:\n self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L126_C12", "label": "publish()", "type": "expression", "loc": [126, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L125_C8", "vector": [8, 3, 0.3485, 0.0055, 3, 0.57, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mech_traj_pub.publish(Point32(curr_pos[0,0],\n curr_pos[1,0], curr_pos[2,0]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L129_C8", "label": "acquire()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.3554, 0.0028, 2, 0.34, 0.1607, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.fit_circle_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L130_C8", "label": "rad =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3581, 0.0028, 2, 0.34, 0.1786, 439, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rad = self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L131_C8", "label": "cx_start, cy_start =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3609, 0.0028, 2, 0.34, 0.1964, 372, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx_start, cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx_start, cy_start = self.cx_start, self.cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L132_C8", "label": "cz_start =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3636, 0.0028, 2, 0.34, 0.2143, 322, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz_start = self.cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L133_C8", "label": "release()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.3664, 0.0028, 2, 0.34, 0.2321, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.fit_circle_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L134_C8", "label": "cx, cy =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3691, 0.0028, 2, 0.34, 0.25, 959, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cx, cy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cx, cy = cx_start, cy_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L135_C8", "label": "cz =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3719, 0.0028, 2, 0.34, 0.2679, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cz = cz_start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L136_C8", "label": "print()", "type": "expression", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.3747, 0.0028, 2, 0.34, 0.2857, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cx, cy, r:', cx, cy, rad)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L138_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3802, 0.0028, 2, 0.34, 0.3036, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = curr_pos - np.matrix([cx,cy,cz]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L139_C8", "label": "radial_vec =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.3829, 0.0028, 2, 0.34, 0.3214, 253, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = radial_vec/np.linalg.norm(radial_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L140_C8", "label": "if", "type": "if", "loc": [140, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.3898, 0.011, 2, 0.34, 0.3393, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start < start_pos[1,0]:\n tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]\n else:\n tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L141_C12", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L140_C8", "vector": [14, 3, 0.3884, 0.0028, 3, 0.16, 0.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = -radial_vec[1,0],radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L143_C12", "label": "tan_x, tan_y =", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L140_C8", "vector": [14, 3, 0.3939, 0.0028, 3, 0.16, 1.0, 33, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "tan_x, tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x,tan_y = radial_vec[1,0],-radial_vec[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L145_C8", "label": "if", "type": "if", "loc": [145, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.4022, 0.0083, 2, 0.34, 0.3571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tan_x > 0. and (start_pos[0,0]-curr_pos[0,0]) < 0.09:\n tan_x = -tan_x\n tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L146_C12", "label": "tan_x =", "type": "assigned_variable", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L145_C8", "vector": [14, 3, 0.4022, 0.0028, 3, 0.37, 0.0, 718, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_x = -tan_x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L147_C12", "label": "tan_y =", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L145_C8", "vector": [14, 3, 0.405, 0.0028, 3, 0.37, 1.0, 936, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tan_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tan_y = -tan_y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.4118, 0.0055, 2, 0.34, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cy_start > start_pos[1,0]:\n radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L150_C12", "label": "radial_vec =", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L149_C8", "vector": [14, 3, 0.4132, 0.0028, 3, 0.22, 0.0, 253, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec = -radial_vec # axis to the left, want force in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L152_C8", "label": "rv =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4187, 0.0028, 2, 0.34, 0.3929, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rv = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L153_C8", "label": "force_vec =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4215, 0.0028, 2, 0.34, 0.4107, 819, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "force_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec = np.matrix([rv[0,0], rv[1,0], 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L154_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4242, 0.0028, 2, 0.34, 0.4286, 367, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = np.matrix([tan_x, tan_y, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L156_C8", "label": "tangential_vec_ts =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4298, 0.0028, 2, 0.34, 0.4464, 833, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tangential_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec_ts = tangential_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L157_C8", "label": "radial_vec_ts =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4325, 0.0028, 2, 0.34, 0.4643, 149, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_vec_ts = radial_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L158_C8", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4353, 0.0028, 2, 0.34, 0.4821, 900, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = force_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L160_C8", "label": "if", "type": "if", "loc": [160, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.4477, 0.0165, 2, 0.34, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'right_arm' or arm == 0:\n if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts\n else:\n if force_vec_ts[1,0] > 0.: # only allowing force to the right\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L161_C12", "label": "if", "type": "if", "loc": [161, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L160_C8", "vector": [4, 3, 0.4449, 0.0055, 3, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] < 0.: # only allowing force to the left\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L162_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [162, 162], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L161_C12", "vector": [14, 4, 0.4463, 0.0028, 4, 0.29, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L164_C12", "label": "if", "type": "if", "loc": [164, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L160_C8", "vector": [4, 3, 0.4532, 0.0055, 3, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_vec_ts[1,0] > 0.: # only allowing force to the right\n force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L165_C16", "label": "force_vec_ts =", "type": "assigned_variable", "loc": [165, 165], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L164_C12", "vector": [14, 4, 0.4545, 0.0028, 4, 0.78, 0.0, 900, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_vec_ts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec_ts = -force_vec_ts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L167_C8", "label": "f_vec =", "type": "assigned_variable", "loc": [167, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4614, 0.0055, 2, 0.34, 0.5179, 231, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_vec = -1*np.array([wrist_force[0,0], wrist_force[1,0],\n wrist_force[2,0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L169_C8", "label": "f_rad_mag = dot()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4656, 0.0028, 2, 0.34, 0.5357, 421, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "f_rad_mag", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " f_rad_mag = np.dot(f_vec, force_vec.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L170_C8", "label": "err =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4683, 0.0028, 2, 0.34, 0.5536, 541, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "err", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " err = f_rad_mag-2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L171_C8", "label": "if", "type": "if", "loc": [171, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.4752, 0.011, 2, 0.34, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if err>0.:\n kp = -0.1\n else:\n kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L172_C12", "label": "kp =", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L171_C8", "vector": [14, 3, 0.4738, 0.0028, 3, 0.45, 0.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L174_C12", "label": "kp =", "type": "assigned_variable", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L171_C8", "vector": [14, 3, 0.4793, 0.0028, 3, 0.45, 1.0, 93, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kp = -0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L175_C8", "label": "radial_motion_mag =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4821, 0.0028, 2, 0.34, 0.5893, 633, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_mag = kp * err # radial_motion_mag in cm (depends on eq_motion step size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L176_C8", "label": "radial_motion_vec =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4848, 0.0028, 2, 0.34, 0.6071, 721, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "radial_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " radial_motion_vec = force_vec * radial_motion_mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L177_C8", "label": "eq_motion_vec = copy()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4876, 0.0028, 2, 0.34, 0.625, 4, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "eq_motion_vec", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " eq_motion_vec = copy.copy(tangential_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L180_C8", "label": "self.prev_force_mag =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.4959, 0.0028, 2, 0.34, 0.6429, 497, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prev_force_mag = mag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L182_C8", "label": "if", "type": "if", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.5028, 0.0055, 2, 0.34, 0.6607, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.init_tangent_vector == None or self.started_pulling_on_handle == False:\n self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L183_C12", "label": "self.init_tangent_vector = copy()", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L182_C8", "vector": [14, 3, 0.5041, 0.0028, 3, 0.09, 0.0, 965, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.init_tangent_vector = copy.copy(tangential_vec_ts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L184_C8", "label": "c = dot()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.5069, 0.0028, 2, 0.34, 0.6786, 411, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " c = np.dot(tangential_vec_ts.A1, self.init_tangent_vector.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L185_C8", "label": "ang = arccos()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.5096, 0.0028, 2, 0.34, 0.6964, 762, 3, 1, 0, 0, 793, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "arccos", "annotation": ""}, "snippet": " ang = np.arccos(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L186_C8", "label": "if", "type": "if", "loc": [186, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.5138, 0.0055, 2, 0.34, 0.7143, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.isnan(ang):\n ang = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L187_C12", "label": "ang =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L186_C8", "vector": [14, 3, 0.5152, 0.0028, 3, 0.56, 0.0, 762, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ang = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L189_C8", "label": "tangential_vec =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.5207, 0.0028, 2, 0.34, 0.7321, 367, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tangential_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tangential_vec = tangential_vec / np.linalg.norm(tangential_vec) # paranoia abot vectors not being unit vectors."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L190_C8", "label": "dist_moved = dot()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.5234, 0.0028, 2, 0.34, 0.75, 696, 3, 2, 0, 0, 310, 10, 1], "semantic": {"name": "dist_moved", "arg_names": [], "import_names": [], "rhs_call_name": "dot", "annotation": ""}, "snippet": " dist_moved = np.dot((curr_pos - start_pos).A1, tangential_vec_ts.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L191_C8", "label": "ftan = abs()", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.5262, 0.0028, 2, 0.34, 0.7679, 771, 3, 1, 0, 0, 799, 10, 2], "semantic": {"name": "ftan", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " ftan = abs(np.dot(wrist_force.A1, tangential_vec.A1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L192_C8", "label": "append()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.5289, 0.0028, 2, 0.34, 0.7857, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.tangential_force.append(ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L193_C8", "label": "append()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.5317, 0.0028, 2, 0.34, 0.8036, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.radial_force.append(f_rad_mag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "label": "if", "type": "if", "loc": [195, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.5427, 0.0138, 2, 0.34, 0.8214, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.ft.type == 'rotary':\n self.ft.configuration.append(ang)\n else: # drawer\n print('dist_moved:', dist_moved)\n self.ft.configuration.append(dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L196_C12", "label": "append()", "type": "expression", "loc": [196, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "vector": [8, 3, 0.5399, 0.0028, 3, 0.38, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.configuration.append(ang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L198_C12", "label": "print()", "type": "expression", "loc": [198, 198], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "vector": [8, 3, 0.5455, 0.0028, 3, 0.38, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('dist_moved:', dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L199_C12", "label": "append()", "type": "expression", "loc": [199, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "vector": [8, 3, 0.5482, 0.0028, 3, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ft.configuration.append(dist_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L201_C8", "label": "if", "type": "if", "loc": [201, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.5551, 0.0055, 2, 0.34, 0.8393, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.started_pulling_on_handle:\n self.force_traj_pub.publish(self.ft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L202_C12", "label": "publish()", "type": "expression", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L201_C8", "vector": [8, 3, 0.5565, 0.0028, 3, 0.39, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_traj_pub.publish(self.ft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "label": "if", "type": "if", "loc": [217, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.6033, 0.0138, 2, 0.34, 0.8571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(dist_moved) > 0.09 and self.hooked_location_moved == False:\n # change the force threshold once the hook has started pulling.\n self.hooked_location_moved = True\n self.eq_force_threshold = ut.bound(mag+30.,20.,80.)\n self.ftan_threshold = 1.2 * self.ftan_threshold + 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L219_C12", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "vector": [14, 3, 0.6033, 0.0028, 3, 0.06, 0.0, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L220_C12", "label": "self.eq_force_threshold = bound()", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "vector": [14, 3, 0.6061, 0.0028, 3, 0.06, 0.5, 675, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "bound", "annotation": ""}, "snippet": " self.eq_force_threshold = ut.bound(mag+30.,20.,80.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L221_C12", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "vector": [14, 3, 0.6088, 0.0028, 3, 0.06, 1.0, 667, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 1.2 * self.ftan_threshold + 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L222_C8", "label": "if", "type": "if", "loc": [222, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.6171, 0.0138, 2, 0.34, 0.875, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved:\n if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan\n else:\n self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L223_C12", "label": "if", "type": "if", "loc": [223, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L222_C8", "vector": [4, 3, 0.6157, 0.0055, 3, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if abs(tangential_vec_ts[2,0]) < 0.2 and ftan > self.ftan_threshold:\n stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L224_C16", "label": "stop =", "type": "assigned_variable", "loc": [224, 224], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L223_C12", "vector": [14, 4, 0.6171, 0.0028, 4, 0.21, 0.0, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'ftan threshold exceed: %f'%ftan"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L226_C12", "label": "self.ftan_threshold = max()", "type": "assigned_variable", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L222_C8", "vector": [14, 3, 0.6226, 0.0028, 3, 0.42, 1.0, 667, 3, 2, 0, 0, 442, 10, 1], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "max", "annotation": ""}, "snippet": " self.ftan_threshold = max(self.ftan_threshold, ftan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "label": "if", "type": "if", "loc": [228, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.6364, 0.0193, 2, 0.34, 0.8929, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.hooked_location_moved and ang > math.radians(90.):\n print('Angle:', math.degrees(ang))\n self.open_ang_exceed_count += 1\n if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))\n else:\n self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L229_C12", "label": "print()", "type": "expression", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "vector": [8, 3, 0.6309, 0.0028, 3, 0.14, 0.0, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Angle:', math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L231_C12", "label": "if", "type": "if", "loc": [231, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "vector": [4, 3, 0.6377, 0.0055, 3, 0.14, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.open_ang_exceed_count > 2:\n stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L232_C16", "label": "stop =", "type": "assigned_variable", "loc": [232, 232], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L231_C12", "vector": [14, 4, 0.6391, 0.0028, 4, 0.05, 0.0, 343, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = 'opened mechanism through large angle: %.1f'%(math.degrees(ang))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L234_C12", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "vector": [14, 3, 0.6446, 0.0028, 3, 0.14, 1.0, 172, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L236_C8", "label": "cep_t =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.6501, 0.0028, 2, 0.34, 0.9107, 772, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + eq_motion_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L237_C8", "label": "cep_t =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.6529, 0.0028, 2, 0.34, 0.9286, 772, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cep_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep_t = cep + np.matrix([-1., 0., 0.]).T * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "label": "if", "type": "if", "loc": [238, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [4, 2, 0.6598, 0.011, 2, 0.34, 0.9464, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cep_t[0,0] > 0.1:\n cep[0,0] = cep_t[0,0]\n cep[1,0] = cep_t[1,0]\n cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L239_C12", "label": "assign", "type": "assigned_variable", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "vector": [14, 3, 0.6584, 0.0028, 3, 0.19, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[0,0] = cep_t[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L240_C12", "label": "assign", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "vector": [14, 3, 0.6612, 0.0028, 3, 0.19, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[1,0] = cep_t[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L241_C12", "label": "assign", "type": "assigned_variable", "loc": [241, 241], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "vector": [14, 3, 0.6639, 0.0028, 3, 0.19, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cep[2,0] = cep_t[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L243_C8", "label": "print()", "type": "expression", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [8, 2, 0.6694, 0.0028, 2, 0.34, 0.9643, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('CEP:', cep.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L245_C8", "label": "stop =", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [14, 2, 0.6749, 0.0028, 2, 0.34, 0.9821, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop = stop + self.stopping_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L246_C8", "label": "return", "type": "return", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "vector": [13, 2, 0.6777, 0.0028, 2, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stop, (cep, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "label": "pull", "type": "function", "loc": [248, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.7424, 0.1212, 1, 0.24, 0.875, 964, 0, 5, 0, 0, 0, 0, 12], "semantic": {"name": "pull", "arg_names": ["self", "arm", "force_threshold", "cep_vel", "mechanism_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pull(self, arm, force_threshold, cep_vel, mechanism_type=''):\n self.mechanism_type = mechanism_type\n self.stopping_string = ''\n self.eq_pt_not_moving_counter = 0\n\n self.init_log()\n\n self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L249_C8", "label": "self.mechanism_type =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.686, 0.0028, 2, 0.74, 0.0, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mechanism_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mechanism_type = mechanism_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L250_C8", "label": "self.stopping_string =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.6887, 0.0028, 2, 0.74, 0.0385, 265, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.stopping_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.stopping_string = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L251_C8", "label": "self.eq_pt_not_moving_counter =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.6915, 0.0028, 2, 0.74, 0.0769, 123, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.eq_pt_not_moving_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_pt_not_moving_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L253_C8", "label": "init_log()", "type": "expression", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [8, 2, 0.697, 0.0028, 2, 0.74, 0.1154, 377, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_log", "arg_names": [], "import_names": [], "rhs_call_name": "init_log", "annotation": ""}, "snippet": " self.init_log()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L255_C8", "label": "self.init_tangent_vector =", "type": "assigned_variable", "loc": [255, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7025, 0.0028, 2, 0.74, 0.1538, 965, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.init_tangent_vector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.init_tangent_vector = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L256_C8", "label": "self.open_ang_exceed_count =", "type": "assigned_variable", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7052, 0.0028, 2, 0.74, 0.1923, 172, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.open_ang_exceed_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.open_ang_exceed_count = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L258_C8", "label": "self.eq_force_threshold =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7107, 0.0028, 2, 0.74, 0.2308, 675, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.eq_force_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.eq_force_threshold = force_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L259_C8", "label": "self.ftan_threshold =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7135, 0.0028, 2, 0.74, 0.2692, 667, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.ftan_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ftan_threshold = 2."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L260_C8", "label": "self.hooked_location_moved =", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7163, 0.0028, 2, 0.74, 0.3077, 183, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.hooked_location_moved", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.hooked_location_moved = False # flag to indicate when the hooking location started moving."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L261_C8", "label": "self.prev_force_mag = norm()", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.719, 0.0028, 2, 0.74, 0.3462, 497, 3, 1, 0, 0, 902, 10, 2], "semantic": {"name": "self.prev_force_mag", "arg_names": [], "import_names": [], "rhs_call_name": "norm", "annotation": ""}, "snippet": " self.prev_force_mag = np.linalg.norm(self.robot.get_wrist_force(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L262_C8", "label": "self.slip_count =", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7218, 0.0028, 2, 0.74, 0.3846, 338, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.slip_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.slip_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L264_C8", "label": "self.started_pulling_on_handle =", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7273, 0.0028, 2, 0.74, 0.4231, 945, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.started_pulling_on_handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L265_C8", "label": "self.started_pulling_on_handle_count =", "type": "assigned_variable", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.73, 0.0028, 2, 0.74, 0.4615, 870, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.started_pulling_on_handle_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.started_pulling_on_handle_count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L267_C8", "label": "ee_pos, _ = get_ee_jtt()", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7355, 0.0028, 2, 0.74, 0.5, 323, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "ee_pos, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_ee_jtt", "annotation": ""}, "snippet": " ee_pos, _ = self.robot.get_ee_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L269_C8", "label": "self.cx_start =", "type": "assigned_variable", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.741, 0.0028, 2, 0.74, 0.5385, 939, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cx_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cx_start = ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L270_C8", "label": "self.rad =", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7438, 0.0028, 2, 0.74, 0.5769, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.rad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rad = 10.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L271_C8", "label": "self.cy_start =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7466, 0.0028, 2, 0.74, 0.6154, 418, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cy_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cy_start = ee_pos[1,0]-self.rad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L272_C8", "label": "self.cz_start =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7493, 0.0028, 2, 0.74, 0.6538, 113, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cz_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cz_start = ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L274_C8", "label": "cep, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7548, 0.0028, 2, 0.74, 0.6923, 705, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L275_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7576, 0.0028, 2, 0.74, 0.7308, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, cep, cep_vel]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L276_C8", "label": "result, _ = epc_motion()", "type": "assigned_variable", "loc": [276, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7645, 0.011, 2, 0.74, 0.7692, 438, 3, 6, 0, 0, 938, 10, 1], "semantic": {"name": "result, _", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " result, _ = self.epc_motion(self.cep_gen_control_radial_force,\n 0.1, arm, arg_list, self.log_state,\n #0.01, arm, arg_list,\n control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L281_C8", "label": "print()", "type": "expression", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [8, 2, 0.7741, 0.0028, 2, 0.74, 0.8077, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('EPC motion result:', result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L282_C8", "label": "print()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [8, 2, 0.7769, 0.0028, 2, 0.74, 0.8462, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Original force threshold:', force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L283_C8", "label": "print()", "type": "expression", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [8, 2, 0.7796, 0.0028, 2, 0.74, 0.8846, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted force threshold:', self.eq_force_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L284_C8", "label": "print()", "type": "expression", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [8, 2, 0.7824, 0.0028, 2, 0.74, 0.9231, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Adapted ftan threshold:', self.ftan_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L286_C8", "label": "d =", "type": "assigned_variable", "loc": [286, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [14, 2, 0.7934, 0.0138, 2, 0.74, 0.9615, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " d = {\n 'f_list': self.f_list, 'ee_list': self.ee_list,\n 'cep_list': self.cep_list, 'ftan_list': self.ft.tangential_force,\n 'config_list': self.ft.configuration, 'frad_list': self.ft.radial_force\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L291_C8", "label": "save_pickle()", "type": "expression", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "vector": [8, 2, 0.8017, 0.0028, 2, 0.74, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " ut.save_pickle(d,'pr2_pull_'+ut.formatted_time()+'.pkl')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "label": "search_and_hook", "type": "function", "loc": [293, 333], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "vector": [2, 1, 0.8623, 0.1129, 1, 0.24, 1.0, 913, 0, 7, 1, 0, 0, 0, 13], "semantic": {"name": "search_and_hook", "arg_names": ["self", "arm", "hook_loc", "hooking_force_threshold", "hit_threshold", "hit_motions", "hook_direction"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def search_and_hook(self, arm, hook_loc, hooking_force_threshold = 5.,\n hit_threshold=2., hit_motions = 1,\n hook_direction = 'left'):\n # this needs to be debugged. Hardcoded for now.\n #if arm == 'right_arm' or arm == 0:\n # hook_dir = np.matrix([0., 1., 0.]).T # hook direc in home position\n # offset = -0.03\n #elif arm == 'left_arm' or arm == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "label": "if", "type": "if", "loc": [307, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [4, 2, 0.8526, 0.0165, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_direction == 'left':\n offset = np.matrix([0., -0.03, 0.]).T\n move_dir = np.matrix([0., 1., 0.]).T\n elif hook_direction == 'up':\n offset = np.matrix([0., 0., -0.03]).T\n move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L308_C12", "label": "offset =", "type": "assigned_variable", "loc": [308, 308], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "vector": [14, 3, 0.8485, 0.0028, 3, 0.68, 0.0, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = np.matrix([0., -0.03, 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L309_C12", "label": "move_dir =", "type": "assigned_variable", "loc": [309, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "vector": [14, 3, 0.8512, 0.0028, 3, 0.68, 0.5, 21, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = np.matrix([0., 1., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L310_C8", "label": "if", "type": "if", "loc": [310, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "vector": [4, 3, 0.8567, 0.0083, 3, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hook_direction == 'up':\n offset = np.matrix([0., 0., -0.03]).T\n move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L311_C12", "label": "offset =", "type": "assigned_variable", "loc": [311, 311], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L310_C8", "vector": [14, 4, 0.8567, 0.0028, 4, 0.0, 0.0, 132, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = np.matrix([0., 0., -0.03]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L312_C12", "label": "move_dir =", "type": "assigned_variable", "loc": [312, 312], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L310_C8", "vector": [14, 4, 0.8595, 0.0028, 4, 0.0, 1.0, 21, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "move_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " move_dir = np.matrix([0., 0., 1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L313_C8", "label": "start_loc =", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.8623, 0.0028, 2, 0.29, 0.0769, 912, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_loc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_loc = hook_loc + offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L316_C8", "label": "normal_tl =", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.8705, 0.0028, 2, 0.29, 0.1538, 601, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "normal_tl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " normal_tl = np.matrix([1.0, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L318_C8", "label": "pt1 =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.876, 0.0028, 2, 0.29, 0.2308, 211, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt1 = start_loc - normal_tl * 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L319_C8", "label": "go_cep_jtt()", "type": "expression", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [8, 2, 0.8788, 0.0028, 2, 0.29, 0.3077, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " self.robot.go_cep_jtt(arm, pt1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L321_C8", "label": "raw_input()", "type": "expression", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [8, 2, 0.8843, 0.0028, 2, 0.29, 0.3846, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to go')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L323_C8", "label": "vec =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.8898, 0.0028, 2, 0.29, 0.4615, 132, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vec = normal_tl * 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L324_C8", "label": "sleep()", "type": "expression", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [8, 2, 0.8926, 0.0028, 2, 0.29, 0.5385, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:For_L325_C8", "label": "for i", "type": "for", "loc": [325, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [6, 2, 0.8967, 0.0055, 2, 0.29, 0.6154, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(hit_motions):\n s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L326_C12", "label": "s = move_till_hit()", "type": "assigned_variable", "loc": [326, 326], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:For_L325_C8", "vector": [14, 3, 0.8981, 0.0028, 3, 0.82, 0.0, 553, 3, 4, 0, 0, 163, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "move_till_hit", "annotation": ""}, "snippet": " s = self.move_till_hit(arm, vec=vec, force_threshold=hit_threshold, speed=0.07)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L328_C8", "label": "cep_start, _ = get_cep_jtt()", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.9036, 0.0028, 2, 0.29, 0.6923, 342, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_start, _", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_start, _ = self.robot.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L329_C8", "label": "cep = copy()", "type": "assigned_variable", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.9063, 0.0028, 2, 0.29, 0.7692, 487, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "cep", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " cep = copy.copy(cep_start)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L330_C8", "label": "arg_list =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.9091, 0.0028, 2, 0.29, 0.8462, 873, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arg_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg_list = [arm, move_dir, hooking_force_threshold, cep, cep_start]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L331_C8", "label": "s = epc_motion()", "type": "assigned_variable", "loc": [331, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [14, 2, 0.9132, 0.0055, 2, 0.29, 0.9231, 553, 3, 5, 0, 0, 938, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "epc_motion", "annotation": ""}, "snippet": " s = self.epc_motion(self.cep_gen_surface_follow, 0.1, arm,\n arg_list, control_function = self.robot.set_cep_jtt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L333_C8", "label": "return", "type": "return", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "vector": [13, 2, 0.9174, 0.0028, 2, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "label": "if", "type": "if", "loc": [336, 356], "level": 0, "parent": null, "vector": [4, 0, 0.9532, 0.0579, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import pr2_arms as pa\n rospy.init_node('epc_pr2', anonymous = True)\n rospy.logout('epc_pr2: ready')\n\n pr2_arms = pa.PR2Arms()\n door_epc = Door_EPC(pr2_arms)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L337_C4", "label": "pr2_arms import pa", "type": "import", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [1, 1, 0.9284, 0.0028, 1, 0.81, 0.0, 369, 0, 1, 0, 0, 369, 0, 0], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": ["pa"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pr2_arms as pa"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L338_C4", "label": "init_node()", "type": "expression", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.9311, 0.0028, 1, 0.81, 0.0833, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('epc_pr2', anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L339_C4", "label": "logout()", "type": "expression", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.9339, 0.0028, 1, 0.81, 0.1667, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout('epc_pr2: ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L341_C4", "label": "pr2_arms = PR2Arms()", "type": "assigned_variable", "loc": [341, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [14, 1, 0.9394, 0.0028, 1, 0.81, 0.25, 369, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arms", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arms = pa.PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L342_C4", "label": "door_epc = Door_EPC()", "type": "assigned_variable", "loc": [342, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [14, 1, 0.9421, 0.0028, 1, 0.81, 0.3333, 350, 3, 1, 0, 0, 468, 10, 1], "semantic": {"name": "door_epc", "arg_names": [], "import_names": [], "rhs_call_name": "Door_EPC", "annotation": ""}, "snippet": " door_epc = Door_EPC(pr2_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L344_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [344, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [14, 1, 0.9477, 0.0028, 1, 0.81, 0.4167, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L345_C4", "label": "arm =", "type": "assigned_variable", "loc": [345, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [14, 1, 0.9504, 0.0028, 1, 0.81, 0.5, 413, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = r_arm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L347_C4", "label": "raw_input()", "type": "expression", "loc": [347, 347], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.9559, 0.0028, 1, 0.81, 0.5833, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to close')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L348_C4", "label": "close_gripper()", "type": "expression", "loc": [348, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.9587, 0.0028, 1, 0.81, 0.6667, 807, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "close_gripper", "annotation": ""}, "snippet": " pr2_arms.close_gripper(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L349_C4", "label": "raw_input()", "type": "expression", "loc": [349, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.9614, 0.0028, 1, 0.81, 0.75, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to start Door Opening')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L354_C4", "label": "p1 =", "type": "assigned_variable", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [14, 1, 0.9752, 0.0028, 1, 0.81, 0.8333, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.8, -0.1, -0.04]).T # pos 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L355_C4", "label": "search_and_hook()", "type": "expression", "loc": [355, 355], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.978, 0.0028, 1, 0.81, 0.9167, 913, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "search_and_hook", "arg_names": [], "import_names": [], "rhs_call_name": "search_and_hook", "annotation": ""}, "snippet": " door_epc.search_and_hook(arm, p1, hook_direction='left')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L356_C4", "label": "pull()", "type": "expression", "loc": [356, 356], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "vector": [8, 1, 0.9807, 0.0028, 1, 0.81, 1.0, 964, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "pull", "arg_names": [], "import_names": [], "rhs_call_name": "pull", "annotation": ""}, "snippet": " door_epc.pull(arm, force_threshold=40., cep_vel=0.05)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L58_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L61_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L119_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L164_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L165_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L198_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L223_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L224_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L231_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L232_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L238_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L309_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L310_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L311_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L310_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L319_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:For_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:For_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Return_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Import_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L342_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L349_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Assign_L354_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L355_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99217:If_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99217:Expr_L356_C4"}] |
#!/usr/bin/python
import roslib; roslib.load_manifest("pr2_laser_pointer_grasp")
import rospy
import copy
from std_msgs.msg import Bool, Float64
from pr2_msgs.msg import PressureState
from pr2_laser_pointer_grasp.srv import GripperMonitor
from numpy import sqrt
def loginfo(str):
rospy.loginfo("PressureMonitor: " + str)
class PressureMonitor():
def __init__(self, grip_top, bias_thresh):
self.bias_pub = rospy.Publisher("/pressure/" + grip_top + "/bias_dist", Float64)
self.NUM_SENSORS = 22
self.SENSOR_WEIGHTS = [1.0] * self.NUM_SENSORS
if bias_thresh == 0.0:
self.BIAS_DIST_THRESH = 900.0
else:
self.BIAS_DIST_THRESH = bias_thresh
self.BIAS_TIME = 0.3
self.setup()
def setup(self):
self.l_bias_sum = [0.0] * self.NUM_SENSORS
self.r_bias_sum = [0.0] * self.NUM_SENSORS
self.l_bias = [0.0] * self.NUM_SENSORS
self.r_bias = [0.0] * self.NUM_SENSORS
self.bias_done = False
self.st_bias_time = None
self.num_samples = 0
self.pressure_trigger = False
def bias_dist(self, x, y):
def subsq(a, b): return (a - b) ** 2
return sqrt(sum(map(subsq,x,y)))
def pressure_biaser(self, msg):
if self.st_bias_time is None:
self.st_bias_time = rospy.Time.now().to_sec()
self.l_bias_sum = copy.copy(msg.l_finger_tip)
self.r_bias_sum = copy.copy(msg.r_finger_tip)
self.num_samples = 1
elapsed = rospy.Time.now().to_sec() - self.st_bias_time
if elapsed > self.BIAS_TIME:
def div(x): return x/self.num_samples
self.l_bias = map(div, self.l_bias_sum)
self.r_bias = map(div, self.r_bias_sum)
self.bias_done = True
def add(x,y): return x+y
self.l_bias_sum = map(add, self.l_bias_sum, msg.l_finger_tip)
self.r_bias_sum = map(add, self.r_bias_sum, msg.r_finger_tip)
self.num_samples += 1
def pressure_monitor(self, msg):
total_bias_dist = (self.bias_dist(msg.l_finger_tip,self.l_bias) +
self.bias_dist(msg.r_finger_tip,self.r_bias))
self.bias_pub.publish(total_bias_dist)
# import pdb; pdb.set_trace()
if total_bias_dist > self.BIAS_DIST_THRESH:
self.pressure_trigger = True
def monitor(msg):
pm = PressureMonitor(msg.gripper_topic, msg.bias_thresh)
pbsub = rospy.Subscriber('/pressure/' + msg.gripper_topic, PressureState, pm.pressure_biaser)
loginfo("Subscribing to " + msg.gripper_topic + ", biasing starting")
while not pm.bias_done:
rospy.sleep(0.4)
pbsub.unregister()
loginfo("Biasing complete, monitoring...")
pmsub = rospy.Subscriber('/pressure/' + msg.gripper_topic, PressureState, pm.pressure_monitor)
while not pm.pressure_trigger:
rospy.sleep(0.1)
loginfo("Pressure difference detected!")
pmsub.unregister()
pm.setup()
return True
if __name__ == "__main__":
rospy.init_node('gripper_monitor_service')
svc = rospy.Service('gripper_monitor', GripperMonitor, monitor)
loginfo("Offering gripper_monitor service.")
rospy.spin()
| ajibawa-2023/Python-Code-Large/train/row_99218 | 75 | 87 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.023, 0.0115, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest(\"pr2_laser_pointer_grasp\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.023, 0.0115, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest(\"pr2_laser_pointer_grasp\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0345, 0.0115, 0, 0.66, 0.1818, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Import_L4_C0", "label": "copy import copy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.046, 0.0115, 0, 0.66, 0.2727, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:ImportFrom_L6_C0", "label": "from std_msgs.msg import Bool, Float64", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.069, 0.0115, 0, 0.66, 0.3636, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Bool", "Float64"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Bool, Float64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:ImportFrom_L7_C0", "label": "from pr2_msgs.msg import PressureState", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0805, 0.0115, 0, 0.66, 0.4545, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["PressureState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_msgs.msg import PressureState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:ImportFrom_L8_C0", "label": "from pr2_laser_pointer_grasp.srv import GripperMonitor", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.092, 0.0115, 0, 0.66, 0.5455, 632, 0, 1, 0, 0, 632, 0, 0], "semantic": {"name": "pr2_laser_pointer_grasp.srv", "arg_names": [], "import_names": ["GripperMonitor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_laser_pointer_grasp.srv import GripperMonitor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:ImportFrom_L9_C0", "label": "from numpy import sqrt", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1034, 0.0115, 0, 0.66, 0.6364, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["sqrt"], "rhs_call_name": "", "annotation": ""}, "snippet": "from numpy import sqrt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L11_C0", "label": "loginfo", "type": "function", "loc": [11, 12], "level": 0, "parent": null, "vector": [2, 0, 0.1322, 0.023, 0, 0.66, 0.7273, 607, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": ["str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def loginfo(str):\n rospy.loginfo(\"PressureMonitor: \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L12_C4", "label": "loginfo()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L11_C0", "vector": [8, 1, 0.1379, 0.0115, 1, 0.34, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(\"PressureMonitor: \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "label": "PressureMonitor", "type": "class", "loc": [14, 65], "level": 0, "parent": null, "vector": [3, 0, 0.454, 0.5977, 0, 0.66, 0.8182, 33, 0, 8, 0, 0, 0, 0, 18], "semantic": {"name": "PressureMonitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PressureMonitor():\n\n def __init__(self, grip_top, bias_thresh):\n self.bias_pub = rospy.Publisher(\"/pressure/\" + grip_top + \"/bias_dist\", Float64)\n\n self.NUM_SENSORS = 22\n self.SENSOR_WEIGHTS = [1.0] * self.NUM_SENSORS \n if bias_thresh == 0.0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "label": "__init__", "type": "function", "loc": [16, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "vector": [2, 1, 0.2414, 0.1264, 1, 0.43, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "grip_top", "bias_thresh"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, grip_top, bias_thresh):\n self.bias_pub = rospy.Publisher(\"/pressure/\" + grip_top + \"/bias_dist\", Float64)\n\n self.NUM_SENSORS = 22\n self.SENSOR_WEIGHTS = [1.0] * self.NUM_SENSORS \n if bias_thresh == 0.0:\n self.BIAS_DIST_THRESH = 900.0\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L17_C8", "label": "self.bias_pub = Publisher()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "vector": [14, 2, 0.1954, 0.0115, 2, 0.65, 0.0, 537, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.bias_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.bias_pub = rospy.Publisher(\"/pressure/\" + grip_top + \"/bias_dist\", Float64)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L19_C8", "label": "self.NUM_SENSORS =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "vector": [14, 2, 0.2184, 0.0115, 2, 0.65, 0.2, 441, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.NUM_SENSORS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.NUM_SENSORS = 22"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L20_C8", "label": "self.SENSOR_WEIGHTS =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "vector": [14, 2, 0.2299, 0.0115, 2, 0.65, 0.4, 582, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.SENSOR_WEIGHTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.SENSOR_WEIGHTS = [1.0] * self.NUM_SENSORS "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L21_C8", "label": "if", "type": "if", "loc": [21, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "vector": [4, 2, 0.2586, 0.046, 2, 0.65, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias_thresh == 0.0:\n self.BIAS_DIST_THRESH = 900.0\n else:\n self.BIAS_DIST_THRESH = bias_thresh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L22_C12", "label": "self.BIAS_DIST_THRESH =", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L21_C8", "vector": [14, 3, 0.2529, 0.0115, 3, 0.82, 0.0, 375, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.BIAS_DIST_THRESH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.BIAS_DIST_THRESH = 900.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L24_C12", "label": "self.BIAS_DIST_THRESH =", "type": "assigned_variable", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L21_C8", "vector": [14, 3, 0.2759, 0.0115, 3, 0.82, 1.0, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.BIAS_DIST_THRESH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.BIAS_DIST_THRESH = bias_thresh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L25_C8", "label": "self.BIAS_TIME =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "vector": [14, 2, 0.2874, 0.0115, 2, 0.65, 0.8, 731, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.BIAS_TIME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.BIAS_TIME = 0.3 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L26_C8", "label": "setup()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "vector": [8, 2, 0.2989, 0.0115, 2, 0.65, 1.0, 234, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setup", "arg_names": [], "import_names": [], "rhs_call_name": "setup", "annotation": ""}, "snippet": " self.setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "label": "setup", "type": "function", "loc": [28, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "vector": [2, 1, 0.3678, 0.1034, 1, 0.43, 0.25, 234, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup(self):\n self.l_bias_sum = [0.0] * self.NUM_SENSORS\n self.r_bias_sum = [0.0] * self.NUM_SENSORS\n self.l_bias = [0.0] * self.NUM_SENSORS\n self.r_bias = [0.0] * self.NUM_SENSORS\n self.bias_done = False\n self.st_bias_time = None \n self.num_samples = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L29_C8", "label": "self.l_bias_sum =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.3333, 0.0115, 2, 0.91, 0.0, 466, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_bias_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_bias_sum = [0.0] * self.NUM_SENSORS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L30_C8", "label": "self.r_bias_sum =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.3448, 0.0115, 2, 0.91, 0.1429, 390, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_bias_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_bias_sum = [0.0] * self.NUM_SENSORS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L31_C8", "label": "self.l_bias =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.3563, 0.0115, 2, 0.91, 0.2857, 421, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.l_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_bias = [0.0] * self.NUM_SENSORS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L32_C8", "label": "self.r_bias =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.3678, 0.0115, 2, 0.91, 0.4286, 343, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_bias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_bias = [0.0] * self.NUM_SENSORS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L33_C8", "label": "self.bias_done =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.3793, 0.0115, 2, 0.91, 0.5714, 515, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.bias_done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bias_done = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L34_C8", "label": "self.st_bias_time =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.3908, 0.0115, 2, 0.91, 0.7143, 379, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.st_bias_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.st_bias_time = None "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L35_C8", "label": "self.num_samples =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.4023, 0.0115, 2, 0.91, 0.8571, 80, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_samples = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L36_C8", "label": "self.pressure_trigger =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "vector": [14, 2, 0.4138, 0.0115, 2, 0.91, 1.0, 100, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pressure_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pressure_trigger = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L38_C4", "label": "bias_dist", "type": "function", "loc": [38, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "vector": [2, 1, 0.4483, 0.0345, 1, 0.43, 0.5, 676, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "bias_dist", "arg_names": ["self", "x", "y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_dist(self, x, y):\n def subsq(a, b): return (a - b) ** 2\n return sqrt(sum(map(subsq,x,y)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L39_C8", "label": "subsq", "type": "function", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L38_C4", "vector": [2, 2, 0.4483, 0.0115, 2, 0.65, 0.0, 441, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "subsq", "arg_names": ["a", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def subsq(a, b): return (a - b) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L39_C25", "label": "return", "type": "return", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L39_C8", "vector": [13, 3, 0.4483, 0.0115, 3, 0.36, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def subsq(a, b): return (a - b) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L38_C4", "vector": [13, 2, 0.4598, 0.0115, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sqrt(sum(map(subsq,x,y)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "label": "pressure_biaser", "type": "function", "loc": [42, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "vector": [2, 1, 0.569, 0.1839, 1, 0.43, 0.75, 514, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "pressure_biaser", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pressure_biaser(self, msg):\n if self.st_bias_time is None:\n self.st_bias_time = rospy.Time.now().to_sec()\n self.l_bias_sum = copy.copy(msg.l_finger_tip)\n self.r_bias_sum = copy.copy(msg.r_finger_tip)\n self.num_samples = 1\n elapsed = rospy.Time.now().to_sec() - self.st_bias_time\n if elapsed > self.BIAS_TIME:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "label": "if", "type": "if", "loc": [43, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "vector": [4, 2, 0.5172, 0.0575, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.st_bias_time is None:\n self.st_bias_time = rospy.Time.now().to_sec()\n self.l_bias_sum = copy.copy(msg.l_finger_tip)\n self.r_bias_sum = copy.copy(msg.r_finger_tip)\n self.num_samples = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L44_C12", "label": "self.st_bias_time = to_sec()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "vector": [14, 3, 0.5057, 0.0115, 3, 0.09, 0.0, 379, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "self.st_bias_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.st_bias_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L45_C12", "label": "self.l_bias_sum = copy()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "vector": [14, 3, 0.5172, 0.0115, 3, 0.09, 0.3333, 466, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.l_bias_sum", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.l_bias_sum = copy.copy(msg.l_finger_tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L46_C12", "label": "self.r_bias_sum = copy()", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "vector": [14, 3, 0.5287, 0.0115, 3, 0.09, 0.6667, 390, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "self.r_bias_sum", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.r_bias_sum = copy.copy(msg.r_finger_tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L47_C12", "label": "self.num_samples =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "vector": [14, 3, 0.5402, 0.0115, 3, 0.09, 1.0, 80, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_samples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_samples = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L48_C8", "label": "elapsed =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "vector": [14, 2, 0.5517, 0.0115, 2, 0.57, 0.2, 61, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elapsed = rospy.Time.now().to_sec() - self.st_bias_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "label": "if", "type": "if", "loc": [49, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "vector": [4, 2, 0.5862, 0.0575, 2, 0.57, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if elapsed > self.BIAS_TIME:\n def div(x): return x/self.num_samples\n self.l_bias = map(div, self.l_bias_sum)\n self.r_bias = map(div, self.r_bias_sum)\n self.bias_done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L50_C12", "label": "div", "type": "function", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "vector": [2, 3, 0.5747, 0.0115, 3, 0.38, 0.0, 469, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "div", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def div(x): return x/self.num_samples"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L50_C24", "label": "return", "type": "return", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L50_C12", "vector": [13, 4, 0.5747, 0.0115, 4, 0.88, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def div(x): return x/self.num_samples"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L51_C12", "label": "self.l_bias = map()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "vector": [14, 3, 0.5862, 0.0115, 3, 0.38, 0.3333, 421, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "self.l_bias", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.l_bias = map(div, self.l_bias_sum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L52_C12", "label": "self.r_bias = map()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "vector": [14, 3, 0.5977, 0.0115, 3, 0.38, 0.6667, 343, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "self.r_bias", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.r_bias = map(div, self.r_bias_sum)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L53_C12", "label": "self.bias_done =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "vector": [14, 3, 0.6092, 0.0115, 3, 0.38, 1.0, 515, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.bias_done", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.bias_done = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L54_C8", "label": "add", "type": "function", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "vector": [2, 2, 0.6207, 0.0115, 2, 0.57, 0.6, 241, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "add", "arg_names": ["x", "y"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(x,y): return x+y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L54_C22", "label": "return", "type": "return", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L54_C8", "vector": [13, 3, 0.6207, 0.0115, 3, 0.34, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(x,y): return x+y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L55_C8", "label": "self.l_bias_sum = map()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "vector": [14, 2, 0.6322, 0.0115, 2, 0.57, 0.8, 466, 3, 3, 0, 0, 53, 10, 1], "semantic": {"name": "self.l_bias_sum", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.l_bias_sum = map(add, self.l_bias_sum, msg.l_finger_tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L56_C8", "label": "self.r_bias_sum = map()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "vector": [14, 2, 0.6437, 0.0115, 2, 0.57, 1.0, 390, 3, 3, 0, 0, 53, 10, 1], "semantic": {"name": "self.r_bias_sum", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.r_bias_sum = map(add, self.r_bias_sum, msg.r_finger_tip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "label": "pressure_monitor", "type": "function", "loc": [59, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "vector": [2, 1, 0.7126, 0.0805, 1, 0.43, 1.0, 882, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "pressure_monitor", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pressure_monitor(self, msg):\n total_bias_dist = (self.bias_dist(msg.l_finger_tip,self.l_bias) + \n self.bias_dist(msg.r_finger_tip,self.r_bias))\n self.bias_pub.publish(total_bias_dist)\n# import pdb; pdb.set_trace()\n if total_bias_dist > self.BIAS_DIST_THRESH:\n self.pressure_trigger = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L60_C8", "label": "total_bias_dist =", "type": "assigned_variable", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "vector": [14, 2, 0.6954, 0.023, 2, 0.1, 0.0, 423, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "total_bias_dist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_bias_dist = (self.bias_dist(msg.l_finger_tip,self.l_bias) + \n self.bias_dist(msg.r_finger_tip,self.r_bias))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L62_C8", "label": "publish()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "vector": [8, 2, 0.7126, 0.0115, 2, 0.1, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.bias_pub.publish(total_bias_dist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "vector": [4, 2, 0.7414, 0.023, 2, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if total_bias_dist > self.BIAS_DIST_THRESH:\n self.pressure_trigger = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L65_C12", "label": "self.pressure_trigger =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L64_C8", "vector": [14, 3, 0.7471, 0.0115, 3, 0.74, 0.0, 100, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.pressure_trigger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pressure_trigger = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "label": "monitor", "type": "function", "loc": [67, 81], "level": 0, "parent": null, "vector": [2, 0, 0.8506, 0.1724, 0, 0.66, 0.9091, 68, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "monitor", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def monitor(msg):\n pm = PressureMonitor(msg.gripper_topic, msg.bias_thresh)\n pbsub = rospy.Subscriber('/pressure/' + msg.gripper_topic, PressureState, pm.pressure_biaser)\n loginfo(\"Subscribing to \" + msg.gripper_topic + \", biasing starting\")\n while not pm.bias_done:\n rospy.sleep(0.4)\n pbsub.unregister()\n loginfo(\"Biasing complete, monitoring...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L68_C4", "label": "pm = PressureMonitor()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [14, 1, 0.7816, 0.0115, 1, 0.29, 0.0, 517, 3, 2, 0, 0, 33, 10, 1], "semantic": {"name": "pm", "arg_names": [], "import_names": [], "rhs_call_name": "PressureMonitor", "annotation": ""}, "snippet": " pm = PressureMonitor(msg.gripper_topic, msg.bias_thresh)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L69_C4", "label": "pbsub = Subscriber()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [14, 1, 0.7931, 0.0115, 1, 0.29, 0.0909, 451, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "pbsub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " pbsub = rospy.Subscriber('/pressure/' + msg.gripper_topic, PressureState, pm.pressure_biaser)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L70_C4", "label": "loginfo()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [8, 1, 0.8046, 0.0115, 1, 0.29, 0.1818, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " loginfo(\"Subscribing to \" + msg.gripper_topic + \", biasing starting\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L71_C4", "label": "while", "type": "while", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [5, 1, 0.8218, 0.023, 1, 0.29, 0.2727, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not pm.bias_done:\n rospy.sleep(0.4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L72_C8", "label": "sleep()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L71_C4", "vector": [8, 2, 0.8276, 0.0115, 2, 0.72, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L73_C4", "label": "unregister()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [8, 1, 0.8391, 0.0115, 1, 0.29, 0.3636, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " pbsub.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L74_C4", "label": "loginfo()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [8, 1, 0.8506, 0.0115, 1, 0.29, 0.4545, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " loginfo(\"Biasing complete, monitoring...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L75_C4", "label": "pmsub = Subscriber()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [14, 1, 0.8621, 0.0115, 1, 0.29, 0.5455, 912, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "pmsub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " pmsub = rospy.Subscriber('/pressure/' + msg.gripper_topic, PressureState, pm.pressure_monitor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L76_C4", "label": "while", "type": "while", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [5, 1, 0.8793, 0.023, 1, 0.29, 0.6364, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not pm.pressure_trigger:\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L77_C8", "label": "sleep()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L76_C4", "vector": [8, 2, 0.8851, 0.0115, 2, 0.44, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L78_C4", "label": "loginfo()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [8, 1, 0.8966, 0.0115, 1, 0.29, 0.7273, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " loginfo(\"Pressure difference detected!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L79_C4", "label": "unregister()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [8, 1, 0.908, 0.0115, 1, 0.29, 0.8182, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " pmsub.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L80_C4", "label": "setup()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [8, 1, 0.9195, 0.0115, 1, 0.29, 0.9091, 234, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setup", "arg_names": [], "import_names": [], "rhs_call_name": "setup", "annotation": ""}, "snippet": " pm.setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L81_C4", "label": "return", "type": "return", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "vector": [13, 1, 0.931, 0.0115, 1, 0.29, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "label": "if", "type": "if", "loc": [83, 87], "level": 0, "parent": null, "vector": [4, 0, 0.977, 0.0575, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n rospy.init_node('gripper_monitor_service')\n svc = rospy.Service('gripper_monitor', GripperMonitor, monitor)\n loginfo(\"Offering gripper_monitor service.\")\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L84_C4", "label": "init_node()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "vector": [8, 1, 0.9655, 0.0115, 1, 0.74, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('gripper_monitor_service')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L85_C4", "label": "svc = Service()", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "vector": [14, 1, 0.977, 0.0115, 1, 0.74, 0.3333, 564, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "svc", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " svc = rospy.Service('gripper_monitor', GripperMonitor, monitor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L86_C4", "label": "loginfo()", "type": "expression", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "vector": [8, 1, 0.9885, 0.0115, 1, 0.74, 0.6667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " loginfo(\"Offering gripper_monitor service.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L87_C4", "label": "spin()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "vector": [8, 1, 1.0, 0.0115, 1, 0.74, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L39_C25"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L50_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L50_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L54_C22"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:While_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Return_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99218:If_L83_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99218:Expr_L87_C4"}] |
#!/usr/bin/python
import roslib; roslib.load_manifest('hrl_pr2_lib')
import rospy
import math
from geometry_msgs.msg import WrenchStamped, PoseStamped, Point, PointStamped
from tf import TransformListener, transformations
from visualization_msgs.msg import Marker
class Pointmass_Adjust:
pub_marker = True #Set to (True) or to not(False) publish rviz marker showing force vector
mass = 1.0463 #kg 1.0213
pos_x = 0.0853 #m, in 'l_wrist_roll_link'
pos_y = 0.0
pos_z = 0.0
x_force_offset = 5.62 #5.70 -- These values determined from experiment, used values are adjusted for better qualitative results using rviz
y_force_offset = -13.56 #14.10
z_force_offset = 4.30 #-3.88
x_torque_offset = -0.4025 #0.3899
y_torque_offset = -0.4175 #0.3804
z_torque_offset = -0.21875
adjustment = WrenchStamped()
def __init__(self):
rospy.init_node("ft_pointmass_adjustment")
rospy.Subscriber("netft_data", WrenchStamped, self.adjust)
self.ft_out = rospy.Publisher('ft_data_pm_adjusted', WrenchStamped)
self.force_vec_out = rospy.Publisher('ft_force_vector_marker', Marker)
self.tfl = TransformListener()
def adjust(self, ft_in):
ft_out = WrenchStamped()
ft_out.header.stamp = rospy.Time.now()
ft_out.header.frame_id = ft_in.header.frame_id
ft_out.wrench.force.x = ft_in.wrench.force.x - self.x_force_offset + self.adjustment.wrench.force.x
ft_out.wrench.force.y = ft_in.wrench.force.y - self.y_force_offset + self.adjustment.wrench.force.y
ft_out.wrench.force.z = ft_in.wrench.force.z - self.z_force_offset + self.adjustment.wrench.force.z
ft_out.wrench.torque.x = ft_in.wrench.torque.x - self.x_torque_offset - self.adjustment.wrench.torque.x
ft_out.wrench.torque.y = ft_in.wrench.torque.y - self.y_torque_offset - self.adjustment.wrench.torque.y
ft_out.wrench.torque.z = ft_in.wrench.torque.z - self.z_torque_offset - self.adjustment.wrench.torque.z
self.ft_out.publish(ft_out)
if self.pub_marker:
marker = self.form_marker(ft_out)
self.force_vec_out.publish(marker)
def form_marker(self, ws):
origin = Point()
force_point = Point()
force_point.x = 0.1*ws.wrench.force.x
force_point.y = 0.1*ws.wrench.force.y
force_point.z = 0.1*ws.wrench.force.z
force_vec = Marker()
force_vec.header.stamp = rospy.Time.now()
force_vec.header.frame_id = '/l_netft_frame'
force_vec.ns = "ft_sensor"
force_vec.action = 0
force_vec.type = 0
force_vec.scale.x = 0.1
force_vec.scale.y = 0.2
force_vec.scale.z = 1
force_vec.color.a = 0.75
force_vec.color.r = 0.0
force_vec.color.g = 1.0
force_vec.color.b = 0.1
force_vec.lifetime = rospy.Duration(1)
force_vec.points.append(origin)
force_vec.points.append(force_point)
return force_vec
def calc_adjustment(self):
try:
(pos, quat) = self.tfl.lookupTransform('/base_link', '/l_netft_frame', rospy.Time(0))
except:
return
rot = transformations.euler_from_quaternion(quat)
self.adjustment.wrench.torque.x = self.mass*9.80665*self.pos_x*math.sin(rot[0])
self.adjustment.wrench.torque.y = self.mass*9.80665*self.pos_x*math.sin(rot[1])
self.adjustment.wrench.torque.z = 0
grav = PointStamped() # Generate a 'vector' of the force due to gravity at the ft sensor
grav.header.stamp = rospy.Time(0) #Used to tell tf to grab latest available transform in transformVector3
grav.header.frame_id = '/base_link'
grav.point.x = pos[0]
grav.point.y = pos[1]
grav.point.z = pos[2] - 9.80665*self.mass
netft_grav = self.tfl.transformPoint('/l_netft_frame', grav) #Returns components of the 'gravity force' in each axis of the 'l_netft_frame'
self.adjustment.wrench.force.x = netft_grav.point.x
self.adjustment.wrench.force.y = netft_grav.point.y
self.adjustment.wrench.force.z = netft_grav.point.z
self.adjustment.header.stamp=rospy.Time.now()
#self.form_marker(self.adjustment)
if __name__ == "__main__":
PMC = Pointmass_Adjust()
r=rospy.Rate(1000)
while not rospy.is_shutdown():
PMC.calc_adjustment()
r.sleep()
| ajibawa-2023/Python-Code-Large/train/row_99219 | 88 | 104 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0288, 0.0096, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0288, 0.0096, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0385, 0.0096, 0, 0.66, 0.25, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Import_L5_C0", "label": "math import math", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0481, 0.0096, 0, 0.66, 0.375, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:ImportFrom_L6_C0", "label": "from geometry_msgs.msg import WrenchStamped, PoseStamped, Point\u2026", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0577, 0.0096, 0, 0.66, 0.5, 951, 0, 4, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["WrenchStamped", "PoseStamped", "Point", "PointStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import WrenchStamped, PoseStamped, Point, PointStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:ImportFrom_L7_C0", "label": "from tf import TransformListener, transformations", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0673, 0.0096, 0, 0.66, 0.625, 951, 0, 2, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["TransformListener", "transformations"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf import TransformListener, transformations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:ImportFrom_L8_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0096, 0, 0.66, 0.75, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "label": "Pointmass_Adjust", "type": "class", "loc": [10, 96], "level": 0, "parent": null, "vector": [3, 0, 0.5096, 0.8365, 0, 0.66, 0.875, 409, 0, 4, 0, 0, 0, 0, 27], "semantic": {"name": "Pointmass_Adjust", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Pointmass_Adjust:\n \n pub_marker = True #Set to (True) or to not(False) publish rviz marker showing force vector\n\n mass = 1.0463 #kg 1.0213\n pos_x = 0.0853 #m, in 'l_wrist_roll_link'\n pos_y = 0.0\n pos_z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L12_C4", "label": "pub_marker =", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1154, 0.0096, 1, 0.96, 0.0, 837, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "pub_marker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pub_marker = True #Set to (True) or to not(False) publish rviz marker showing force vector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L14_C4", "label": "mass =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1346, 0.0096, 1, 0.96, 0.0667, 844, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "mass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mass = 1.0463 #kg 1.0213"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L15_C4", "label": "pos_x =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1442, 0.0096, 1, 0.96, 0.1333, 6, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pos_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_x = 0.0853 #m, in 'l_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L16_C4", "label": "pos_y =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1538, 0.0096, 1, 0.96, 0.2, 513, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pos_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_y = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L17_C4", "label": "pos_z =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1635, 0.0096, 1, 0.96, 0.2667, 337, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "pos_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos_z = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L18_C4", "label": "x_force_offset =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1731, 0.0096, 1, 0.96, 0.3333, 216, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "x_force_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_force_offset = 5.62 #5.70 -- These values determined from experiment, used values are adjusted for better qualitative results using rviz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L19_C4", "label": "y_force_offset =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1827, 0.0096, 1, 0.96, 0.4, 759, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_force_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_force_offset = -13.56 #14.10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L20_C4", "label": "z_force_offset =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.1923, 0.0096, 1, 0.96, 0.4667, 842, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "z_force_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_force_offset = 4.30 #-3.88"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L21_C4", "label": "x_torque_offset =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.2019, 0.0096, 1, 0.96, 0.5333, 567, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_torque_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_torque_offset = -0.4025 #0.3899"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L22_C4", "label": "y_torque_offset =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.2115, 0.0096, 1, 0.96, 0.6, 500, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_torque_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_torque_offset = -0.4175 #0.3804"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L23_C4", "label": "z_torque_offset =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.2212, 0.0096, 1, 0.96, 0.6667, 861, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z_torque_offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z_torque_offset = -0.21875"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L24_C4", "label": "adjustment = WrenchStamped()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [14, 1, 0.2308, 0.0096, 1, 0.96, 0.7333, 764, 3, 0, 0, 0, 96, 10, 1], "semantic": {"name": "adjustment", "arg_names": [], "import_names": [], "rhs_call_name": "WrenchStamped", "annotation": ""}, "snippet": " adjustment = WrenchStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [2, 1, 0.274, 0.0577, 1, 0.96, 0.8, 555, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.init_node(\"ft_pointmass_adjustment\")\n rospy.Subscriber(\"netft_data\", WrenchStamped, self.adjust)\n self.ft_out = rospy.Publisher('ft_data_pm_adjusted', WrenchStamped)\n self.force_vec_out = rospy.Publisher('ft_force_vector_marker', Marker)\n self.tfl = TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L27_C8", "label": "init_node()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "vector": [8, 2, 0.2596, 0.0096, 2, 0.5, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(\"ft_pointmass_adjustment\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L28_C8", "label": "Subscriber()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "vector": [8, 2, 0.2692, 0.0096, 2, 0.5, 0.25, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"netft_data\", WrenchStamped, self.adjust)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L29_C8", "label": "self.ft_out = Publisher()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "vector": [14, 2, 0.2788, 0.0096, 2, 0.5, 0.5, 425, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.ft_out", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.ft_out = rospy.Publisher('ft_data_pm_adjusted', WrenchStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L30_C8", "label": "self.force_vec_out = Publisher()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "vector": [14, 2, 0.2885, 0.0096, 2, 0.5, 0.75, 340, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.force_vec_out", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.force_vec_out = rospy.Publisher('ft_force_vector_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L31_C8", "label": "self.tfl = TransformListener()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "vector": [14, 2, 0.2981, 0.0096, 2, 0.5, 1.0, 953, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tfl", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tfl = TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "label": "adjust", "type": "function", "loc": [33, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [2, 1, 0.3846, 0.1442, 1, 0.96, 0.8667, 10, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "adjust", "arg_names": ["self", "ft_in"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def adjust(self, ft_in):\n ft_out = WrenchStamped()\n ft_out.header.stamp = rospy.Time.now()\n ft_out.header.frame_id = ft_in.header.frame_id\n ft_out.wrench.force.x = ft_in.wrench.force.x - self.x_force_offset + self.adjustment.wrench.force.x\n ft_out.wrench.force.y = ft_in.wrench.force.y - self.y_force_offset + self.adjustment.wrench.force.y\n ft_out.wrench.force.z = ft_in.wrench.force.z - self.z_force_offset + self.adjustment.wrench.force.z\n ft_out.wrench.torque.x = ft_in.wrench.torque.x - self.x_torque_offset - self.adjustment.wrench.torque.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L34_C8", "label": "ft_out = WrenchStamped()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3269, 0.0096, 2, 0.14, 0.0, 659, 3, 0, 0, 0, 96, 10, 1], "semantic": {"name": "ft_out", "arg_names": [], "import_names": [], "rhs_call_name": "WrenchStamped", "annotation": ""}, "snippet": " ft_out = WrenchStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L35_C8", "label": "ft_out.header.stamp = now()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3365, 0.0096, 2, 0.14, 0.1, 259, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "ft_out.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " ft_out.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L36_C8", "label": "ft_out.header.frame_id =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3462, 0.0096, 2, 0.14, 0.2, 179, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.header.frame_id = ft_in.header.frame_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L37_C8", "label": "ft_out.wrench.force.x =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3558, 0.0096, 2, 0.14, 0.3, 492, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.wrench.force.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.wrench.force.x = ft_in.wrench.force.x - self.x_force_offset + self.adjustment.wrench.force.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L38_C8", "label": "ft_out.wrench.force.y =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3654, 0.0096, 2, 0.14, 0.4, 916, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.wrench.force.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.wrench.force.y = ft_in.wrench.force.y - self.y_force_offset + self.adjustment.wrench.force.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L39_C8", "label": "ft_out.wrench.force.z =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.375, 0.0096, 2, 0.14, 0.5, 109, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.wrench.force.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.wrench.force.z = ft_in.wrench.force.z - self.z_force_offset + self.adjustment.wrench.force.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L40_C8", "label": "ft_out.wrench.torque.x =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3846, 0.0096, 2, 0.14, 0.6, 411, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.wrench.torque.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.wrench.torque.x = ft_in.wrench.torque.x - self.x_torque_offset - self.adjustment.wrench.torque.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L41_C8", "label": "ft_out.wrench.torque.y =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.3942, 0.0096, 2, 0.14, 0.7, 28, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.wrench.torque.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.wrench.torque.y = ft_in.wrench.torque.y - self.y_torque_offset - self.adjustment.wrench.torque.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L42_C8", "label": "ft_out.wrench.torque.z =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [14, 2, 0.4038, 0.0096, 2, 0.14, 0.8, 676, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ft_out.wrench.torque.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ft_out.wrench.torque.z = ft_in.wrench.torque.z - self.z_torque_offset - self.adjustment.wrench.torque.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L44_C8", "label": "publish()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [8, 2, 0.4231, 0.0096, 2, 0.14, 0.9, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.ft_out.publish(ft_out)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L45_C8", "label": "if", "type": "if", "loc": [45, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "vector": [4, 2, 0.4423, 0.0288, 2, 0.14, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.pub_marker:\n marker = self.form_marker(ft_out)\n self.force_vec_out.publish(marker) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L46_C12", "label": "marker = form_marker()", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L45_C8", "vector": [14, 3, 0.4423, 0.0096, 3, 0.02, 0.0, 864, 3, 1, 0, 0, 280, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "form_marker", "annotation": ""}, "snippet": " marker = self.form_marker(ft_out)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L47_C12", "label": "publish()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L45_C8", "vector": [8, 3, 0.4519, 0.0096, 3, 0.02, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.force_vec_out.publish(marker) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "label": "form_marker", "type": "function", "loc": [49, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [2, 1, 0.5817, 0.2308, 1, 0.96, 0.9333, 280, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "form_marker", "arg_names": ["self", "ws"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def form_marker(self, ws):\n origin = Point()\n force_point = Point()\n force_point.x = 0.1*ws.wrench.force.x\n force_point.y = 0.1*ws.wrench.force.y\n force_point.z = 0.1*ws.wrench.force.z\n force_vec = Marker()\n force_vec.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L50_C8", "label": "origin = Point()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.4808, 0.0096, 2, 0.57, 0.0, 996, 3, 0, 0, 0, 652, 10, 1], "semantic": {"name": "origin", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " origin = Point()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L51_C8", "label": "force_point = Point()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.4904, 0.0096, 2, 0.57, 0.0476, 2, 3, 0, 0, 0, 652, 10, 1], "semantic": {"name": "force_point", "arg_names": [], "import_names": [], "rhs_call_name": "Point", "annotation": ""}, "snippet": " force_point = Point()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L52_C8", "label": "force_point.x =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5, 0.0096, 2, 0.57, 0.0952, 765, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_point.x = 0.1*ws.wrench.force.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L53_C8", "label": "force_point.y =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5096, 0.0096, 2, 0.57, 0.1429, 435, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_point.y = 0.1*ws.wrench.force.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L54_C8", "label": "force_point.z =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5192, 0.0096, 2, 0.57, 0.1905, 848, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "force_point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_point.z = 0.1*ws.wrench.force.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L55_C8", "label": "force_vec = Marker()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5288, 0.0096, 2, 0.57, 0.2381, 819, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "force_vec", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " force_vec = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L56_C8", "label": "force_vec.header.stamp = now()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5385, 0.0096, 2, 0.57, 0.2857, 161, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "force_vec.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " force_vec.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L57_C8", "label": "force_vec.header.frame_id =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5481, 0.0096, 2, 0.57, 0.3333, 981, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "force_vec.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.header.frame_id = '/l_netft_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L58_C8", "label": "force_vec.ns =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5577, 0.0096, 2, 0.57, 0.381, 544, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "force_vec.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.ns = \"ft_sensor\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L59_C8", "label": "force_vec.action =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5673, 0.0096, 2, 0.57, 0.4286, 566, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "force_vec.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.action = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L60_C8", "label": "force_vec.type =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5769, 0.0096, 2, 0.57, 0.4762, 507, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "force_vec.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.type = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L61_C8", "label": "force_vec.scale.x =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5865, 0.0096, 2, 0.57, 0.5238, 693, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_vec.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.scale.x = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L62_C8", "label": "force_vec.scale.y =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.5962, 0.0096, 2, 0.57, 0.5714, 10, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_vec.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.scale.y = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L63_C8", "label": "force_vec.scale.z =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.6058, 0.0096, 2, 0.57, 0.619, 741, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "force_vec.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.scale.z = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L64_C8", "label": "force_vec.color.a =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.6154, 0.0096, 2, 0.57, 0.6667, 851, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_vec.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.color.a = 0.75"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L65_C8", "label": "force_vec.color.r =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.625, 0.0096, 2, 0.57, 0.7143, 833, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_vec.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.color.r = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L66_C8", "label": "force_vec.color.g =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.6346, 0.0096, 2, 0.57, 0.7619, 744, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_vec.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.color.g = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L67_C8", "label": "force_vec.color.b =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.6442, 0.0096, 2, 0.57, 0.8095, 555, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "force_vec.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " force_vec.color.b = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L69_C8", "label": "force_vec.lifetime = Duration()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [14, 2, 0.6635, 0.0096, 2, 0.57, 0.8571, 407, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "force_vec.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " force_vec.lifetime = rospy.Duration(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L70_C8", "label": "append()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [8, 2, 0.6731, 0.0096, 2, 0.57, 0.9048, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_vec.points.append(origin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L71_C8", "label": "append()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [8, 2, 0.6827, 0.0096, 2, 0.57, 0.9524, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " force_vec.points.append(force_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "vector": [13, 2, 0.6923, 0.0096, 2, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return force_vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "label": "calc_adjustment", "type": "function", "loc": [74, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "vector": [2, 1, 0.8173, 0.2212, 1, 0.96, 1.0, 689, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "calc_adjustment", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_adjustment(self):\n try:\n (pos, quat) = self.tfl.lookupTransform('/base_link', '/l_netft_frame', rospy.Time(0))\n except:\n return\n rot = transformations.euler_from_quaternion(quat) \n self.adjustment.wrench.torque.x = self.mass*9.80665*self.pos_x*math.sin(rot[0])\n self.adjustment.wrench.torque.y = self.mass*9.80665*self.pos_x*math.sin(rot[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Try_L75_C8", "label": "try", "type": "try", "loc": [75, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [7, 2, 0.7356, 0.0385, 2, 0.84, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n (pos, quat) = self.tfl.lookupTransform('/base_link', '/l_netft_frame', rospy.Time(0))\n except:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L76_C12", "label": "pos, quat = lookupTransform()", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:Try_L75_C8", "vector": [14, 3, 0.7308, 0.0096, 3, 0.18, 0.0, 375, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "pos, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " (pos, quat) = self.tfl.lookupTransform('/base_link', '/l_netft_frame', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Return_L78_C12", "label": "return", "type": "return", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:Try_L75_C8", "vector": [13, 3, 0.75, 0.0096, 3, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L79_C8", "label": "rot = euler_from_quaternion()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.7596, 0.0096, 2, 0.84, 0.0667, 812, 3, 1, 0, 0, 409, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "euler_from_quaternion", "annotation": ""}, "snippet": " rot = transformations.euler_from_quaternion(quat) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L80_C8", "label": "self.adjustment.wrench.torque.x =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.7692, 0.0096, 2, 0.84, 0.1333, 491, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.adjustment.wrench.torque.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adjustment.wrench.torque.x = self.mass*9.80665*self.pos_x*math.sin(rot[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L81_C8", "label": "self.adjustment.wrench.torque.y =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.7788, 0.0096, 2, 0.84, 0.2, 757, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.adjustment.wrench.torque.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adjustment.wrench.torque.y = self.mass*9.80665*self.pos_x*math.sin(rot[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L82_C8", "label": "self.adjustment.wrench.torque.z =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.7885, 0.0096, 2, 0.84, 0.2667, 672, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.adjustment.wrench.torque.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adjustment.wrench.torque.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L84_C8", "label": "grav = PointStamped()", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8077, 0.0096, 2, 0.84, 0.3333, 935, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "grav", "arg_names": [], "import_names": [], "rhs_call_name": "PointStamped", "annotation": ""}, "snippet": " grav = PointStamped() # Generate a 'vector' of the force due to gravity at the ft sensor "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L85_C8", "label": "grav.header.stamp = Time()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8173, 0.0096, 2, 0.84, 0.4, 16, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "grav.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " grav.header.stamp = rospy.Time(0) #Used to tell tf to grab latest available transform in transformVector3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L86_C8", "label": "grav.header.frame_id =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8269, 0.0096, 2, 0.84, 0.4667, 27, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "grav.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grav.header.frame_id = '/base_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L87_C8", "label": "grav.point.x =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8365, 0.0096, 2, 0.84, 0.5333, 792, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grav.point.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grav.point.x = pos[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L88_C8", "label": "grav.point.y =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8462, 0.0096, 2, 0.84, 0.6, 518, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grav.point.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grav.point.y = pos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L89_C8", "label": "grav.point.z =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8558, 0.0096, 2, 0.84, 0.6667, 192, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "grav.point.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " grav.point.z = pos[2] - 9.80665*self.mass "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L91_C8", "label": "netft_grav = transformPoint()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.875, 0.0096, 2, 0.84, 0.7333, 673, 3, 2, 0, 0, 987, 10, 1], "semantic": {"name": "netft_grav", "arg_names": [], "import_names": [], "rhs_call_name": "transformPoint", "annotation": ""}, "snippet": " netft_grav = self.tfl.transformPoint('/l_netft_frame', grav) #Returns components of the 'gravity force' in each axis of the 'l_netft_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L92_C8", "label": "self.adjustment.wrench.force.x =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8846, 0.0096, 2, 0.84, 0.8, 395, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.adjustment.wrench.force.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adjustment.wrench.force.x = netft_grav.point.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L93_C8", "label": "self.adjustment.wrench.force.y =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.8942, 0.0096, 2, 0.84, 0.8667, 285, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.adjustment.wrench.force.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adjustment.wrench.force.y = netft_grav.point.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L94_C8", "label": "self.adjustment.wrench.force.z =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.9038, 0.0096, 2, 0.84, 0.9333, 107, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.adjustment.wrench.force.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adjustment.wrench.force.z = netft_grav.point.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L96_C8", "label": "self.adjustment.header.stamp = now()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "vector": [14, 2, 0.9231, 0.0096, 2, 0.84, 1.0, 856, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "self.adjustment.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " self.adjustment.header.stamp=rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "label": "if", "type": "if", "loc": [99, 104], "level": 0, "parent": null, "vector": [4, 0, 0.976, 0.0577, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n PMC = Pointmass_Adjust()\n r=rospy.Rate(1000)\n while not rospy.is_shutdown():\n PMC.calc_adjustment()\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L100_C4", "label": "PMC = Pointmass_Adjust()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "vector": [14, 1, 0.9615, 0.0096, 1, 0.92, 0.0, 550, 3, 0, 0, 0, 409, 10, 1], "semantic": {"name": "PMC", "arg_names": [], "import_names": [], "rhs_call_name": "Pointmass_Adjust", "annotation": ""}, "snippet": " PMC = Pointmass_Adjust()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L101_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "vector": [14, 1, 0.9712, 0.0096, 1, 0.92, 0.5, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r=rospy.Rate(1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:While_L102_C4", "label": "while", "type": "while", "loc": [102, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "vector": [5, 1, 0.9904, 0.0288, 1, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n PMC.calc_adjustment()\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L103_C8", "label": "calc_adjustment()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:While_L102_C4", "vector": [8, 2, 0.9904, 0.0096, 2, 0.28, 0.0, 689, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "calc_adjustment", "arg_names": [], "import_names": [], "rhs_call_name": "calc_adjustment", "annotation": ""}, "snippet": " PMC.calc_adjustment()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L104_C8", "label": "sleep()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99219:While_L102_C4", "vector": [8, 2, 1.0, 0.0096, 2, 0.28, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Try_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:Try_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:Try_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Return_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:If_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:While_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:While_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99219:While_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99219:Expr_L104_C8"}] |
#! /usr/bin/python
import roslib; roslib.load_manifest('hrl_pr2_lib')
import rospy
import sensor_msgs.msg as sm
# import planning_environment_msgs.srv as psrv
import arm_navigation_msgs.srv as psrv
import numpy as np
import time
import hrl_pr2_lib.msg as hmsg
class CollisionClient:
def __init__(self, arm):
rospy.Subscriber('contacts_' + arm, hmsg.OnlineContact, self.collision_cb, tcp_nodelay=True)
self.contacted_with_self = [False, None, None]
def collision_cb(self, msg):
for c in msg.contacts:
if c.contact_body_1 == 'points' or c.contact_body_2 == 'points' \
or c.contact_body_1 == None or c.contact_body_2 == None:
continue
else:
self.contacted_with_self = [True, c.contact_body_1, c.contact_body_2]
def check_self_contacts(self):
r = self.contacted_with_self
self.contacted_with_self = [False, None, None]
if r[0] == True:
rospy.loginfo('Contact made between %s and %s.' % (r[1], r[2]))
return r[0]
class CollisionMonitor:
def __init__(self, arm):
rospy.init_node('collision_monitor_' + arm)
self.name_dict = None
link_names = ['_shoulder_pan_joint', '_shoulder_lift_joint',
'_upper_arm_roll_joint', '_elbow_flex_joint',
'_forearm_roll_joint', '_wrist_flex_joint', '_wrist_roll_joint']
self.arm_name = [arm + l for l in link_names]
if arm == 'l':
service_name = 'environment_server_left_arm/get_state_validity'
else:
service_name = 'environment_server_right_arm/get_state_validity'
rospy.loginfo('waiting for ' + service_name)
rospy.wait_for_service(service_name)
self.check_state_validity_client = rospy.ServiceProxy(service_name, \
psrv.GetStateValidity, persistent=True)
rospy.Subscriber('joint_states', sm.JointState, self.joint_state_cb, \
queue_size=5, tcp_nodelay=True)
self.contact_pub = rospy.Publisher('contacts_' + arm, hmsg.OnlineContact)
def joint_state_cb(self, msg):
if self.name_dict == None:
self.name_dict = {}
for i, n in enumerate(msg.name):
self.name_dict[n] = i
arm_indices = [self.name_dict[n] for n in self.arm_name]
arm_list = np.array(msg.position)[arm_indices].tolist()
req = psrv.GetStateValidityRequest()
req.robot_state.joint_state.name = self.arm_name
req.robot_state.joint_state.position = arm_list
req.robot_state.joint_state.header.stamp = rospy.get_rostime()
req.check_collisions = True
res = self.check_state_validity_client(req)
if not (res.error_code.val == res.error_code.SUCCESS):
#contact_with_points = False
#for c in res.contacts:
# if c.contact_body_1 == 'points' or c.contact_body_2 == 'points':
# contact_with_points = True
# else:
# print 'contact between', c.contact_body_1, c.contact_body_2
m = hmsg.OnlineContact()
m.contacts = res.contacts
self.contact_pub.publish(m)
#if not contact_with_points:
# rospy.loginfo('state is in COLLISION')
def call_collision_monitor(arm):
a = CollisionMonitor(arm)
rospy.loginfo('ready')
r = rospy.Rate(10)
while not rospy.is_shutdown():
r.sleep()
def call_get_state_validity():
rospy.init_node('test_get_state_validity')
service_name = 'environment_server_left_arm/get_state_validity'
rospy.loginfo('waiting for ' + service_name)
rospy.wait_for_service(service_name)
check_state_validity_client = rospy.ServiceProxy('environment_server_left_arm/get_state_validity', \
psrv.GetStateValidity, persistent=True)
req = psrv.GetStateValidityRequest()
req.robot_state.joint_state.name = ['l_shoulder_pan_joint', 'l_shoulder_lift_joint',
'l_upper_arm_roll_joint', 'l_elbow_flex_joint',
'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint']
req.robot_state.joint_state.position = 7 * [0.0]
#while not rospy.is_shutdown():
t = time.time()
for i in range(1000):
req.robot_state.joint_state.header.stamp = rospy.get_rostime()
req.check_collisions = True
res = check_state_validity_client(req)
diff = time.time() - t
time_per_call = diff / 1000
print time_per_call, 'rate', 1 / time_per_call
#if res.error_code.val == res.error_code.SUCCESS:
# rospy.loginfo('state is NOT in collision')
#else:
# rospy.loginfo('state is in collision')
if __name__ == '__main__':
import sys
call_collision_monitor(sys.argv[1])
#call_get_state_validity()
| ajibawa-2023/Python-Code-Large/train/row_99220 | 79 | 189 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0053, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0106, 0.0053, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L3_C0", "label": "rospy import rospy", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0053, 0, 0.66, 0.1667, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L5_C0", "label": "sensor_msgs.msg import sm", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0265, 0.0053, 0, 0.66, 0.25, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["sm"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sensor_msgs.msg as sm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L7_C0", "label": "arm_navigation_msgs.srv import psrv", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0053, 0, 0.66, 0.3333, 314, 0, 1, 0, 0, 314, 0, 0], "semantic": {"name": "arm_navigation_msgs.srv", "arg_names": [], "import_names": ["psrv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import arm_navigation_msgs.srv as psrv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0053, 0, 0.66, 0.4167, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L9_C0", "label": "time import time", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0053, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L10_C0", "label": "hrl_pr2_lib.msg import hmsg", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0529, 0.0053, 0, 0.66, 0.5833, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "hrl_pr2_lib.msg", "arg_names": [], "import_names": ["hmsg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_pr2_lib.msg as hmsg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "label": "CollisionClient", "type": "class", "loc": [13, 31], "level": 0, "parent": null, "vector": [3, 0, 0.1164, 0.1005, 0, 0.66, 0.6667, 426, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "CollisionClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CollisionClient:\n def __init__(self, arm):\n rospy.Subscriber('contacts_' + arm, hmsg.OnlineContact, self.collision_cb, tcp_nodelay=True)\n self.contacted_with_self = [False, None, None]\n\n def collision_cb(self, msg):\n for c in msg.contacts:\n if c.contact_body_1 == 'points' or c.contact_body_2 == 'points' \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L14_C4", "label": "__init__", "type": "function", "loc": [14, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "vector": [2, 1, 0.0794, 0.0159, 1, 0.18, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n rospy.Subscriber('contacts_' + arm, hmsg.OnlineContact, self.collision_cb, tcp_nodelay=True)\n self.contacted_with_self = [False, None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L15_C8", "label": "Subscriber()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L14_C4", "vector": [8, 2, 0.0794, 0.0053, 2, 0.14, 0.0, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('contacts_' + arm, hmsg.OnlineContact, self.collision_cb, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L16_C8", "label": "self.contacted_with_self =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L14_C4", "vector": [14, 2, 0.0847, 0.0053, 2, 0.14, 1.0, 506, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.contacted_with_self", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contacted_with_self = [False, None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L18_C4", "label": "collision_cb", "type": "function", "loc": [18, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "vector": [2, 1, 0.1111, 0.037, 1, 0.18, 0.5, 703, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "collision_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def collision_cb(self, msg):\n for c in msg.contacts:\n if c.contact_body_1 == 'points' or c.contact_body_2 == 'points' \\\n or c.contact_body_1 == None or c.contact_body_2 == None:\n continue\n else:\n self.contacted_with_self = [True, c.contact_body_1, c.contact_body_2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L19_C8", "label": "for c", "type": "for", "loc": [19, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L18_C4", "vector": [6, 2, 0.1138, 0.0317, 2, 0.41, 0.0, 411, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for c in msg.contacts:\n if c.contact_body_1 == 'points' or c.contact_body_2 == 'points' \\\n or c.contact_body_1 == None or c.contact_body_2 == None:\n continue\n else:\n self.contacted_with_self = [True, c.contact_body_1, c.contact_body_2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L20_C12", "label": "if", "type": "if", "loc": [20, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L19_C8", "vector": [4, 3, 0.1164, 0.0265, 3, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if c.contact_body_1 == 'points' or c.contact_body_2 == 'points' \\\n or c.contact_body_1 == None or c.contact_body_2 == None:\n continue\n else:\n self.contacted_with_self = [True, c.contact_body_1, c.contact_body_2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L24_C16", "label": "self.contacted_with_self =", "type": "assigned_variable", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L20_C12", "vector": [14, 4, 0.127, 0.0053, 4, 0.33, 0.0, 506, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.contacted_with_self", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contacted_with_self = [True, c.contact_body_1, c.contact_body_2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "label": "check_self_contacts", "type": "function", "loc": [26, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "vector": [2, 1, 0.1508, 0.0317, 1, 0.18, 1.0, 141, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "check_self_contacts", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def check_self_contacts(self):\n r = self.contacted_with_self\n self.contacted_with_self = [False, None, None]\n if r[0] == True:\n rospy.loginfo('Contact made between %s and %s.' % (r[1], r[2]))\n return r[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L27_C8", "label": "r =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "vector": [14, 2, 0.1429, 0.0053, 2, 0.49, 0.0, 436, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = self.contacted_with_self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L28_C8", "label": "self.contacted_with_self =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "vector": [14, 2, 0.1481, 0.0053, 2, 0.49, 0.3333, 506, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.contacted_with_self", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contacted_with_self = [False, None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L29_C8", "label": "if", "type": "if", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "vector": [4, 2, 0.1561, 0.0106, 2, 0.49, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if r[0] == True:\n rospy.loginfo('Contact made between %s and %s.' % (r[1], r[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L30_C12", "label": "loginfo()", "type": "expression", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L29_C8", "vector": [8, 3, 0.1587, 0.0053, 3, 0.29, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Contact made between %s and %s.' % (r[1], r[2]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "vector": [13, 2, 0.164, 0.0053, 2, 0.49, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L34_C0", "label": "CollisionMonitor", "type": "class", "loc": [34, 82], "level": 0, "parent": null, "vector": [3, 0, 0.3069, 0.2593, 0, 0.66, 0.75, 252, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "CollisionMonitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CollisionMonitor:\n def __init__(self, arm):\n rospy.init_node('collision_monitor_' + arm)\n self.name_dict = None\n link_names = ['_shoulder_pan_joint', '_shoulder_lift_joint',\n '_upper_arm_roll_joint', '_elbow_flex_joint',\n '_forearm_roll_joint', '_wrist_flex_joint', '_wrist_roll_joint']\n self.arm_name = [arm + l for l in link_names]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "label": "__init__", "type": "function", "loc": [35, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L34_C0", "vector": [2, 1, 0.2381, 0.1111, 1, 0.52, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arm):\n rospy.init_node('collision_monitor_' + arm)\n self.name_dict = None\n link_names = ['_shoulder_pan_joint', '_shoulder_lift_joint',\n '_upper_arm_roll_joint', '_elbow_flex_joint',\n '_forearm_roll_joint', '_wrist_flex_joint', '_wrist_roll_joint']\n self.arm_name = [arm + l for l in link_names]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L36_C8", "label": "init_node()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [8, 2, 0.1905, 0.0053, 2, 0.83, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('collision_monitor_' + arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L37_C8", "label": "self.name_dict =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [14, 2, 0.1958, 0.0053, 2, 0.83, 0.1111, 409, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L38_C8", "label": "link_names =", "type": "assigned_variable", "loc": [38, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [14, 2, 0.2063, 0.0159, 2, 0.83, 0.2222, 788, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "link_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " link_names = ['_shoulder_pan_joint', '_shoulder_lift_joint',\n '_upper_arm_roll_joint', '_elbow_flex_joint',\n '_forearm_roll_joint', '_wrist_flex_joint', '_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L41_C8", "label": "self.arm_name =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [14, 2, 0.2169, 0.0053, 2, 0.83, 0.3333, 811, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arm_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_name = [arm + l for l in link_names]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L43_C8", "label": "if", "type": "if", "loc": [43, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [4, 2, 0.2354, 0.0212, 2, 0.83, 0.4444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 'l':\n service_name = 'environment_server_left_arm/get_state_validity'\n else:\n service_name = 'environment_server_right_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L44_C12", "label": "service_name =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L43_C8", "vector": [14, 3, 0.2328, 0.0053, 3, 0.26, 0.0, 649, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_name = 'environment_server_left_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L46_C12", "label": "service_name =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L43_C8", "vector": [14, 3, 0.2434, 0.0053, 3, 0.26, 1.0, 649, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_name = 'environment_server_right_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L49_C8", "label": "loginfo()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [8, 2, 0.2593, 0.0053, 2, 0.83, 0.5556, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('waiting for ' + service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L50_C8", "label": "wait_for_service()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [8, 2, 0.2646, 0.0053, 2, 0.83, 0.6667, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L51_C8", "label": "self.check_state_validity_client = ServiceProxy()", "type": "assigned_variable", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [14, 2, 0.2725, 0.0106, 2, 0.83, 0.7778, 656, 3, 3, 0, 0, 915, 10, 1], "semantic": {"name": "self.check_state_validity_client", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " self.check_state_validity_client = rospy.ServiceProxy(service_name, \\\n psrv.GetStateValidity, persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L53_C8", "label": "Subscriber()", "type": "expression", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [8, 2, 0.2831, 0.0106, 2, 0.83, 0.8889, 455, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('joint_states', sm.JointState, self.joint_state_cb, \\\n queue_size=5, tcp_nodelay=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L55_C8", "label": "self.contact_pub = Publisher()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "vector": [14, 2, 0.291, 0.0053, 2, 0.83, 1.0, 824, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.contact_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.contact_pub = rospy.Publisher('contacts_' + arm, hmsg.OnlineContact)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "label": "joint_state_cb", "type": "function", "loc": [57, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L34_C0", "vector": [2, 1, 0.3677, 0.1376, 1, 0.52, 1.0, 340, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "joint_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_state_cb(self, msg):\n if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i \n\n arm_indices = [self.name_dict[n] for n in self.arm_name]\n arm_list = np.array(msg.position)[arm_indices].tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L58_C8", "label": "if", "type": "if", "loc": [58, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [4, 2, 0.3148, 0.0212, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.name_dict == None:\n self.name_dict = {}\n for i, n in enumerate(msg.name):\n self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L59_C12", "label": "self.name_dict =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L58_C8", "vector": [14, 3, 0.3122, 0.0053, 3, 0.59, 0.0, 409, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.name_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L60_C12", "label": "for i, n", "type": "for", "loc": [60, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L58_C8", "vector": [6, 3, 0.3201, 0.0106, 3, 0.59, 1.0, 217, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i, n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, n in enumerate(msg.name):\n self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L61_C16", "label": "assign", "type": "assigned_variable", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L60_C12", "vector": [14, 4, 0.3228, 0.0053, 4, 0.48, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name_dict[n] = i "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L63_C8", "label": "arm_indices =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3333, 0.0053, 2, 0.28, 0.1111, 133, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_indices = [self.name_dict[n] for n in self.arm_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L64_C8", "label": "arm_list = tolist()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3386, 0.0053, 2, 0.28, 0.2222, 164, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "arm_list", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " arm_list = np.array(msg.position)[arm_indices].tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L66_C8", "label": "req = GetStateValidityRequest()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3492, 0.0053, 2, 0.28, 0.3333, 233, 3, 0, 0, 0, 4, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetStateValidityRequest", "annotation": ""}, "snippet": " req = psrv.GetStateValidityRequest() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L67_C8", "label": "req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3545, 0.0053, 2, 0.28, 0.4444, 525, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.name = self.arm_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L68_C8", "label": "req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3598, 0.0053, 2, 0.28, 0.5556, 249, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position = arm_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L69_C8", "label": "req.robot_state.joint_state.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3651, 0.0053, 2, 0.28, 0.6667, 1, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "req.robot_state.joint_state.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " req.robot_state.joint_state.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L70_C8", "label": "req.check_collisions =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3704, 0.0053, 2, 0.28, 0.7778, 373, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "req.check_collisions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.check_collisions = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L71_C8", "label": "res = check_state_validity_client()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [14, 2, 0.3757, 0.0053, 2, 0.28, 0.8889, 413, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "check_state_validity_client", "annotation": ""}, "snippet": " res = self.check_state_validity_client(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "label": "if", "type": "if", "loc": [72, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "vector": [4, 2, 0.4074, 0.0582, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (res.error_code.val == res.error_code.SUCCESS):\n #contact_with_points = False\n #for c in res.contacts:\n # if c.contact_body_1 == 'points' or c.contact_body_2 == 'points':\n # contact_with_points = True\n # else:\n # print 'contact between', c.contact_body_1, c.contact_body_2\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L80_C12", "label": "m = OnlineContact()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "vector": [14, 3, 0.4233, 0.0053, 3, 0.34, 0.0, 711, 3, 0, 0, 0, 593, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "OnlineContact", "annotation": ""}, "snippet": " m = hmsg.OnlineContact()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L81_C12", "label": "m.contacts =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "vector": [14, 3, 0.4286, 0.0053, 3, 0.34, 0.5, 178, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.contacts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.contacts = res.contacts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L82_C12", "label": "publish()", "type": "expression", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "vector": [8, 3, 0.4339, 0.0053, 3, 0.34, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.contact_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "label": "call_collision_monitor", "type": "function", "loc": [87, 92], "level": 0, "parent": null, "vector": [2, 0, 0.4735, 0.0317, 0, 0.66, 0.8333, 182, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "call_collision_monitor", "arg_names": ["arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def call_collision_monitor(arm):\n a = CollisionMonitor(arm)\n rospy.loginfo('ready')\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L88_C4", "label": "a = CollisionMonitor()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "vector": [14, 1, 0.4656, 0.0053, 1, 0.83, 0.0, 475, 3, 1, 0, 0, 252, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "CollisionMonitor", "annotation": ""}, "snippet": " a = CollisionMonitor(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L89_C4", "label": "loginfo()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "vector": [8, 1, 0.4709, 0.0053, 1, 0.83, 0.3333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L90_C4", "label": "r = Rate()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "vector": [14, 1, 0.4762, 0.0053, 1, 0.83, 0.6667, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:While_L91_C4", "label": "while", "type": "while", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "vector": [5, 1, 0.4841, 0.0106, 1, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L92_C8", "label": "sleep()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:While_L91_C4", "vector": [8, 2, 0.4868, 0.0053, 2, 0.89, 0.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "label": "call_get_state_validity", "type": "function", "loc": [94, 115], "level": 0, "parent": null, "vector": [2, 0, 0.5529, 0.1164, 0, 0.66, 0.9167, 865, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "call_get_state_validity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def call_get_state_validity():\n rospy.init_node('test_get_state_validity')\n service_name = 'environment_server_left_arm/get_state_validity'\n rospy.loginfo('waiting for ' + service_name)\n rospy.wait_for_service(service_name)\n check_state_validity_client = rospy.ServiceProxy('environment_server_left_arm/get_state_validity', \\\n psrv.GetStateValidity, persistent=True)\n req = psrv.GetStateValidityRequest() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L95_C4", "label": "init_node()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [8, 1, 0.5026, 0.0053, 1, 0.83, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('test_get_state_validity')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L96_C4", "label": "service_name =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.5079, 0.0053, 1, 0.83, 0.0833, 649, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_name = 'environment_server_left_arm/get_state_validity'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L97_C4", "label": "loginfo()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [8, 1, 0.5132, 0.0053, 1, 0.83, 0.1667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('waiting for ' + service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L98_C4", "label": "wait_for_service()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [8, 1, 0.5185, 0.0053, 1, 0.83, 0.25, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L99_C4", "label": "check_state_validity_client = ServiceProxy()", "type": "assigned_variable", "loc": [99, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.5265, 0.0106, 1, 0.83, 0.3333, 816, 3, 3, 0, 0, 915, 10, 1], "semantic": {"name": "check_state_validity_client", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " check_state_validity_client = rospy.ServiceProxy('environment_server_left_arm/get_state_validity', \\\n psrv.GetStateValidity, persistent=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L101_C4", "label": "req = GetStateValidityRequest()", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.5344, 0.0053, 1, 0.83, 0.4167, 233, 3, 0, 0, 0, 4, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "GetStateValidityRequest", "annotation": ""}, "snippet": " req = psrv.GetStateValidityRequest() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L102_C4", "label": "req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [102, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.545, 0.0159, 1, 0.83, 0.5, 525, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.name = ['l_shoulder_pan_joint', 'l_shoulder_lift_joint',\n 'l_upper_arm_roll_joint', 'l_elbow_flex_joint',\n 'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L105_C4", "label": "req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.5556, 0.0053, 1, 0.83, 0.5833, 249, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.robot_state.joint_state.position = 7 * [0.0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L108_C4", "label": "t = time()", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.5714, 0.0053, 1, 0.83, 0.6667, 15, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " t = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "label": "for i", "type": "for", "loc": [109, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [6, 1, 0.5847, 0.0212, 1, 0.83, 0.75, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1000):\n req.robot_state.joint_state.header.stamp = rospy.get_rostime()\n req.check_collisions = True\n res = check_state_validity_client(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L110_C8", "label": "req.robot_state.joint_state.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "vector": [14, 2, 0.582, 0.0053, 2, 0.39, 0.0, 1, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "req.robot_state.joint_state.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " req.robot_state.joint_state.header.stamp = rospy.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L111_C8", "label": "req.check_collisions =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "vector": [14, 2, 0.5873, 0.0053, 2, 0.39, 0.5, 373, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "req.check_collisions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " req.check_collisions = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L112_C8", "label": "res = check_state_validity_client()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "vector": [14, 2, 0.5926, 0.0053, 2, 0.39, 1.0, 413, 3, 1, 0, 0, 816, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "check_state_validity_client", "annotation": ""}, "snippet": " res = check_state_validity_client(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L113_C4", "label": "diff =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.5979, 0.0053, 1, 0.83, 0.8333, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = time.time() - t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L114_C4", "label": "time_per_call =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [14, 1, 0.6032, 0.0053, 1, 0.83, 0.9167, 652, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_per_call", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_per_call = diff / 1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L115_C4", "label": "print()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "vector": [8, 1, 0.6085, 0.0053, 1, 0.83, 1.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(time_per_call, 'rate', 1 / time_per_call)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L122_C0", "label": "if", "type": "if", "loc": [122, 124], "level": 0, "parent": null, "vector": [4, 0, 0.6508, 0.0159, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n call_collision_monitor(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L123_C4", "label": "sys import sys", "type": "import", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L122_C0", "vector": [1, 1, 0.6508, 0.0053, 1, 0.49, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L124_C4", "label": "call_collision_monitor()", "type": "expression", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L122_C0", "vector": [8, 1, 0.6561, 0.0053, 1, 0.49, 1.0, 182, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "call_collision_monitor", "arg_names": [], "import_names": [], "rhs_call_name": "call_collision_monitor", "annotation": ""}, "snippet": " call_collision_monitor(sys.argv[1])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L20_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L60_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:While_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:While_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:For_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Import_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99220:If_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99220:Expr_L124_C4"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
import numpy as np
import itertools as it
import functools as ft
import time
class Dataset:
def __init__(self, inputs, outputs):
"""
inputs coded as numpy array, column vectors
outputs also as numpy array, column vectors
"""
self.inputs = inputs
self.outputs = outputs
assert(inputs.shape[1] == outputs.shape[1])
def num_examples(self):
return self.inputs.shape[1]
def num_attributes(self):
return self.inputs.shape[0]
def split_continuous(self, attribute, split_point):
selected_attribute = self.inputs[attribute, :]
leq_bool = selected_attribute <= split_point
_, leq_col = np.where(leq_bool)
#print 'leq_col', leq_col
if leq_col.shape[1] > 0:
leq_dataset = Dataset(self.inputs[:, leq_col.A[0]], self.outputs[:, leq_col.A[0]])
else:
leq_dataset = Dataset(np.matrix([]), np.matrix([]))
_, gt_col = np.where(~leq_bool)
if gt_col.shape[1] > 0:
gt_dataset = Dataset(self.inputs[:, gt_col.A[0]], self.outputs[:, gt_col.A[0]])
else:
gt_dataset = Dataset(np.matrix([]), np.matrix([]))
ret_sets = []
if leq_dataset.num_examples() > 0:
ret_sets.append(leq_dataset)
if gt_dataset.num_examples() > 0:
ret_sets.append(gt_dataset)
return ret_sets
def unique_values(self, attribute_number, set='input'):
if set == 'input':
examples = self.inputs
else:
examples = self.outputs
values = dict()
for instance_idx in xrange(examples.shape[1]):
values[examples[attribute_number, instance_idx]] = True
k = values.keys()
k.sort()
return k
def bootstrap_samples(self, number_samples, points_per_sample):
for i in xrange(number_samples):
selected_pts = np.random.randint(0, self.inputs.shape[1], points_per_sample)
selected_inputs = self.inputs[:, selected_pts]
selected_outputs = self.outputs[:, selected_pts]
#print 'Dataset.bootstrap count', i
yield Dataset(selected_inputs, selected_outputs)
def entropy_discrete(self):
values = self.unique_values(0, 'output')
#print 'entropy_discrete: values', values
#for each output class calculate
def calc_class_entropy(value):
number_in_class = np.sum(self.outputs[0,:] == value)
percentage_in_class = (number_in_class / float(self.num_examples()))
return -percentage_in_class * np.log2(percentage_in_class)
return np.sum(map(calc_class_entropy, values))
def append(self, another_dataset):
self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)
self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)
class LinearDimReduceDataset(Dataset):
def __init__(self, inputs, outputs):
Dataset.__init__(self, inputs, outputs)
def set_projection_vectors(self, vec):
'''
projection vectors are assumed to be columnwise
'''
self.projection_basis = vec
print 'LinearDimReduceDataset: projection_basis', vec.shape
def reduce(self, data_points):
return self.projection_basis.T * data_points
def reduce_input(self):
'''
reduce dimensionality of this dataset
'''
self.inputs = self.projection_basis.T * self.inputs
def binary_less_than(attribute, threshold, input_vec):
return input_vec[attribute,0] <= threshold
def binary_greater_than(attribute, threshold, input_vec):
return input_vec[attribute,0] > threshold
def create_binary_tests(attribute, threshold):
return [ft.partial(binary_less_than, attribute, threshold),
ft.partial(binary_greater_than, attribute, threshold)]
def mode_exhaustive(set):
'''
Finds the mode of a given set
'''
#Count, store in dictionary
mdict = dict()
for s in set:
has_stored = False
for k in mdict.keys():
if k == s:
mdict[k] = 1+mdict[k]
has_stored = True
if not has_stored:
mdict[s] = 1
#Find the key with maximum votes
max_key = None
max_count = -1
for k in mdict.keys():
if mdict[k] > max_count:
max_key = k
max_count = mdict[k]
#print 'mode_exhaustive: ', mdict
return max_key, mdict
def min_entropy_split(dataset):
'''
Find the split that produces subsets with the minimum combined entropy
return splitting attribute & splitting point for that attribute
'''
#print 'in min_entropy_split'
# Assume inputs are continuous, and are column vectors.
hypotheses = []
entropies = []
# For each attribute find the best split point.
for attribute in xrange(dataset.num_attributes()):
values = dataset.unique_values(attribute)
#Iterate over the possible values of split & calculate entropy for each split.
for split_point in values:
def calc_entropy(data_set):
num_points = data_set.num_examples()
return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()
split_entropy = map(calc_entropy, dataset.split_continuous(attribute, split_point))
hypotheses.append((attribute, split_point))
entropies.append(sum(split_entropy))
# Select the attribute split pair that has the lowest entropy.
entropies = np.matrix(entropies)
min_idx = np.argmin(entropies)
return hypotheses[min_idx]
def random_subset(subset_size, total_size):
#print 'in random_subset'
assert(subset_size <= total_size)
occupancy = np.matrix(np.zeros((1, total_size)))
while occupancy.sum() < subset_size:
occupancy[0, np.random.randint(0, total_size)] = 1
rows, columns = np.where(occupancy > 0)
return columns.A[0]
def split_random_subset(subset_size, total_size):
assert(subset_size <= total_size)
occupancy = np.matrix(np.zeros((1, total_size)))
while occupancy.sum() < subset_size:
occupancy[0, np.random.randint(0, total_size)] = 1
bool_sel = occupancy > 0
rows, columns_subset = np.where(bool_sel)
rows, columns_remaining = np.where(np.invert(bool_sel))
return columns_subset.A[0], columns_remaining.A[0]
def random_subset_split(num_subset, dataset):
''' splitter in decision tree '''
#print 'in random_subset_split'
#print 'num_subset', num_subset, dataset, 'dataset.input.shape', dataset.inputs.shape
subset_indexes = random_subset(num_subset, dataset.num_attributes())
sub_dataset = Dataset(dataset.inputs[subset_indexes,:], dataset.outputs)
attribute, point = min_entropy_split(sub_dataset)
return subset_indexes[attribute], point
def totally_random_split(dataset):
#print 'totally random'
attr = np.random.randint(0, dataset.num_attributes())
split_pt = dataset.inputs[attr, np.random.randint(0, dataset.num_examples())]
return attr, split_pt
class DecisionTree:
def __init__(self, dataset=None, splitting_func=min_entropy_split):
self.children = None
self.prediction = None
if dataset is not None:
self.train(dataset, splitting_func=splitting_func)
def train(self, dataset, splitting_func=min_entropy_split):
if not self.make_leaf(dataset):
#print 'in train.splitting', dataset.num_examples()
self.split_attribute, self.split_point = splitting_func(dataset)
#print 'self.split_attribute, self.split_point', self.split_attribute, self.split_point
data_sets = dataset.split_continuous(self.split_attribute, self.split_point)
if len(data_sets) < 2:
self.prediction = dataset.outputs
return
def tree_split(set):
#print 'tree', set.num_examples()
return DecisionTree(set, splitting_func=splitting_func)
# Create & train child decision nodes
tests = create_binary_tests(self.split_attribute, self.split_point)
self.children = zip(tests, map(tree_split, data_sets))
def make_leaf(self, dataset):
if np.all(dataset.outputs[:,0] == dataset.outputs):
self.prediction = dataset.outputs[:,0]
#print 'leaf'
return True
elif np.all(dataset.inputs[:,0] == dataset.inputs):
self.prediction = dataset.outputs
#print 'leaf'
return True
else:
return False
def predict(self, input):
if self.prediction is not None:
return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]
else:
for test, child in self.children:
if test(input):
return child.predict(input)
raise RuntimeError("DecisionTree: splits not exhaustive, unable to split for input" + str(input.T))
class RFBase:
def __init__(self, dataset=None, number_of_dimensions=None, number_of_learners=100):
"""
number_of_dimensions unclear which direction, but should be around 10-20% of original
data dimension
number_of_learners limited by processor performance, higher is better
"""
self.number_of_learners = number_of_learners
self.number_of_dimensions = number_of_dimensions
if dataset != None:
self.train(dataset)
def predict(self, data, vote_combine_function=None):
def predict_(learner):
return learner.predict(learner.transform_input(data))
predictions = map(predict_,self.learners)
if vote_combine_function is not None:
return vote_combine_function(predictions)
else:
return mode_exhaustive(predictions)
def train(self, dataset):
pass
def identity(x):
return x
class RFBreiman(RFBase):
def train(self, dataset):
def train_trees(examples_subset):
tree = DecisionTree()
#tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))
tree.train(examples_subset, splitting_func=totally_random_split)
#use identity function
tree.transform_input = identity
return tree
if self.number_of_dimensions == None:
self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)
points_per_sample = dataset.num_examples() * 1.0 / 3.0
self.learners = map(train_trees, dataset.bootstrap_samples(self.number_of_learners, points_per_sample))
class RFRandomInputSubset(RFBase):
def train(self, dataset):
def train_trees(examples_subset):
#select a subset of dimensions
dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())
subset_input = examples_subset.inputs[dims, :]
reduced_sample = Dataset(subset_input, examples_subset.outputs)
tree = DecisionTree(reduced_sample)
tree.dimensions_subset = dims
def transform_input(input):
return input[dims, :]
tree.transform_input = transform_input
return tree
if self.number_of_dimensions == None:
self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)
points_per_sample = dataset.num_examples() * 1.0 / 3.0
self.learners = map(train_trees, dataset.bootstrap_samples(self.number_of_learners, points_per_sample))
def evaluate_classifier(building_func, data, times=10.0, percentage=None, extra_args={}, test_pca=False):
'''
Evaluate classifier by dividing dataset into training and test set.
@param building_func Function that will build classifier given data and args in extra_args.
@param data Dataset to use for evaluation/training.
@param times The number of bootstrap samples to take.
@param percentage The percentage of data to use for training.
@param extra_args Extra arguments to pass to building_func.
'''
print 'evaluate_classifier: extra_args', extra_args
total_pts = data.num_examples()
testing_errors = []
training_errors = []
build_times = []
classification_times = []
for i in range(times):
if percentage == None:
percentage = (i+1)/times
num_examples = int(round(total_pts*percentage))
print 'Evaluate classifier built with', percentage*100, '% data, num examples', num_examples
subset, unselected = split_random_subset(num_examples, total_pts)
i = data.inputs[:, subset]
o = data.outputs[:, subset]
print "Building classifier..."
if test_pca:
print ' TESTING PCA'
import dimreduce as dr
subseted_dataset = LinearDimReduceDataset(i,o)
subseted_dataset.set_projection_vectors(dr.pca_vectors(subseted_dataset.inputs, percent_variance=.95))
subseted_dataset.reduce_input()
print 'subseted_dataset.num_attributes(), subseted_dataset.num_examples()', subseted_dataset.num_attributes(), subseted_dataset.num_examples()
else:
subseted_dataset = Dataset(i,o)
start_time = time.time()
classifier = building_func(subseted_dataset, **extra_args)
build_times.append(time.time() - start_time)
print "done building..."
##########################################
#Classify training set
##########################################
count_selected = []
for i, idx in enumerate(subset):
start_time = time.time()
if test_pca:
prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))
else:
prediction, _ = classifier.predict(data.inputs[:,idx])
classification_times.append(time.time() - start_time)
true_val = data.outputs[:,idx]
if prediction == true_val:
count_selected.append(1)
else:
count_selected.append(0)
if i%100 == 0:
print i
count_selected = np.matrix(count_selected)
##########################################
#Classify testing set
##########################################
confusion_matrix = dict()
count_unselected = []
print 'Total points', total_pts
for idx in unselected:
start_time = time.time()
if test_pca:
prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))
else:
prediction, _ = classifier.predict(data.inputs[:,idx])
classification_times.append(time.time() - start_time)
true_val = data.outputs[:,idx]
if prediction == true_val:
count_unselected.append(1)
else:
count_unselected.append(0)
if confusion_matrix.has_key(true_val[0,0]):
if confusion_matrix[true_val[0,0]].has_key(prediction[0,0]):
confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1
else:
confusion_matrix[true_val[0,0]][prediction[0,0]] = 1
else:
confusion_matrix[true_val[0,0]] = dict()
confusion_matrix[true_val[0,0]][prediction[0,0]] = 1
training_error = 100.0 * np.sum(count_selected) / float(len(subset))
testing_error = 100.0 * np.sum(count_unselected) / float(len(unselected))
testing_errors.append(testing_error)
training_errors.append(training_error)
print 'Correct on training set', training_error, '%'
print ' on testing set', testing_error, '%'
print 'Confusion'
for k in confusion_matrix.keys():
sum = 0.0
for k2 in confusion_matrix[k]:
sum = sum + confusion_matrix[k][k2]
for k2 in confusion_matrix[k]:
print 'true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time'
def print_stats(name, list_data):
m = np.matrix(list_data)
print '%s: average %f std %f' % (name, m.mean(), np.std(m))
print_stats('training error', training_errors)
print_stats('testing error', testing_errors)
print_stats('build time', build_times)
print_stats('classification time', classification_times)
if __name__ == '__main__':
test_iris = False
test_pickle = True
test_number_trees = False
test_pca = False
if test_iris:
#Setup for repeated testing
iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))
inputs = np.float32(iris_array[:, 0:4]).T
outputs = iris_array[:, 4].T
dataset = Dataset(inputs, outputs)
print '================================'
print "Test DecisionTree"
evaluate_classifier(DecisionTree, dataset, 5, .9)
print '================================'
#print "Test random forest"
#for i in range(4):
# #print "Test RFRandomInputSubset"
# #evaluate_classifier(RFRandomInputSubset, dataset, 1, .7)
# print "Test RFBreiman"
# evaluate_classifier(RFEntropySplitRandomInputSubset, dataset, 1, .7)
if test_pickle:
import pickle as pk
def load_pickle(filename):
p = open(filename, 'r')
picklelicious = pk.load(p)
p.close()
return picklelicious
def print_separator(times=2):
for i in xrange(times):
print '==============================================================='
dataset = load_pickle('PatchClassifier.dataset.pickle')
#if test_pca:
# print_separator(1)
# print_separator(1)
# dataset.reduce_input()
if test_number_trees:
tree_types = [RFBreiman, RFRandomInputSubset]
#tree_types = [RFBreiman]
for tree_type in tree_types:
print_separator()
print 'Testing', tree_type
for i in range(10):
print tree_type, 'using', (i+1)*10, 'trees'
evaluate_classifier(tree_type, dataset, 3, .95,
extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)
else:
tree_types = [RFBreiman, RFRandomInputSubset]
#tree_types = [RFRandomInputSubset]
for tree_type in tree_types:
print_separator()
print tree_type
evaluate_classifier(tree_type, dataset, 10, .95,
extra_args={'number_of_learners': 70}, test_pca=test_pca)
| ajibawa-2023/Python-Code-Large/train/row_99223 | 327 | 505 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L29_C0", "label": "numpy import np", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0574, 0.002, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L30_C0", "label": "itertools import it", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0594, 0.002, 0, 0.66, 0.0476, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["it"], "rhs_call_name": "", "annotation": ""}, "snippet": "import itertools as it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L31_C0", "label": "functools import ft", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0614, 0.002, 0, 0.66, 0.0952, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["ft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import functools as ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L32_C0", "label": "time import time", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0634, 0.002, 0, 0.66, 0.1429, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "label": "Dataset", "type": "class", "loc": [34, 107], "level": 0, "parent": null, "vector": [3, 0, 0.1396, 0.1465, 0, 0.66, 0.1905, 957, 0, 9, 0, 0, 0, 0, 30], "semantic": {"name": "Dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Dataset:\n def __init__(self, inputs, outputs):\n \"\"\"\n inputs coded as numpy array, column vectors\n outputs also as numpy array, column vectors\n \"\"\"\n self.inputs = inputs\n self.outputs = outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "label": "__init__", "type": "function", "loc": [35, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.0762, 0.0158, 1, 0.23, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "inputs", "outputs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, inputs, outputs):\n \"\"\"\n inputs coded as numpy array, column vectors\n outputs also as numpy array, column vectors\n \"\"\"\n self.inputs = inputs\n self.outputs = outputs\n assert(inputs.shape[1] == outputs.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L36_C8", "label": "expression", "type": "expression", "loc": [36, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "vector": [8, 2, 0.0743, 0.0079, 2, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n inputs coded as numpy array, column vectors\n outputs also as numpy array, column vectors\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L40_C8", "label": "self.inputs =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "vector": [14, 2, 0.0792, 0.002, 2, 0.68, 0.5, 646, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.inputs = inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L41_C8", "label": "self.outputs =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "vector": [14, 2, 0.0812, 0.002, 2, 0.68, 1.0, 88, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.outputs = outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L44_C4", "label": "num_examples", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.0881, 0.004, 1, 0.23, 0.1429, 12, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "num_examples", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def num_examples(self):\n return self.inputs.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L45_C8", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L44_C4", "vector": [13, 2, 0.0891, 0.002, 2, 0.63, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.inputs.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L47_C4", "label": "num_attributes", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.0941, 0.004, 1, 0.23, 0.2857, 271, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "num_attributes", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def num_attributes(self):\n return self.inputs.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L47_C4", "vector": [13, 2, 0.095, 0.002, 2, 0.04, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.inputs.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "label": "split_continuous", "type": "function", "loc": [50, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.1208, 0.0455, 1, 0.23, 0.4286, 193, 0, 3, 1, 0, 0, 0, 14], "semantic": {"name": "split_continuous", "arg_names": ["self", "attribute", "split_point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def split_continuous(self, attribute, split_point):\n selected_attribute = self.inputs[attribute, :]\n leq_bool = selected_attribute <= split_point\n _, leq_col = np.where(leq_bool)\n\n #print 'leq_col', leq_col\n if leq_col.shape[1] > 0:\n leq_dataset = Dataset(self.inputs[:, leq_col.A[0]], self.outputs[:, leq_col.A[0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L51_C8", "label": "selected_attribute =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [14, 2, 0.101, 0.002, 2, 0.19, 0.0, 828, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_attribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_attribute = self.inputs[attribute, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L52_C8", "label": "leq_bool =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [14, 2, 0.103, 0.002, 2, 0.19, 0.1111, 734, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "leq_bool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " leq_bool = selected_attribute <= split_point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L53_C8", "label": "_, leq_col = where()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [14, 2, 0.105, 0.002, 2, 0.19, 0.2222, 314, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "_, leq_col", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " _, leq_col = np.where(leq_bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L56_C8", "label": "if", "type": "if", "loc": [56, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [4, 2, 0.1139, 0.0079, 2, 0.19, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if leq_col.shape[1] > 0:\n leq_dataset = Dataset(self.inputs[:, leq_col.A[0]], self.outputs[:, leq_col.A[0]])\n else:\n leq_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L57_C12", "label": "leq_dataset = Dataset()", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L56_C8", "vector": [14, 3, 0.1129, 0.002, 3, 0.47, 0.0, 687, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "leq_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " leq_dataset = Dataset(self.inputs[:, leq_col.A[0]], self.outputs[:, leq_col.A[0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L59_C12", "label": "leq_dataset = Dataset()", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L56_C8", "vector": [14, 3, 0.1168, 0.002, 3, 0.47, 1.0, 687, 3, 2, 0, 0, 957, 10, 3], "semantic": {"name": "leq_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " leq_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L61_C8", "label": "_, gt_col = where()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [14, 2, 0.1208, 0.002, 2, 0.19, 0.4444, 23, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "_, gt_col", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " _, gt_col = np.where(~leq_bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L62_C8", "label": "if", "type": "if", "loc": [62, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [4, 2, 0.1257, 0.0079, 2, 0.19, 0.5556, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if gt_col.shape[1] > 0:\n gt_dataset = Dataset(self.inputs[:, gt_col.A[0]], self.outputs[:, gt_col.A[0]])\n else:\n gt_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L63_C12", "label": "gt_dataset = Dataset()", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L62_C8", "vector": [14, 3, 0.1248, 0.002, 3, 0.58, 0.0, 829, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "gt_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " gt_dataset = Dataset(self.inputs[:, gt_col.A[0]], self.outputs[:, gt_col.A[0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L65_C12", "label": "gt_dataset = Dataset()", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L62_C8", "vector": [14, 3, 0.1287, 0.002, 3, 0.58, 1.0, 829, 3, 2, 0, 0, 957, 10, 3], "semantic": {"name": "gt_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " gt_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L67_C8", "label": "ret_sets =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [14, 2, 0.1327, 0.002, 2, 0.19, 0.6667, 219, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret_sets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_sets = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L68_C8", "label": "if", "type": "if", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [4, 2, 0.1356, 0.004, 2, 0.19, 0.7778, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if leq_dataset.num_examples() > 0:\n ret_sets.append(leq_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L69_C12", "label": "append()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L68_C8", "vector": [8, 3, 0.1366, 0.002, 3, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret_sets.append(leq_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L70_C8", "label": "if", "type": "if", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [4, 2, 0.1396, 0.004, 2, 0.19, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if gt_dataset.num_examples() > 0:\n ret_sets.append(gt_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L71_C12", "label": "append()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L70_C8", "vector": [8, 3, 0.1406, 0.002, 3, 0.44, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret_sets.append(gt_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "vector": [13, 2, 0.1426, 0.002, 2, 0.19, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret_sets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "label": "unique_values", "type": "function", "loc": [74, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.1574, 0.0238, 1, 0.23, 0.5714, 921, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "unique_values", "arg_names": ["self", "attribute_number", "set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unique_values(self, attribute_number, set='input'):\n if set == 'input':\n examples = self.inputs\n else:\n examples = self.outputs\n\n values = dict()\n for instance_idx in xrange(examples.shape[1]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L75_C8", "label": "if", "type": "if", "loc": [75, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "vector": [4, 2, 0.1515, 0.0079, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if set == 'input':\n examples = self.inputs\n else:\n examples = self.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L76_C12", "label": "examples =", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L75_C8", "vector": [14, 3, 0.1505, 0.002, 3, 0.29, 0.0, 163, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "examples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " examples = self.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L78_C12", "label": "examples =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L75_C8", "vector": [14, 3, 0.1545, 0.002, 3, 0.29, 1.0, 163, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "examples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " examples = self.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L80_C8", "label": "values = dict()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "vector": [14, 2, 0.1584, 0.002, 2, 0.69, 0.2, 721, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " values = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L81_C8", "label": "for instance_idx", "type": "for", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "vector": [6, 2, 0.1614, 0.004, 2, 0.69, 0.4, 62, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "instance_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for instance_idx in xrange(examples.shape[1]):\n values[examples[attribute_number, instance_idx]] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L82_C12", "label": "assign", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L81_C8", "vector": [14, 3, 0.1624, 0.002, 3, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values[examples[attribute_number, instance_idx]] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L83_C8", "label": "k = keys()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "vector": [14, 2, 0.1644, 0.002, 2, 0.69, 0.6, 954, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " k = values.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L84_C8", "label": "sort()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "vector": [8, 2, 0.1663, 0.002, 2, 0.69, 0.8, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " k.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "vector": [13, 2, 0.1683, 0.002, 2, 0.69, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L87_C4", "label": "bootstrap_samples", "type": "function", "loc": [87, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.1782, 0.0139, 1, 0.23, 0.7143, 629, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "bootstrap_samples", "arg_names": ["self", "number_samples", "points_per_sample"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bootstrap_samples(self, number_samples, points_per_sample):\n for i in xrange(number_samples):\n selected_pts = np.random.randint(0, self.inputs.shape[1], points_per_sample)\n selected_inputs = self.inputs[:, selected_pts]\n selected_outputs = self.outputs[:, selected_pts]\n #print 'Dataset.bootstrap count', i\n yield Dataset(selected_inputs, selected_outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "label": "for i", "type": "for", "loc": [88, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L87_C4", "vector": [6, 2, 0.1792, 0.0119, 2, 0.22, 0.0, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(number_samples):\n selected_pts = np.random.randint(0, self.inputs.shape[1], points_per_sample)\n selected_inputs = self.inputs[:, selected_pts]\n selected_outputs = self.outputs[:, selected_pts]\n #print 'Dataset.bootstrap count', i\n yield Dataset(selected_inputs, selected_outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L89_C12", "label": "selected_pts = randint()", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "vector": [14, 3, 0.1762, 0.002, 3, 0.78, 0.0, 911, 3, 3, 0, 0, 449, 10, 1], "semantic": {"name": "selected_pts", "arg_names": [], "import_names": [], "rhs_call_name": "randint", "annotation": ""}, "snippet": " selected_pts = np.random.randint(0, self.inputs.shape[1], points_per_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L90_C12", "label": "selected_inputs =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "vector": [14, 3, 0.1782, 0.002, 3, 0.78, 0.3333, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_inputs = self.inputs[:, selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L91_C12", "label": "selected_outputs =", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "vector": [14, 3, 0.1802, 0.002, 3, 0.78, 0.6667, 776, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_outputs = self.outputs[:, selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L93_C12", "label": "expression", "type": "expression", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "vector": [8, 3, 0.1842, 0.002, 3, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield Dataset(selected_inputs, selected_outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "label": "entropy_discrete", "type": "function", "loc": [95, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.196, 0.0178, 1, 0.23, 0.8571, 419, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "entropy_discrete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def entropy_discrete(self):\n values = self.unique_values(0, 'output')\n #print 'entropy_discrete: values', values\n #for each output class calculate\n def calc_class_entropy(value):\n number_in_class = np.sum(self.outputs[0,:] == value)\n percentage_in_class = (number_in_class / float(self.num_examples()))\n return -percentage_in_class * np.log2(percentage_in_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L96_C8", "label": "values = unique_values()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "vector": [14, 2, 0.1901, 0.002, 2, 0.73, 0.0, 721, 3, 2, 0, 0, 921, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "unique_values", "annotation": ""}, "snippet": " values = self.unique_values(0, 'output')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "label": "calc_class_entropy", "type": "function", "loc": [99, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "vector": [2, 2, 0.199, 0.0079, 2, 0.73, 0.5, 727, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "calc_class_entropy", "arg_names": ["value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_class_entropy(value):\n number_in_class = np.sum(self.outputs[0,:] == value)\n percentage_in_class = (number_in_class / float(self.num_examples()))\n return -percentage_in_class * np.log2(percentage_in_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L100_C12", "label": "number_in_class = sum()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "vector": [14, 3, 0.198, 0.002, 3, 0.09, 0.0, 901, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "number_in_class", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " number_in_class = np.sum(self.outputs[0,:] == value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L101_C12", "label": "percentage_in_class =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "vector": [14, 3, 0.2, 0.002, 3, 0.09, 0.5, 664, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "percentage_in_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percentage_in_class = (number_in_class / float(self.num_examples()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L102_C12", "label": "return", "type": "return", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "vector": [13, 3, 0.202, 0.002, 3, 0.09, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -percentage_in_class * np.log2(percentage_in_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "vector": [13, 2, 0.204, 0.002, 2, 0.73, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.sum(map(calc_class_entropy, values))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L105_C4", "label": "append", "type": "function", "loc": [105, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "vector": [2, 1, 0.2099, 0.0059, 1, 0.23, 1.0, 243, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": ["self", "another_dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def append(self, another_dataset):\n self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)\n self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L106_C8", "label": "self.inputs = concatenate()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L105_C4", "vector": [14, 2, 0.2099, 0.002, 2, 0.39, 0.0, 646, 3, 2, 0, 0, 63, 10, 1], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L107_C8", "label": "self.outputs = concatenate()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L105_C4", "vector": [14, 2, 0.2119, 0.002, 2, 0.39, 1.0, 88, 3, 2, 0, 0, 63, 10, 1], "semantic": {"name": "self.outputs", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "label": "LinearDimReduceDataset", "type": "class", "loc": [109, 127], "level": 0, "parent": null, "vector": [3, 0, 0.2337, 0.0376, 0, 0.66, 0.2381, 44, 0, 4, 0, 0, 957, 0, 2], "semantic": {"name": "LinearDimReduceDataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LinearDimReduceDataset(Dataset):\n def __init__(self, inputs, outputs):\n Dataset.__init__(self, inputs, outputs)\n\n def set_projection_vectors(self, vec):\n '''\n projection vectors are assumed to be columnwise\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L110_C4", "label": "__init__", "type": "function", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "vector": [2, 1, 0.2188, 0.004, 1, 0.17, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "inputs", "outputs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, inputs, outputs):\n Dataset.__init__(self, inputs, outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L111_C8", "label": "__init__()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L110_C4", "vector": [8, 2, 0.2198, 0.002, 2, 0.96, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Dataset.__init__(self, inputs, outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "label": "set_projection_vectors", "type": "function", "loc": [113, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "vector": [2, 1, 0.2287, 0.0119, 1, 0.17, 0.3333, 443, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_projection_vectors", "arg_names": ["self", "vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_projection_vectors(self, vec):\n '''\n projection vectors are assumed to be columnwise\n '''\n self.projection_basis = vec\n print('LinearDimReduceDataset: projection_basis', vec.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L114_C8", "label": "expression", "type": "expression", "loc": [114, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "vector": [8, 2, 0.2277, 0.0059, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n projection vectors are assumed to be columnwise\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L117_C8", "label": "self.projection_basis =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "vector": [14, 2, 0.2317, 0.002, 2, 0.27, 0.5, 344, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.projection_basis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.projection_basis = vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L118_C8", "label": "print()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "vector": [8, 2, 0.2337, 0.002, 2, 0.27, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('LinearDimReduceDataset: projection_basis', vec.shape)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L120_C4", "label": "reduce", "type": "function", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "vector": [2, 1, 0.2386, 0.004, 1, 0.17, 0.6667, 622, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "reduce", "arg_names": ["self", "data_points"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reduce(self, data_points):\n return self.projection_basis.T * data_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L121_C8", "label": "return", "type": "return", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L120_C4", "vector": [13, 2, 0.2396, 0.002, 2, 0.62, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.projection_basis.T * data_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L123_C4", "label": "reduce_input", "type": "function", "loc": [123, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "vector": [2, 1, 0.2475, 0.0099, 1, 0.17, 1.0, 77, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reduce_input", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reduce_input(self):\n '''\n reduce dimensionality of this dataset\n '''\n self.inputs = self.projection_basis.T * self.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L124_C8", "label": "expression", "type": "expression", "loc": [124, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L123_C4", "vector": [8, 2, 0.2475, 0.0059, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n reduce dimensionality of this dataset\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L127_C8", "label": "self.inputs =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L123_C4", "vector": [14, 2, 0.2515, 0.002, 2, 0.42, 1.0, 646, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.inputs = self.projection_basis.T * self.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L129_C0", "label": "binary_less_than", "type": "function", "loc": [129, 130], "level": 0, "parent": null, "vector": [2, 0, 0.2564, 0.004, 0, 0.66, 0.2857, 633, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "binary_less_than", "arg_names": ["attribute", "threshold", "input_vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def binary_less_than(attribute, threshold, input_vec):\n return input_vec[attribute,0] <= threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L130_C4", "label": "return", "type": "return", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L129_C0", "vector": [13, 1, 0.2574, 0.002, 1, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input_vec[attribute,0] <= threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L132_C0", "label": "binary_greater_than", "type": "function", "loc": [132, 133], "level": 0, "parent": null, "vector": [2, 0, 0.2624, 0.004, 0, 0.66, 0.3333, 196, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "binary_greater_than", "arg_names": ["attribute", "threshold", "input_vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def binary_greater_than(attribute, threshold, input_vec):\n return input_vec[attribute,0] > threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L133_C4", "label": "return", "type": "return", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L132_C0", "vector": [13, 1, 0.2634, 0.002, 1, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input_vec[attribute,0] > threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L135_C0", "label": "create_binary_tests", "type": "function", "loc": [135, 137], "level": 0, "parent": null, "vector": [2, 0, 0.2693, 0.0059, 0, 0.66, 0.381, 583, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "create_binary_tests", "arg_names": ["attribute", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_binary_tests(attribute, threshold):\n return [ft.partial(binary_less_than, attribute, threshold), \n ft.partial(binary_greater_than, attribute, threshold)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L136_C4", "label": "return", "type": "return", "loc": [136, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L135_C0", "vector": [13, 1, 0.2703, 0.004, 1, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ft.partial(binary_less_than, attribute, threshold), \n ft.partial(binary_greater_than, attribute, threshold)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "label": "mode_exhaustive", "type": "function", "loc": [139, 163], "level": 0, "parent": null, "vector": [2, 0, 0.299, 0.0495, 0, 0.66, 0.4286, 156, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "mode_exhaustive", "arg_names": ["set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mode_exhaustive(set):\n '''\n Finds the mode of a given set\n '''\n\n #Count, store in dictionary\n mdict = dict()\n for s in set:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L140_C4", "label": "expression", "type": "expression", "loc": [140, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [8, 1, 0.2792, 0.0059, 1, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Finds the mode of a given set\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L145_C4", "label": "mdict = dict()", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [14, 1, 0.2871, 0.002, 1, 0.67, 0.1667, 234, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "mdict", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " mdict = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "label": "for s", "type": "for", "loc": [146, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [6, 1, 0.296, 0.0158, 1, 0.67, 0.3333, 553, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in set:\n has_stored = False\n for k in mdict.keys():\n if k == s:\n mdict[k] = 1+mdict[k]\n has_stored = True\n if not has_stored:\n mdict[s] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L147_C8", "label": "has_stored =", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "vector": [14, 2, 0.2911, 0.002, 2, 0.74, 0.0, 586, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "has_stored", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_stored = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L148_C8", "label": "for k", "type": "for", "loc": [148, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "vector": [6, 2, 0.296, 0.0079, 2, 0.74, 0.5, 954, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in mdict.keys():\n if k == s:\n mdict[k] = 1+mdict[k]\n has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L149_C12", "label": "if", "type": "if", "loc": [149, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L148_C8", "vector": [4, 3, 0.297, 0.0059, 3, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == s:\n mdict[k] = 1+mdict[k]\n has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L150_C16", "label": "assign", "type": "assigned_variable", "loc": [150, 150], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L149_C12", "vector": [14, 4, 0.297, 0.002, 4, 0.71, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mdict[k] = 1+mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L151_C16", "label": "has_stored =", "type": "assigned_variable", "loc": [151, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L149_C12", "vector": [14, 4, 0.299, 0.002, 4, 0.71, 1.0, 586, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "has_stored", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L152_C8", "label": "if", "type": "if", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "vector": [4, 2, 0.302, 0.004, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not has_stored:\n mdict[s] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L153_C12", "label": "assign", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L152_C8", "vector": [14, 3, 0.303, 0.002, 3, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mdict[s] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L156_C4", "label": "max_key =", "type": "assigned_variable", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [14, 1, 0.3089, 0.002, 1, 0.67, 0.5, 20, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "max_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_key = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L157_C4", "label": "max_count =", "type": "assigned_variable", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [14, 1, 0.3109, 0.002, 1, 0.67, 0.6667, 632, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L158_C4", "label": "for k", "type": "for", "loc": [158, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [6, 1, 0.3158, 0.0079, 1, 0.67, 0.8333, 954, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in mdict.keys():\n if mdict[k] > max_count:\n max_key = k\n max_count = mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L159_C8", "label": "if", "type": "if", "loc": [159, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L158_C4", "vector": [4, 2, 0.3168, 0.0059, 2, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mdict[k] > max_count:\n max_key = k\n max_count = mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L160_C12", "label": "max_key =", "type": "assigned_variable", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L159_C8", "vector": [14, 3, 0.3168, 0.002, 3, 0.05, 0.0, 20, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_key = k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L161_C12", "label": "max_count =", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L159_C8", "vector": [14, 3, 0.3188, 0.002, 3, 0.05, 1.0, 632, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L163_C4", "label": "return", "type": "return", "loc": [163, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "vector": [13, 1, 0.3228, 0.002, 1, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return max_key, mdict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "label": "min_entropy_split", "type": "function", "loc": [165, 188], "level": 0, "parent": null, "vector": [2, 0, 0.3495, 0.0475, 0, 0.66, 0.4762, 938, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "min_entropy_split", "arg_names": ["dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def min_entropy_split(dataset):\n '''\n Find the split that produces subsets with the minimum combined entropy\n return splitting attribute & splitting point for that attribute\n '''\n #print 'in min_entropy_split'\n # Assume inputs are continuous, and are column vectors.\n hypotheses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L166_C4", "label": "expression", "type": "expression", "loc": [166, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [8, 1, 0.3317, 0.0079, 1, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Find the split that produces subsets with the minimum combined entropy\n return splitting attribute & splitting point for that attribute\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L172_C4", "label": "hypotheses =", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [14, 1, 0.3406, 0.002, 1, 0.53, 0.1667, 121, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hypotheses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hypotheses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L173_C4", "label": "entropies =", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [14, 1, 0.3426, 0.002, 1, 0.53, 0.3333, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "entropies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " entropies = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L175_C4", "label": "for attribute", "type": "for", "loc": [175, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [6, 1, 0.3554, 0.0198, 1, 0.53, 0.5, 355, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "attribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for attribute in xrange(dataset.num_attributes()):\n values = dataset.unique_values(attribute)\n #Iterate over the possible values of split & calculate entropy for each split.\n for split_point in values:\n def calc_entropy(data_set):\n num_points = data_set.num_examples()\n return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()\n split_entropy = map(calc_entropy, dataset.split_continuous(attribute, split_point))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L176_C8", "label": "values = unique_values()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L175_C4", "vector": [14, 2, 0.3485, 0.002, 2, 0.55, 0.0, 721, 3, 1, 0, 0, 921, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "unique_values", "annotation": ""}, "snippet": " values = dataset.unique_values(attribute)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "label": "for split_point", "type": "for", "loc": [178, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L175_C4", "vector": [6, 2, 0.3584, 0.0139, 2, 0.55, 1.0, 645, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "split_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for split_point in values:\n def calc_entropy(data_set):\n num_points = data_set.num_examples()\n return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()\n split_entropy = map(calc_entropy, dataset.split_continuous(attribute, split_point))\n hypotheses.append((attribute, split_point))\n entropies.append(sum(split_entropy))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L179_C12", "label": "calc_entropy", "type": "function", "loc": [179, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "vector": [2, 3, 0.3564, 0.0059, 3, 0.72, 0.0, 853, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "calc_entropy", "arg_names": ["data_set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_entropy(data_set):\n num_points = data_set.num_examples()\n return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L180_C16", "label": "num_points = num_examples()", "type": "assigned_variable", "loc": [180, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L179_C12", "vector": [14, 4, 0.3564, 0.002, 4, 0.68, 0.0, 754, 3, 0, 0, 0, 12, 10, 1], "semantic": {"name": "num_points", "arg_names": [], "import_names": [], "rhs_call_name": "num_examples", "annotation": ""}, "snippet": " num_points = data_set.num_examples()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L181_C16", "label": "return", "type": "return", "loc": [181, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L179_C12", "vector": [13, 4, 0.3584, 0.002, 4, 0.68, 1.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L182_C12", "label": "split_entropy = map()", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "vector": [14, 3, 0.3604, 0.002, 3, 0.72, 0.3333, 152, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "split_entropy", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " split_entropy = map(calc_entropy, dataset.split_continuous(attribute, split_point))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L183_C12", "label": "append()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "vector": [8, 3, 0.3624, 0.002, 3, 0.72, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hypotheses.append((attribute, split_point))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L184_C12", "label": "append()", "type": "expression", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "vector": [8, 3, 0.3644, 0.002, 3, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " entropies.append(sum(split_entropy))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L186_C4", "label": "entropies = matrix()", "type": "assigned_variable", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [14, 1, 0.3683, 0.002, 1, 0.53, 0.6667, 411, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "entropies", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " entropies = np.matrix(entropies)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L187_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [14, 1, 0.3703, 0.002, 1, 0.53, 0.8333, 912, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "min_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " min_idx = np.argmin(entropies)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L188_C4", "label": "return", "type": "return", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "vector": [13, 1, 0.3723, 0.002, 1, 0.53, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hypotheses[min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "label": "random_subset", "type": "function", "loc": [190, 197], "level": 0, "parent": null, "vector": [2, 0, 0.3832, 0.0158, 0, 0.66, 0.5238, 299, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "random_subset", "arg_names": ["subset_size", "total_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_subset(subset_size, total_size):\n #print 'in random_subset'\n assert(subset_size <= total_size)\n occupancy = np.matrix(np.zeros((1, total_size)))\n while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1\n rows, columns = np.where(occupancy > 0)\n return columns.A[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L193_C4", "label": "occupancy = matrix()", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "vector": [14, 1, 0.3822, 0.002, 1, 0.0, 0.0, 689, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "occupancy", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " occupancy = np.matrix(np.zeros((1, total_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L194_C4", "label": "while", "type": "while", "loc": [194, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "vector": [5, 1, 0.3851, 0.004, 1, 0.0, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L195_C8", "label": "assign", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L194_C4", "vector": [14, 2, 0.3861, 0.002, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L196_C4", "label": "rows, columns = where()", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "vector": [14, 1, 0.3881, 0.002, 1, 0.0, 0.6667, 804, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "rows, columns", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " rows, columns = np.where(occupancy > 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L197_C4", "label": "return", "type": "return", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "vector": [13, 1, 0.3901, 0.002, 1, 0.0, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return columns.A[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "label": "split_random_subset", "type": "function", "loc": [199, 207], "level": 0, "parent": null, "vector": [2, 0, 0.402, 0.0178, 0, 0.66, 0.5714, 318, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "split_random_subset", "arg_names": ["subset_size", "total_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_random_subset(subset_size, total_size):\n assert(subset_size <= total_size)\n occupancy = np.matrix(np.zeros((1, total_size)))\n while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1\n bool_sel = occupancy > 0\n rows, columns_subset = np.where(bool_sel)\n rows, columns_remaining = np.where(np.invert(bool_sel))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L201_C4", "label": "occupancy = matrix()", "type": "assigned_variable", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "vector": [14, 1, 0.398, 0.002, 1, 0.78, 0.0, 689, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "occupancy", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " occupancy = np.matrix(np.zeros((1, total_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L202_C4", "label": "while", "type": "while", "loc": [202, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "vector": [5, 1, 0.401, 0.004, 1, 0.78, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L203_C8", "label": "assign", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L202_C4", "vector": [14, 2, 0.402, 0.002, 2, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L204_C4", "label": "bool_sel =", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "vector": [14, 1, 0.404, 0.002, 1, 0.78, 0.4, 551, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bool_sel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bool_sel = occupancy > 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L205_C4", "label": "rows, columns_subset = where()", "type": "assigned_variable", "loc": [205, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "vector": [14, 1, 0.4059, 0.002, 1, 0.78, 0.6, 67, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "rows, columns_subset", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " rows, columns_subset = np.where(bool_sel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L206_C4", "label": "rows, columns_remaining = where()", "type": "assigned_variable", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "vector": [14, 1, 0.4079, 0.002, 1, 0.78, 0.8, 295, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "rows, columns_remaining", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " rows, columns_remaining = np.where(np.invert(bool_sel))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L207_C4", "label": "return", "type": "return", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "vector": [13, 1, 0.4099, 0.002, 1, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return columns_subset.A[0], columns_remaining.A[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "label": "random_subset_split", "type": "function", "loc": [209, 216], "level": 0, "parent": null, "vector": [2, 0, 0.4208, 0.0158, 0, 0.66, 0.619, 219, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "random_subset_split", "arg_names": ["num_subset", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_subset_split(num_subset, dataset):\n ''' splitter in decision tree '''\n #print 'in random_subset_split'\n #print 'num_subset', num_subset, dataset, 'dataset.input.shape', dataset.inputs.shape\n subset_indexes = random_subset(num_subset, dataset.num_attributes())\n sub_dataset = Dataset(dataset.inputs[subset_indexes,:], dataset.outputs)\n attribute, point = min_entropy_split(sub_dataset)\n return subset_indexes[attribute], point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L210_C4", "label": "expression", "type": "expression", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "vector": [8, 1, 0.4158, 0.002, 1, 0.97, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ''' splitter in decision tree '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L213_C4", "label": "subset_indexes = random_subset()", "type": "assigned_variable", "loc": [213, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "vector": [14, 1, 0.4218, 0.002, 1, 0.97, 0.25, 403, 3, 2, 0, 0, 299, 10, 2], "semantic": {"name": "subset_indexes", "arg_names": [], "import_names": [], "rhs_call_name": "random_subset", "annotation": ""}, "snippet": " subset_indexes = random_subset(num_subset, dataset.num_attributes())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L214_C4", "label": "sub_dataset = Dataset()", "type": "assigned_variable", "loc": [214, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "vector": [14, 1, 0.4238, 0.002, 1, 0.97, 0.5, 430, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "sub_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " sub_dataset = Dataset(dataset.inputs[subset_indexes,:], dataset.outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L215_C4", "label": "attribute, point = min_entropy_split()", "type": "assigned_variable", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "vector": [14, 1, 0.4257, 0.002, 1, 0.97, 0.75, 912, 3, 1, 0, 0, 938, 10, 1], "semantic": {"name": "attribute, point", "arg_names": [], "import_names": [], "rhs_call_name": "min_entropy_split", "annotation": ""}, "snippet": " attribute, point = min_entropy_split(sub_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L216_C4", "label": "return", "type": "return", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "vector": [13, 1, 0.4277, 0.002, 1, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return subset_indexes[attribute], point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "label": "totally_random_split", "type": "function", "loc": [218, 222], "level": 0, "parent": null, "vector": [2, 0, 0.4356, 0.0099, 0, 0.66, 0.6667, 958, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "totally_random_split", "arg_names": ["dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def totally_random_split(dataset):\n #print 'totally random'\n attr = np.random.randint(0, dataset.num_attributes())\n split_pt = dataset.inputs[attr, np.random.randint(0, dataset.num_examples())]\n return attr, split_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L220_C4", "label": "attr = randint()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "vector": [14, 1, 0.4356, 0.002, 1, 0.06, 0.0, 400, 3, 2, 0, 0, 449, 10, 2], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "randint", "annotation": ""}, "snippet": " attr = np.random.randint(0, dataset.num_attributes())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L221_C4", "label": "split_pt =", "type": "assigned_variable", "loc": [221, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "vector": [14, 1, 0.4376, 0.002, 1, 0.06, 0.5, 44, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "split_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " split_pt = dataset.inputs[attr, np.random.randint(0, dataset.num_examples())]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L222_C4", "label": "return", "type": "return", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "vector": [13, 1, 0.4396, 0.002, 1, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return attr, split_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "label": "DecisionTree", "type": "class", "loc": [224, 267], "level": 0, "parent": null, "vector": [3, 0, 0.4861, 0.0871, 0, 0.66, 0.7143, 890, 0, 5, 0, 0, 0, 0, 16], "semantic": {"name": "DecisionTree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DecisionTree:\n def __init__(self, dataset=None, splitting_func=min_entropy_split):\n self.children = None\n self.prediction = None\n if dataset is not None:\n self.train(dataset, splitting_func=splitting_func)\n\n def train(self, dataset, splitting_func=min_entropy_split):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "label": "__init__", "type": "function", "loc": [225, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "vector": [2, 1, 0.4495, 0.0099, 1, 0.92, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "dataset", "splitting_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dataset=None, splitting_func=min_entropy_split):\n self.children = None\n self.prediction = None\n if dataset is not None:\n self.train(dataset, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L226_C8", "label": "self.children =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "vector": [14, 2, 0.4475, 0.002, 2, 0.84, 0.0, 278, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L227_C8", "label": "self.prediction =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "vector": [14, 2, 0.4495, 0.002, 2, 0.84, 0.5, 683, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L228_C8", "label": "if", "type": "if", "loc": [228, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "vector": [4, 2, 0.4525, 0.004, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dataset is not None:\n self.train(dataset, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L229_C12", "label": "train()", "type": "expression", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L228_C8", "vector": [8, 3, 0.4535, 0.002, 3, 0.76, 0.0, 371, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": " self.train(dataset, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L231_C4", "label": "train", "type": "function", "loc": [231, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "vector": [2, 1, 0.4723, 0.0317, 1, 0.92, 0.3333, 371, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "train", "arg_names": ["self", "dataset", "splitting_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset, splitting_func=min_entropy_split):\n if not self.make_leaf(dataset):\n #print 'in train.splitting', dataset.num_examples()\n self.split_attribute, self.split_point = splitting_func(dataset)\n #print 'self.split_attribute, self.split_point', self.split_attribute, self.split_point \n data_sets = dataset.split_continuous(self.split_attribute, self.split_point)\n if len(data_sets) < 2:\n self.prediction = dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "label": "if", "type": "if", "loc": [232, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L231_C4", "vector": [4, 2, 0.4733, 0.0297, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.make_leaf(dataset):\n #print 'in train.splitting', dataset.num_examples()\n self.split_attribute, self.split_point = splitting_func(dataset)\n #print 'self.split_attribute, self.split_point', self.split_attribute, self.split_point \n data_sets = dataset.split_continuous(self.split_attribute, self.split_point)\n if len(data_sets) < 2:\n self.prediction = dataset.outputs\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L234_C12", "label": " = splitting_func()", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "vector": [14, 3, 0.4634, 0.002, 3, 0.06, 0.0, 0, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "splitting_func", "annotation": ""}, "snippet": " self.split_attribute, self.split_point = splitting_func(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L236_C12", "label": "data_sets = split_continuous()", "type": "assigned_variable", "loc": [236, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "vector": [14, 3, 0.4673, 0.002, 3, 0.06, 0.2, 883, 3, 2, 0, 0, 193, 10, 1], "semantic": {"name": "data_sets", "arg_names": [], "import_names": [], "rhs_call_name": "split_continuous", "annotation": ""}, "snippet": " data_sets = dataset.split_continuous(self.split_attribute, self.split_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L237_C12", "label": "if", "type": "if", "loc": [237, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "vector": [4, 3, 0.4713, 0.0059, 3, 0.06, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(data_sets) < 2:\n self.prediction = dataset.outputs\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L238_C16", "label": "self.prediction =", "type": "assigned_variable", "loc": [238, 238], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L237_C12", "vector": [14, 4, 0.4713, 0.002, 4, 0.35, 0.0, 683, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L239_C16", "label": "return", "type": "return", "loc": [239, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L237_C12", "vector": [13, 4, 0.4733, 0.002, 4, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L241_C12", "label": "tree_split", "type": "function", "loc": [241, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "vector": [2, 3, 0.4792, 0.0059, 3, 0.06, 0.6, 809, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "tree_split", "arg_names": ["set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tree_split(set):\n #print 'tree', set.num_examples()\n return DecisionTree(set, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L243_C16", "label": "return", "type": "return", "loc": [243, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L241_C12", "vector": [13, 4, 0.4812, 0.002, 4, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DecisionTree(set, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L245_C12", "label": "tests = create_binary_tests()", "type": "assigned_variable", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "vector": [14, 3, 0.4851, 0.002, 3, 0.06, 0.8, 416, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "create_binary_tests", "annotation": ""}, "snippet": " tests = create_binary_tests(self.split_attribute, self.split_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L246_C12", "label": "self.children = zip()", "type": "assigned_variable", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "vector": [14, 3, 0.4871, 0.002, 3, 0.06, 1.0, 278, 3, 2, 0, 0, 814, 10, 2], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " self.children = zip(tests, map(tree_split, data_sets))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L248_C4", "label": "make_leaf", "type": "function", "loc": [248, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "vector": [2, 1, 0.501, 0.0218, 1, 0.92, 0.6667, 59, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "make_leaf", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_leaf(self, dataset):\n if np.all(dataset.outputs[:,0] == dataset.outputs):\n self.prediction = dataset.outputs[:,0]\n #print 'leaf'\n return True\n elif np.all(dataset.inputs[:,0] == dataset.inputs):\n self.prediction = dataset.outputs\n #print 'leaf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "label": "if", "type": "if", "loc": [249, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L248_C4", "vector": [4, 2, 0.502, 0.0198, 2, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(dataset.outputs[:,0] == dataset.outputs):\n self.prediction = dataset.outputs[:,0]\n #print 'leaf'\n return True\n elif np.all(dataset.inputs[:,0] == dataset.inputs):\n self.prediction = dataset.outputs\n #print 'leaf'\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L250_C12", "label": "self.prediction =", "type": "assigned_variable", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "vector": [14, 3, 0.495, 0.002, 3, 0.11, 0.0, 683, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = dataset.outputs[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L252_C12", "label": "return", "type": "return", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "vector": [13, 3, 0.499, 0.002, 3, 0.11, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "label": "if", "type": "if", "loc": [253, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "vector": [4, 3, 0.5059, 0.0119, 3, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.all(dataset.inputs[:,0] == dataset.inputs):\n self.prediction = dataset.outputs\n #print 'leaf'\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L254_C12", "label": "self.prediction =", "type": "assigned_variable", "loc": [254, 254], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "vector": [14, 4, 0.503, 0.002, 4, 0.19, 0.0, 683, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L256_C12", "label": "return", "type": "return", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "vector": [13, 4, 0.5069, 0.002, 4, 0.19, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L258_C12", "label": "return", "type": "return", "loc": [258, 258], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "vector": [13, 4, 0.5109, 0.002, 4, 0.19, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L260_C4", "label": "predict", "type": "function", "loc": [260, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "vector": [2, 1, 0.5218, 0.0158, 1, 0.92, 1.0, 127, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "predict", "arg_names": ["self", "input"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict(self, input):\n if self.prediction is not None:\n return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]\n else:\n for test, child in self.children:\n if test(input):\n return child.predict(input)\n raise RuntimeError(\"DecisionTree: splits not exhaustive, unable to split for input\" + str(input.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L261_C8", "label": "if", "type": "if", "loc": [261, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L260_C4", "vector": [4, 2, 0.5228, 0.0139, 2, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.prediction is not None:\n return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]\n else:\n for test, child in self.children:\n if test(input):\n return child.predict(input)\n raise RuntimeError(\"DecisionTree: splits not exhaustive, unable to split for input\" + str(input.T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L262_C12", "label": "return", "type": "return", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L261_C8", "vector": [13, 3, 0.5188, 0.002, 3, 0.23, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L264_C12", "label": "for test, child", "type": "for", "loc": [264, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L261_C8", "vector": [6, 3, 0.5248, 0.0059, 3, 0.23, 1.0, 419, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "test, child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test, child in self.children:\n if test(input):\n return child.predict(input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L265_C16", "label": "if", "type": "if", "loc": [265, 266], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L264_C12", "vector": [4, 4, 0.5257, 0.004, 4, 0.16, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test(input):\n return child.predict(input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L266_C20", "label": "return", "type": "return", "loc": [266, 266], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L265_C16", "vector": [13, 5, 0.5267, 0.002, 5, 0.0, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return child.predict(input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "label": "RFBase", "type": "class", "loc": [269, 291], "level": 0, "parent": null, "vector": [3, 0, 0.5545, 0.0455, 0, 0.66, 0.7619, 454, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "RFBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFBase:\n def __init__(self, dataset=None, number_of_dimensions=None, number_of_learners=100):\n \"\"\" \n number_of_dimensions unclear which direction, but should be around 10-20% of original \n data dimension\n number_of_learners limited by processor performance, higher is better\n \"\"\"\n self.number_of_learners = number_of_learners"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "label": "__init__", "type": "function", "loc": [270, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "vector": [2, 1, 0.5436, 0.0198, 1, 0.76, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "dataset", "number_of_dimensions", "number_of_learners"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dataset=None, number_of_dimensions=None, number_of_learners=100):\n \"\"\" \n number_of_dimensions unclear which direction, but should be around 10-20% of original \n data dimension\n number_of_learners limited by processor performance, higher is better\n \"\"\"\n self.number_of_learners = number_of_learners\n self.number_of_dimensions = number_of_dimensions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L271_C8", "label": "expression", "type": "expression", "loc": [271, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "vector": [8, 2, 0.5406, 0.0099, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\" \n number_of_dimensions unclear which direction, but should be around 10-20% of original \n data dimension\n number_of_learners limited by processor performance, higher is better\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L276_C8", "label": "self.number_of_learners =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "vector": [14, 2, 0.5465, 0.002, 2, 0.4, 0.3333, 98, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.number_of_learners", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.number_of_learners = number_of_learners"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L277_C8", "label": "self.number_of_dimensions =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "vector": [14, 2, 0.5485, 0.002, 2, 0.4, 0.6667, 542, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.number_of_dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.number_of_dimensions = number_of_dimensions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L278_C8", "label": "if", "type": "if", "loc": [278, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "vector": [4, 2, 0.5515, 0.004, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dataset != None:\n self.train(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L279_C12", "label": "train()", "type": "expression", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L278_C8", "vector": [8, 3, 0.5525, 0.002, 3, 0.54, 0.0, 371, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": " self.train(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "label": "predict", "type": "function", "loc": [281, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "vector": [2, 1, 0.5634, 0.0158, 1, 0.76, 0.5, 127, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "predict", "arg_names": ["self", "data", "vote_combine_function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict(self, data, vote_combine_function=None):\n def predict_(learner):\n return learner.predict(learner.transform_input(data))\n predictions = map(predict_,self.learners)\n if vote_combine_function is not None:\n return vote_combine_function(predictions)\n else:\n return mode_exhaustive(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L282_C8", "label": "predict_", "type": "function", "loc": [282, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "vector": [2, 2, 0.5594, 0.004, 2, 0.26, 0.0, 780, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "predict_", "arg_names": ["learner"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict_(learner):\n return learner.predict(learner.transform_input(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L283_C12", "label": "return", "type": "return", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L282_C8", "vector": [13, 3, 0.5604, 0.002, 3, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return learner.predict(learner.transform_input(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L284_C8", "label": "predictions = map()", "type": "assigned_variable", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "vector": [14, 2, 0.5624, 0.002, 2, 0.26, 0.5, 493, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "predictions", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " predictions = map(predict_,self.learners)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L285_C8", "label": "if", "type": "if", "loc": [285, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "vector": [4, 2, 0.5673, 0.0079, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vote_combine_function is not None:\n return vote_combine_function(predictions)\n else:\n return mode_exhaustive(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L286_C12", "label": "return", "type": "return", "loc": [286, 286], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L285_C8", "vector": [13, 3, 0.5663, 0.002, 3, 0.22, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vote_combine_function(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L288_C12", "label": "return", "type": "return", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L285_C8", "vector": [13, 3, 0.5703, 0.002, 3, 0.22, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mode_exhaustive(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L290_C4", "label": "train", "type": "function", "loc": [290, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "vector": [2, 1, 0.5752, 0.004, 1, 0.76, 1.0, 371, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "train", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L293_C0", "label": "identity", "type": "function", "loc": [293, 294], "level": 0, "parent": null, "vector": [2, 0, 0.5812, 0.004, 0, 0.66, 0.8095, 759, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "identity", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def identity(x):\n return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L294_C4", "label": "return", "type": "return", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L293_C0", "vector": [13, 1, 0.5822, 0.002, 1, 0.35, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L296_C0", "label": "RFBreiman", "type": "class", "loc": [296, 309], "level": 0, "parent": null, "vector": [3, 0, 0.599, 0.0277, 0, 0.66, 0.8571, 766, 0, 2, 0, 0, 454, 0, 8], "semantic": {"name": "RFBreiman", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFBreiman(RFBase):\n def train(self, dataset):\n def train_trees(examples_subset):\n tree = DecisionTree()\n #tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))\n tree.train(examples_subset, splitting_func=totally_random_split)\n #use identity function\n tree.transform_input = identity "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "label": "train", "type": "function", "loc": [297, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L296_C0", "vector": [2, 1, 0.6, 0.0257, 1, 0.66, 0.0, 371, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "train", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset):\n def train_trees(examples_subset):\n tree = DecisionTree()\n #tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))\n tree.train(examples_subset, splitting_func=totally_random_split)\n #use identity function\n tree.transform_input = identity \n return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "label": "train_trees", "type": "function", "loc": [298, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "vector": [2, 2, 0.596, 0.0139, 2, 0.5, 0.0, 642, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "train_trees", "arg_names": ["examples_subset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train_trees(examples_subset):\n tree = DecisionTree()\n #tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))\n tree.train(examples_subset, splitting_func=totally_random_split)\n #use identity function\n tree.transform_input = identity \n return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L299_C12", "label": "tree = DecisionTree()", "type": "assigned_variable", "loc": [299, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "vector": [14, 3, 0.5921, 0.002, 3, 0.23, 0.0, 613, 3, 0, 0, 0, 890, 10, 1], "semantic": {"name": "tree", "arg_names": [], "import_names": [], "rhs_call_name": "DecisionTree", "annotation": ""}, "snippet": " tree = DecisionTree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L301_C12", "label": "train()", "type": "expression", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "vector": [8, 3, 0.596, 0.002, 3, 0.23, 0.3333, 371, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": " tree.train(examples_subset, splitting_func=totally_random_split)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L303_C12", "label": "tree.transform_input =", "type": "assigned_variable", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "vector": [14, 3, 0.6, 0.002, 3, 0.23, 0.6667, 794, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tree.transform_input", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree.transform_input = identity "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L304_C12", "label": "return", "type": "return", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "vector": [13, 3, 0.602, 0.002, 3, 0.23, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L306_C8", "label": "if", "type": "if", "loc": [306, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "vector": [4, 2, 0.6069, 0.004, 2, 0.5, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.number_of_dimensions == None:\n self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L307_C12", "label": "self.number_of_dimensions = min()", "type": "assigned_variable", "loc": [307, 307], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L306_C8", "vector": [14, 3, 0.6079, 0.002, 3, 0.96, 0.0, 542, 3, 2, 0, 0, 867, 10, 3], "semantic": {"name": "self.number_of_dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L308_C8", "label": "points_per_sample =", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "vector": [14, 2, 0.6099, 0.002, 2, 0.5, 0.6667, 65, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "points_per_sample", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points_per_sample = dataset.num_examples() * 1.0 / 3.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L309_C8", "label": "self.learners = map()", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "vector": [14, 2, 0.6119, 0.002, 2, 0.5, 1.0, 991, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.learners", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.learners = map(train_trees, dataset.bootstrap_samples(self.number_of_learners, points_per_sample))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L311_C0", "label": "RFRandomInputSubset", "type": "class", "loc": [311, 328], "level": 0, "parent": null, "vector": [3, 0, 0.6327, 0.0356, 0, 0.66, 0.9048, 170, 0, 3, 0, 0, 454, 0, 10], "semantic": {"name": "RFRandomInputSubset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFRandomInputSubset(RFBase):\n def train(self, dataset):\n def train_trees(examples_subset):\n #select a subset of dimensions\n dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())\n subset_input = examples_subset.inputs[dims, :]\n reduced_sample = Dataset(subset_input, examples_subset.outputs)\n tree = DecisionTree(reduced_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "label": "train", "type": "function", "loc": [312, 328], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L311_C0", "vector": [2, 1, 0.6337, 0.0337, 1, 0.61, 0.0, 371, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "train", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset):\n def train_trees(examples_subset):\n #select a subset of dimensions\n dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())\n subset_input = examples_subset.inputs[dims, :]\n reduced_sample = Dataset(subset_input, examples_subset.outputs)\n tree = DecisionTree(reduced_sample)\n tree.dimensions_subset = dims"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "label": "train_trees", "type": "function", "loc": [313, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "vector": [2, 2, 0.6297, 0.0218, 2, 0.86, 0.0, 642, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "train_trees", "arg_names": ["examples_subset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train_trees(examples_subset):\n #select a subset of dimensions\n dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())\n subset_input = examples_subset.inputs[dims, :]\n reduced_sample = Dataset(subset_input, examples_subset.outputs)\n tree = DecisionTree(reduced_sample)\n tree.dimensions_subset = dims\n def transform_input(input):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L315_C12", "label": "dims = random_subset()", "type": "assigned_variable", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [14, 3, 0.6238, 0.002, 3, 0.07, 0.0, 219, 3, 2, 0, 0, 299, 10, 2], "semantic": {"name": "dims", "arg_names": [], "import_names": [], "rhs_call_name": "random_subset", "annotation": ""}, "snippet": " dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L316_C12", "label": "subset_input =", "type": "assigned_variable", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [14, 3, 0.6257, 0.002, 3, 0.07, 0.1429, 715, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subset_input", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subset_input = examples_subset.inputs[dims, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L317_C12", "label": "reduced_sample = Dataset()", "type": "assigned_variable", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [14, 3, 0.6277, 0.002, 3, 0.07, 0.2857, 224, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "reduced_sample", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " reduced_sample = Dataset(subset_input, examples_subset.outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L318_C12", "label": "tree = DecisionTree()", "type": "assigned_variable", "loc": [318, 318], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [14, 3, 0.6297, 0.002, 3, 0.07, 0.4286, 613, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "tree", "arg_names": [], "import_names": [], "rhs_call_name": "DecisionTree", "annotation": ""}, "snippet": " tree = DecisionTree(reduced_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L319_C12", "label": "tree.dimensions_subset =", "type": "assigned_variable", "loc": [319, 319], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [14, 3, 0.6317, 0.002, 3, 0.07, 0.5714, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tree.dimensions_subset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree.dimensions_subset = dims"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L320_C12", "label": "transform_input", "type": "function", "loc": [320, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [2, 3, 0.6347, 0.004, 3, 0.07, 0.7143, 639, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "transform_input", "arg_names": ["input"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_input(input):\n return input[dims, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L321_C16", "label": "return", "type": "return", "loc": [321, 321], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L320_C12", "vector": [13, 4, 0.6356, 0.002, 4, 0.59, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input[dims, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L322_C12", "label": "tree.transform_input =", "type": "assigned_variable", "loc": [322, 322], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [14, 3, 0.6376, 0.002, 3, 0.07, 0.8571, 794, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tree.transform_input", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree.transform_input = transform_input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L323_C12", "label": "return", "type": "return", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "vector": [13, 3, 0.6396, 0.002, 3, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L325_C8", "label": "if", "type": "if", "loc": [325, 326], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "vector": [4, 2, 0.6446, 0.004, 2, 0.86, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.number_of_dimensions == None:\n self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L326_C12", "label": "self.number_of_dimensions = min()", "type": "assigned_variable", "loc": [326, 326], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L325_C8", "vector": [14, 3, 0.6455, 0.002, 3, 0.31, 0.0, 542, 3, 2, 0, 0, 867, 10, 3], "semantic": {"name": "self.number_of_dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L327_C8", "label": "points_per_sample =", "type": "assigned_variable", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "vector": [14, 2, 0.6475, 0.002, 2, 0.86, 0.6667, 65, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "points_per_sample", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points_per_sample = dataset.num_examples() * 1.0 / 3.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L328_C8", "label": "self.learners = map()", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "vector": [14, 2, 0.6495, 0.002, 2, 0.86, 1.0, 991, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.learners", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.learners = map(train_trees, dataset.bootstrap_samples(self.number_of_learners, points_per_sample))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "label": "evaluate_classifier", "type": "function", "loc": [330, 438], "level": 0, "parent": null, "vector": [2, 0, 0.7604, 0.2158, 0, 0.66, 0.9524, 233, 0, 6, 0, 0, 0, 0, 67], "semantic": {"name": "evaluate_classifier", "arg_names": ["building_func", "data", "times", "percentage", "extra_args", "test_pca"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def evaluate_classifier(building_func, data, times=10.0, percentage=None, extra_args={}, test_pca=False):\n '''\n Evaluate classifier by dividing dataset into training and test set.\n @param building_func Function that will build classifier given data and args in extra_args.\n @param data Dataset to use for evaluation/training.\n @param times The number of bootstrap samples to take.\n @param percentage The percentage of data to use for training.\n @param extra_args Extra arguments to pass to building_func."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L331_C4", "label": "expression", "type": "expression", "loc": [331, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [8, 1, 0.6624, 0.0158, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " '''\n Evaluate classifier by dividing dataset into training and test set.\n @param building_func Function that will build classifier given data and args in extra_args.\n @param data Dataset to use for evaluation/training.\n @param times The number of bootstrap samples to take.\n @param percentage The percentage of data to use for training.\n @param extra_args Extra arguments to pass to building_func.\n '''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L339_C4", "label": "print()", "type": "expression", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [8, 1, 0.6713, 0.002, 1, 0.59, 0.0833, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('evaluate_classifier: extra_args', extra_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L340_C4", "label": "total_pts = num_examples()", "type": "assigned_variable", "loc": [340, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [14, 1, 0.6733, 0.002, 1, 0.59, 0.1667, 34, 3, 0, 0, 0, 12, 10, 1], "semantic": {"name": "total_pts", "arg_names": [], "import_names": [], "rhs_call_name": "num_examples", "annotation": ""}, "snippet": " total_pts = data.num_examples()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L341_C4", "label": "testing_errors =", "type": "assigned_variable", "loc": [341, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [14, 1, 0.6752, 0.002, 1, 0.59, 0.25, 292, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "testing_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " testing_errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L342_C4", "label": "training_errors =", "type": "assigned_variable", "loc": [342, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [14, 1, 0.6772, 0.002, 1, 0.59, 0.3333, 28, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "training_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " training_errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L343_C4", "label": "build_times =", "type": "assigned_variable", "loc": [343, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [14, 1, 0.6792, 0.002, 1, 0.59, 0.4167, 845, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "build_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " build_times = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L344_C4", "label": "classification_times =", "type": "assigned_variable", "loc": [344, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [14, 1, 0.6812, 0.002, 1, 0.59, 0.5, 709, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "classification_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " classification_times = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "label": "for i", "type": "for", "loc": [345, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [6, 1, 0.7663, 0.1683, 1, 0.59, 0.5833, 826, 3, 0, 0, 0, 0, 0, 57], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(times):\n if percentage == None:\n percentage = (i+1)/times\n num_examples = int(round(total_pts*percentage))\n print('Evaluate classifier built with', percentage*100, '% data, num examples', num_examples)\n subset, unselected = split_random_subset(num_examples, total_pts)\n i = data.inputs[:, subset]\n o = data.outputs[:, subset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L346_C8", "label": "if", "type": "if", "loc": [346, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [4, 2, 0.6861, 0.004, 2, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if percentage == None:\n percentage = (i+1)/times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L347_C12", "label": "percentage =", "type": "assigned_variable", "loc": [347, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L346_C8", "vector": [14, 3, 0.6871, 0.002, 3, 0.24, 0.0, 568, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "percentage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percentage = (i+1)/times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L348_C8", "label": "num_examples = int()", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.6891, 0.002, 2, 0.28, 0.0385, 12, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "num_examples", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " num_examples = int(round(total_pts*percentage))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L349_C8", "label": "print()", "type": "expression", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.6911, 0.002, 2, 0.28, 0.0769, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Evaluate classifier built with', percentage*100, '% data, num examples', num_examples)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L350_C8", "label": "subset, unselected = split_random_subset()", "type": "assigned_variable", "loc": [350, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.6931, 0.002, 2, 0.28, 0.1154, 565, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "subset, unselected", "arg_names": [], "import_names": [], "rhs_call_name": "split_random_subset", "annotation": ""}, "snippet": " subset, unselected = split_random_subset(num_examples, total_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L351_C8", "label": "i =", "type": "assigned_variable", "loc": [351, 351], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.695, 0.002, 2, 0.28, 0.1538, 826, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = data.inputs[:, subset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L352_C8", "label": "o =", "type": "assigned_variable", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.697, 0.002, 2, 0.28, 0.1923, 926, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = data.outputs[:, subset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L353_C8", "label": "print()", "type": "expression", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.699, 0.002, 2, 0.28, 0.2308, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Building classifier...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "label": "if", "type": "if", "loc": [354, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [4, 2, 0.7089, 0.0178, 2, 0.28, 0.2692, 0, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pca:\n print(' TESTING PCA')\n import dimreduce as dr\n subseted_dataset = LinearDimReduceDataset(i,o)\n subseted_dataset.set_projection_vectors(dr.pca_vectors(subseted_dataset.inputs, percent_variance=.95))\n subseted_dataset.reduce_input()\n print('subseted_dataset.num_attributes(), subseted_dataset.num_examples()', subseted_dataset.num_attributes(), subseted_dataset.num_examples())\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L355_C12", "label": "print()", "type": "expression", "loc": [355, 355], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [8, 3, 0.703, 0.002, 3, 0.73, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(' TESTING PCA')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L356_C12", "label": "dimreduce import dr", "type": "import", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [1, 3, 0.705, 0.002, 3, 0.73, 0.1667, 169, 0, 1, 0, 0, 169, 0, 0], "semantic": {"name": "dimreduce", "arg_names": [], "import_names": ["dr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import dimreduce as dr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L357_C12", "label": "subseted_dataset = LinearDimReduceDataset()", "type": "assigned_variable", "loc": [357, 357], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [14, 3, 0.7069, 0.002, 3, 0.73, 0.3333, 184, 3, 2, 0, 0, 44, 10, 1], "semantic": {"name": "subseted_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "LinearDimReduceDataset", "annotation": ""}, "snippet": " subseted_dataset = LinearDimReduceDataset(i,o)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L358_C12", "label": "set_projection_vectors()", "type": "expression", "loc": [358, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [8, 3, 0.7089, 0.002, 3, 0.73, 0.5, 443, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_projection_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "set_projection_vectors", "annotation": ""}, "snippet": " subseted_dataset.set_projection_vectors(dr.pca_vectors(subseted_dataset.inputs, percent_variance=.95))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L359_C12", "label": "reduce_input()", "type": "expression", "loc": [359, 359], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [8, 3, 0.7109, 0.002, 3, 0.73, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reduce_input", "arg_names": [], "import_names": [], "rhs_call_name": "reduce_input", "annotation": ""}, "snippet": " subseted_dataset.reduce_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L360_C12", "label": "print()", "type": "expression", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [8, 3, 0.7129, 0.002, 3, 0.73, 0.8333, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('subseted_dataset.num_attributes(), subseted_dataset.num_examples()', subseted_dataset.num_attributes(), subseted_dataset.num_examples())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L362_C12", "label": "subseted_dataset = Dataset()", "type": "assigned_variable", "loc": [362, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "vector": [14, 3, 0.7168, 0.002, 3, 0.73, 1.0, 184, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "subseted_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " subseted_dataset = Dataset(i,o)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L364_C8", "label": "start_time = time()", "type": "assigned_variable", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.7208, 0.002, 2, 0.28, 0.3077, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L365_C8", "label": "classifier = building_func()", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.7228, 0.002, 2, 0.28, 0.3462, 71, 3, 2, 0, 0, 302, 10, 1], "semantic": {"name": "classifier", "arg_names": [], "import_names": [], "rhs_call_name": "building_func", "annotation": ""}, "snippet": " classifier = building_func(subseted_dataset, **extra_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L366_C8", "label": "append()", "type": "expression", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.7248, 0.002, 2, 0.28, 0.3846, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " build_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L367_C8", "label": "print()", "type": "expression", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.7267, 0.002, 2, 0.28, 0.4231, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"done building...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L372_C8", "label": "count_selected =", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.7366, 0.002, 2, 0.28, 0.4615, 286, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_selected = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "label": "for i, idx", "type": "for", "loc": [373, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [6, 2, 0.7525, 0.0297, 2, 0.28, 0.5, 506, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i, idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, idx in enumerate(subset):\n start_time = time.time()\n if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])\n\n classification_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L374_C12", "label": "start_time = time()", "type": "assigned_variable", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "vector": [14, 3, 0.7406, 0.002, 3, 0.21, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L375_C12", "label": "if", "type": "if", "loc": [375, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "vector": [4, 3, 0.7455, 0.0079, 3, 0.21, 0.2, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L376_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [376, 376], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L375_C12", "vector": [14, 4, 0.7446, 0.002, 4, 0.16, 0.0, 612, 3, 1, 0, 0, 127, 10, 2], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L378_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [378, 378], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L375_C12", "vector": [14, 4, 0.7485, 0.002, 4, 0.16, 1.0, 612, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L380_C12", "label": "append()", "type": "expression", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "vector": [8, 3, 0.7525, 0.002, 3, 0.21, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " classification_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L381_C12", "label": "true_val =", "type": "assigned_variable", "loc": [381, 381], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "vector": [14, 3, 0.7545, 0.002, 3, 0.21, 0.6, 359, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "true_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " true_val = data.outputs[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L382_C12", "label": "if", "type": "if", "loc": [382, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "vector": [4, 3, 0.7594, 0.0079, 3, 0.21, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prediction == true_val:\n count_selected.append(1)\n else:\n count_selected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L383_C16", "label": "append()", "type": "expression", "loc": [383, 383], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L382_C12", "vector": [8, 4, 0.7584, 0.002, 4, 0.39, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_selected.append(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L385_C16", "label": "append()", "type": "expression", "loc": [385, 385], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L382_C12", "vector": [8, 4, 0.7624, 0.002, 4, 0.39, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_selected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L386_C12", "label": "if", "type": "if", "loc": [386, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "vector": [4, 3, 0.7653, 0.004, 3, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i%100 == 0:\n print(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L387_C16", "label": "print()", "type": "expression", "loc": [387, 387], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L386_C12", "vector": [8, 4, 0.7663, 0.002, 4, 0.98, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L388_C8", "label": "count_selected = matrix()", "type": "assigned_variable", "loc": [388, 388], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.7683, 0.002, 2, 0.28, 0.5385, 286, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "count_selected", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " count_selected = np.matrix(count_selected)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L393_C8", "label": "confusion_matrix = dict()", "type": "assigned_variable", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.7782, 0.002, 2, 0.28, 0.5769, 473, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "confusion_matrix", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " confusion_matrix = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L394_C8", "label": "count_unselected =", "type": "assigned_variable", "loc": [394, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.7802, 0.002, 2, 0.28, 0.6154, 49, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_unselected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_unselected = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L395_C8", "label": "print()", "type": "expression", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.7822, 0.002, 2, 0.28, 0.6538, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Total points', total_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "label": "for idx", "type": "for", "loc": [396, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [6, 2, 0.803, 0.0396, 2, 0.28, 0.6923, 187, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx in unselected:\n start_time = time.time()\n if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])\n classification_times.append(time.time() - start_time)\n true_val = data.outputs[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L397_C12", "label": "start_time = time()", "type": "assigned_variable", "loc": [397, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "vector": [14, 3, 0.7861, 0.002, 3, 0.82, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L398_C12", "label": "if", "type": "if", "loc": [398, 401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "vector": [4, 3, 0.7911, 0.0079, 3, 0.82, 0.2, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L399_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [399, 399], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L398_C12", "vector": [14, 4, 0.7901, 0.002, 4, 0.35, 0.0, 612, 3, 1, 0, 0, 127, 10, 2], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L401_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [401, 401], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L398_C12", "vector": [14, 4, 0.7941, 0.002, 4, 0.35, 1.0, 612, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L402_C12", "label": "append()", "type": "expression", "loc": [402, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "vector": [8, 3, 0.796, 0.002, 3, 0.82, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " classification_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L403_C12", "label": "true_val =", "type": "assigned_variable", "loc": [403, 403], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "vector": [14, 3, 0.798, 0.002, 3, 0.82, 0.6, 359, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "true_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " true_val = data.outputs[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L404_C12", "label": "if", "type": "if", "loc": [404, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "vector": [4, 3, 0.803, 0.0079, 3, 0.82, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prediction == true_val:\n count_unselected.append(1)\n else:\n count_unselected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L405_C16", "label": "append()", "type": "expression", "loc": [405, 405], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L404_C12", "vector": [8, 4, 0.802, 0.002, 4, 0.66, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_unselected.append(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L407_C16", "label": "append()", "type": "expression", "loc": [407, 407], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L404_C12", "vector": [8, 4, 0.8059, 0.002, 4, 0.66, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_unselected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "label": "if", "type": "if", "loc": [408, 415], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "vector": [4, 3, 0.8149, 0.0158, 3, 0.82, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confusion_matrix.has_key(true_val[0,0]):\n if confusion_matrix[true_val[0,0]].has_key(prediction[0,0]):\n confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1\n else:\n confusion_matrix[true_val[0,0]][prediction[0,0]] = 1\n else:\n confusion_matrix[true_val[0,0]] = dict()\n confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L409_C16", "label": "if", "type": "if", "loc": [409, 412], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "vector": [4, 4, 0.8129, 0.0079, 4, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confusion_matrix[true_val[0,0]].has_key(prediction[0,0]):\n confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1\n else:\n confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L410_C20", "label": "assign", "type": "assigned_variable", "loc": [410, 410], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L409_C16", "vector": [14, 5, 0.8119, 0.002, 5, 0.84, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L412_C20", "label": "assign", "type": "assigned_variable", "loc": [412, 412], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L409_C16", "vector": [14, 5, 0.8158, 0.002, 5, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L414_C16", "label": " = dict()", "type": "assigned_variable", "loc": [414, 414], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "vector": [14, 4, 0.8198, 0.002, 4, 0.71, 0.5, 0, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]] = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L415_C16", "label": "assign", "type": "assigned_variable", "loc": [415, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "vector": [14, 4, 0.8218, 0.002, 4, 0.71, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L417_C8", "label": "training_error =", "type": "assigned_variable", "loc": [417, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.8257, 0.002, 2, 0.28, 0.7308, 397, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "training_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " training_error = 100.0 * np.sum(count_selected) / float(len(subset))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L418_C8", "label": "testing_error =", "type": "assigned_variable", "loc": [418, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [14, 2, 0.8277, 0.002, 2, 0.28, 0.7692, 939, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "testing_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " testing_error = 100.0 * np.sum(count_unselected) / float(len(unselected))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L419_C8", "label": "append()", "type": "expression", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.8297, 0.002, 2, 0.28, 0.8077, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " testing_errors.append(testing_error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L420_C8", "label": "append()", "type": "expression", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.8317, 0.002, 2, 0.28, 0.8462, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " training_errors.append(training_error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L421_C8", "label": "print()", "type": "expression", "loc": [421, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.8337, 0.002, 2, 0.28, 0.8846, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Correct on training set', training_error, '%')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L422_C8", "label": "print()", "type": "expression", "loc": [422, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.8356, 0.002, 2, 0.28, 0.9231, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(' on testing set', testing_error, '%')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L423_C8", "label": "print()", "type": "expression", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [8, 2, 0.8376, 0.002, 2, 0.28, 0.9615, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Confusion')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "label": "for k", "type": "for", "loc": [424, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "vector": [6, 2, 0.8446, 0.0119, 2, 0.28, 1.0, 954, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in confusion_matrix.keys():\n sum = 0.0\n for k2 in confusion_matrix[k]:\n sum = sum + confusion_matrix[k][k2]\n for k2 in confusion_matrix[k]:\n print('true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L425_C12", "label": "sum =", "type": "assigned_variable", "loc": [425, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "vector": [14, 3, 0.8416, 0.002, 3, 0.36, 0.0, 824, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L426_C12", "label": "for k2", "type": "for", "loc": [426, 427], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "vector": [6, 3, 0.8446, 0.004, 3, 0.36, 0.5, 482, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k2 in confusion_matrix[k]:\n sum = sum + confusion_matrix[k][k2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L427_C16", "label": "sum =", "type": "assigned_variable", "loc": [427, 427], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L426_C12", "vector": [14, 4, 0.8455, 0.002, 4, 0.25, 0.0, 824, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum = sum + confusion_matrix[k][k2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L428_C12", "label": "for k2", "type": "for", "loc": [428, 429], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "vector": [6, 3, 0.8485, 0.004, 3, 0.36, 1.0, 482, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k2 in confusion_matrix[k]:\n print('true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L429_C16", "label": "print()", "type": "expression", "loc": [429, 429], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L428_C12", "vector": [8, 4, 0.8495, 0.002, 4, 0.98, 0.0, 535, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L431_C4", "label": "print_stats", "type": "function", "loc": [431, 433], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [2, 1, 0.8554, 0.0059, 1, 0.59, 0.6667, 764, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "print_stats", "arg_names": ["name", "list_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_stats(name, list_data):\n m = np.matrix(list_data)\n print('%s: average %f std %f' % (name, m.mean(), np.std(m)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L432_C8", "label": "m = matrix()", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L431_C4", "vector": [14, 2, 0.8554, 0.002, 2, 0.59, 0.0, 711, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " m = np.matrix(list_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L433_C8", "label": "print()", "type": "expression", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L431_C4", "vector": [8, 2, 0.8574, 0.002, 2, 0.59, 1.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%s: average %f std %f' % (name, m.mean(), np.std(m)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L435_C4", "label": "print_stats()", "type": "expression", "loc": [435, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [8, 1, 0.8614, 0.002, 1, 0.59, 0.75, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('training error', training_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L436_C4", "label": "print_stats()", "type": "expression", "loc": [436, 436], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [8, 1, 0.8634, 0.002, 1, 0.59, 0.8333, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('testing error', testing_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L437_C4", "label": "print_stats()", "type": "expression", "loc": [437, 437], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [8, 1, 0.8653, 0.002, 1, 0.59, 0.9167, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('build time', build_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L438_C4", "label": "print_stats()", "type": "expression", "loc": [438, 438], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "vector": [8, 1, 0.8673, 0.002, 1, 0.59, 1.0, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('classification time', classification_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "label": "if", "type": "if", "loc": [441, 499], "level": 0, "parent": null, "vector": [4, 0, 0.9307, 0.1168, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 22], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n test_iris = False\n test_pickle = True\n test_number_trees = False\n test_pca = False\n if test_iris:\n #Setup for repeated testing\n iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L442_C4", "label": "test_iris =", "type": "assigned_variable", "loc": [442, 442], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "vector": [14, 1, 0.8752, 0.002, 1, 0.67, 0.0, 354, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_iris", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_iris = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L443_C4", "label": "test_pickle =", "type": "assigned_variable", "loc": [443, 443], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "vector": [14, 1, 0.8772, 0.002, 1, 0.67, 0.2, 507, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_pickle = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L444_C4", "label": "test_number_trees =", "type": "assigned_variable", "loc": [444, 444], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "vector": [14, 1, 0.8792, 0.002, 1, 0.67, 0.4, 359, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_number_trees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_number_trees = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L445_C4", "label": "test_pca =", "type": "assigned_variable", "loc": [445, 445], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "vector": [14, 1, 0.8812, 0.002, 1, 0.67, 0.6, 856, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_pca", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_pca = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "label": "if", "type": "if", "loc": [446, 457], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "vector": [4, 1, 0.8941, 0.0238, 1, 0.67, 0.8, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_iris:\n #Setup for repeated testing\n iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))\n inputs = np.float32(iris_array[:, 0:4]).T\n outputs = iris_array[:, 4].T\n dataset = Dataset(inputs, outputs)\n\n print('================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L448_C8", "label": "iris_array = matrix()", "type": "assigned_variable", "loc": [448, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [14, 2, 0.8871, 0.002, 2, 0.47, 0.0, 112, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "iris_array", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L449_C8", "label": "inputs =", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [14, 2, 0.8891, 0.002, 2, 0.47, 0.1429, 226, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inputs = np.float32(iris_array[:, 0:4]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L450_C8", "label": "outputs =", "type": "assigned_variable", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [14, 2, 0.8911, 0.002, 2, 0.47, 0.2857, 451, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outputs = iris_array[:, 4].T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L451_C8", "label": "dataset = Dataset()", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [14, 2, 0.8931, 0.002, 2, 0.47, 0.4286, 603, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " dataset = Dataset(inputs, outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L453_C8", "label": "print()", "type": "expression", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [8, 2, 0.897, 0.002, 2, 0.47, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L454_C8", "label": "print()", "type": "expression", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [8, 2, 0.899, 0.002, 2, 0.47, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Test DecisionTree\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L455_C8", "label": "evaluate_classifier()", "type": "expression", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [8, 2, 0.901, 0.002, 2, 0.47, 0.8571, 233, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " evaluate_classifier(DecisionTree, dataset, 5, .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L457_C8", "label": "print()", "type": "expression", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "vector": [8, 2, 0.905, 0.002, 2, 0.47, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "label": "if", "type": "if", "loc": [464, 499], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "vector": [4, 1, 0.9535, 0.0713, 1, 0.67, 1.0, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pickle:\n import pickle as pk\n def load_pickle(filename):\n p = open(filename, 'r')\n picklelicious = pk.load(p)\n p.close()\n return picklelicious\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L465_C8", "label": "pickle import pk", "type": "import", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "vector": [1, 2, 0.9208, 0.002, 2, 0.29, 0.0, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pk"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pickle as pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "label": "load_pickle", "type": "function", "loc": [466, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "vector": [2, 2, 0.9267, 0.0099, 2, 0.29, 0.25, 65, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "load_pickle", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_pickle(filename):\n p = open(filename, 'r')\n picklelicious = pk.load(p)\n p.close()\n return picklelicious"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L467_C12", "label": "p = open()", "type": "assigned_variable", "loc": [467, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "vector": [14, 3, 0.9248, 0.002, 3, 0.65, 0.0, 491, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " p = open(filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L468_C12", "label": "picklelicious = load()", "type": "assigned_variable", "loc": [468, 468], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "vector": [14, 3, 0.9267, 0.002, 3, 0.65, 0.3333, 536, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "picklelicious", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " picklelicious = pk.load(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L469_C12", "label": "close()", "type": "expression", "loc": [469, 469], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "vector": [8, 3, 0.9287, 0.002, 3, 0.65, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " p.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L470_C12", "label": "return", "type": "return", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "vector": [13, 3, 0.9307, 0.002, 3, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return picklelicious"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L472_C8", "label": "print_separator", "type": "function", "loc": [472, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "vector": [2, 2, 0.9366, 0.0059, 2, 0.29, 0.5, 564, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print_separator", "arg_names": ["times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_separator(times=2):\n for i in xrange(times):\n print('===============================================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L473_C12", "label": "for i", "type": "for", "loc": [473, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L472_C8", "vector": [6, 3, 0.9376, 0.004, 3, 0.48, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(times):\n print('===============================================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L474_C16", "label": "print()", "type": "expression", "loc": [474, 474], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L473_C12", "vector": [8, 4, 0.9386, 0.002, 4, 0.93, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('===============================================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L476_C8", "label": "dataset = load_pickle()", "type": "assigned_variable", "loc": [476, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "vector": [14, 2, 0.9426, 0.002, 2, 0.29, 0.75, 603, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dataset = load_pickle('PatchClassifier.dataset.pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "label": "if", "type": "if", "loc": [482, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "vector": [4, 2, 0.9713, 0.0356, 2, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_number_trees:\n tree_types = [RFBreiman, RFRandomInputSubset]\n #tree_types = [RFBreiman]\n for tree_type in tree_types:\n print_separator()\n print('Testing', tree_type)\n for i in range(10):\n print(tree_type, 'using', (i+1)*10, 'trees')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L483_C12", "label": "tree_types =", "type": "assigned_variable", "loc": [483, 483], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "vector": [14, 3, 0.9564, 0.002, 3, 0.84, 0.0, 631, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tree_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree_types = [RFBreiman, RFRandomInputSubset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "label": "for tree_type", "type": "for", "loc": [485, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "vector": [6, 3, 0.9663, 0.0139, 3, 0.84, 0.3333, 782, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "tree_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tree_type in tree_types:\n print_separator()\n print('Testing', tree_type)\n for i in range(10):\n print(tree_type, 'using', (i+1)*10, 'trees')\n evaluate_classifier(tree_type, dataset, 3, .95, \n extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L486_C16", "label": "print_separator()", "type": "expression", "loc": [486, 486], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "vector": [8, 4, 0.9624, 0.002, 4, 0.19, 0.0, 564, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "print_separator", "arg_names": [], "import_names": [], "rhs_call_name": "print_separator", "annotation": ""}, "snippet": " print_separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L487_C16", "label": "print()", "type": "expression", "loc": [487, 487], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "vector": [8, 4, 0.9644, 0.002, 4, 0.19, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Testing', tree_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L488_C16", "label": "for i", "type": "for", "loc": [488, 491], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "vector": [6, 4, 0.9693, 0.0079, 4, 0.19, 1.0, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n print(tree_type, 'using', (i+1)*10, 'trees')\n evaluate_classifier(tree_type, dataset, 3, .95, \n extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L489_C20", "label": "print()", "type": "expression", "loc": [489, 489], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L488_C16", "vector": [8, 5, 0.9683, 0.002, 5, 0.34, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tree_type, 'using', (i+1)*10, 'trees')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L490_C20", "label": "evaluate_classifier()", "type": "expression", "loc": [490, 491], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L488_C16", "vector": [8, 5, 0.9713, 0.004, 5, 0.34, 1.0, 233, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " evaluate_classifier(tree_type, dataset, 3, .95, \n extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L493_C12", "label": "tree_types =", "type": "assigned_variable", "loc": [493, 493], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "vector": [14, 3, 0.9762, 0.002, 3, 0.84, 0.6667, 631, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tree_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree_types = [RFBreiman, RFRandomInputSubset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "label": "for tree_type", "type": "for", "loc": [495, 499], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "vector": [6, 3, 0.9842, 0.0099, 3, 0.84, 1.0, 782, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tree_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tree_type in tree_types:\n print_separator()\n print(tree_type)\n evaluate_classifier(tree_type, dataset, 10, .95, \n extra_args={'number_of_learners': 70}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L496_C16", "label": "print_separator()", "type": "expression", "loc": [496, 496], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "vector": [8, 4, 0.9822, 0.002, 4, 0.61, 0.0, 564, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "print_separator", "arg_names": [], "import_names": [], "rhs_call_name": "print_separator", "annotation": ""}, "snippet": " print_separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L497_C16", "label": "print()", "type": "expression", "loc": [497, 497], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "vector": [8, 4, 0.9842, 0.002, 4, 0.61, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tree_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L498_C16", "label": "evaluate_classifier()", "type": "expression", "loc": [498, 499], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "vector": [8, 4, 0.9871, 0.004, 4, 0.61, 1.0, 233, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " evaluate_classifier(tree_type, dataset, 10, .95, \n extra_args={'number_of_learners': 70}, test_pca=test_pca)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L150_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L149_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L179_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L180_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L179_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L181_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L165_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L190_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:While_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L199_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L218_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L231_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L237_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L238_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L237_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L241_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L243_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L249_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L224_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L264_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L264_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L265_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L265_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L266_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L293_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L296_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L304_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L306_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L307_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L297_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:ClassDef_L311_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L318_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L319_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L320_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L321_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L325_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L340_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L342_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L355_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L357_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L359_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L354_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L362_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L375_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L376_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L375_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L378_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L382_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L383_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L382_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L385_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L386_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L387_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L398_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L399_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L398_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L401_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L403_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L404_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L404_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L405_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L404_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L407_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L396_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L409_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L409_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L410_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L409_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L412_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L414_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L408_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L415_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L417_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L425_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L426_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L427_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L424_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L429_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L435_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L436_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L330_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L438_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L442_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L444_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L445_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L446_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L441_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Import_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L467_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L468_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L466_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Return_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:FunctionDef_L472_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L473_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L473_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L474_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L464_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L483_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L486_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L487_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L485_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L488_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L488_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L489_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L488_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L490_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Assign_L493_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L496_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L497_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99223:For_L495_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99223:Expr_L498_C16"}] |
#from sound_play.libsoundplay import SoundClient
import hrl_lib.tf_utils as tfu
from std_msgs.msg import String
import rospy
import tf
import subprocess as sb
import numpy as np
import geometry_msgs.msg as gms
import os
class LaserPointerClient:
def __init__(self, target_frame='/base_link', tf_listener=None):
self.dclick_cbs = []
self.point_cbs = []
self.target_frame = target_frame
self.laser_point_base = None
self.base_sound_path = (sb.Popen(["rospack", "find", "laser_interface"], stdout=sb.PIPE).communicate()[0]).strip()
#self.sound = SoundClient()
if tf_listener == None:
self.tf_listener = tf.TransformListener()
else:
self.tf_listener = tf_listener
rospy.Subscriber('cursor3d', gms.PointStamped, self.laser_point_handler)
self.double_click = rospy.Subscriber('mouse_left_double_click', String, self.double_click_cb)
os.system("aplay %s" % (self.base_sound_path + '/sounds/beep_beep.wav'))
#self.sound.waveSound().play()
def transform_point(self, point_stamped):
point_head = point_stamped.point
#Tranform into base link
base_T_head = tfu.transform(self.target_frame, point_stamped.header.frame_id, self.tf_listener)
point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])
point_mat_base = base_T_head * point_mat_head
t_base, _ = tfu.matrix_as_tf(point_mat_base)
return np.matrix(t_base).T
def laser_point_handler(self, point_stamped):
#self.sound.waveSound(self.base_sound_path + '/sounds/blow.wav').play()
#os.system("aplay %s" % (self.base_sound_path + '/sounds/beeeeeep.wav'))
self.laser_point_base = self.transform_point(point_stamped)
for f in self.point_cbs:
f(self.laser_point_base)
def double_click_cb(self, a_str):
rospy.loginfo('Double CLICKED')
#self.sound.waveSound(self.base_sound_path + '/sounds/beep.wav').play()
os.system("aplay %s" % (self.base_sound_path + '/sounds/beep_beep.wav'))
#if self.laser_point_base != None:
for f in self.dclick_cbs:
f(self.laser_point_base)
self.laser_point_base = None
def add_double_click_cb(self, func):
self.dclick_cbs.append(func)
def add_point_cb(self, func):
self.point_cbs.append(func)
| ajibawa-2023/Python-Code-Large/train/row_99224 | 42 | 62 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L2_C0", "label": "hrl_lib.tf_utils import tfu", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.0161, 0, 0.66, 0.0, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "hrl_lib.tf_utils", "arg_names": [], "import_names": ["tfu"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.tf_utils as tfu"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:ImportFrom_L3_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0484, 0.0161, 0, 0.66, 0.125, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["String"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import String"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0645, 0.0161, 0, 0.66, 0.25, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L5_C0", "label": "tf import tf", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0806, 0.0161, 0, 0.66, 0.375, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L7_C0", "label": "subprocess import sb", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1129, 0.0161, 0, 0.66, 0.5, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["sb"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess as sb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.129, 0.0161, 0, 0.66, 0.625, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L9_C0", "label": "geometry_msgs.msg import gms", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1452, 0.0161, 0, 0.66, 0.75, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["gms"], "rhs_call_name": "", "annotation": ""}, "snippet": "import geometry_msgs.msg as gms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Import_L10_C0", "label": "os import os", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1613, 0.0161, 0, 0.66, 0.875, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "label": "LaserPointerClient", "type": "class", "loc": [12, 62], "level": 0, "parent": null, "vector": [3, 0, 0.5968, 0.8226, 0, 0.66, 1.0, 6, 0, 6, 0, 0, 0, 0, 18], "semantic": {"name": "LaserPointerClient", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LaserPointerClient:\n\n def __init__(self, target_frame='/base_link', tf_listener=None):\n self.dclick_cbs = []\n self.point_cbs = []\n self.target_frame = target_frame\n self.laser_point_base = None\n self.base_sound_path = (sb.Popen([\"rospack\", \"find\", \"laser_interface\"], stdout=sb.PIPE).communicate()[0]).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "label": "__init__", "type": "function", "loc": [14, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "vector": [2, 1, 0.3468, 0.2581, 1, 0.6, 0.0, 555, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "target_frame", "tf_listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, target_frame='/base_link', tf_listener=None):\n self.dclick_cbs = []\n self.point_cbs = []\n self.target_frame = target_frame\n self.laser_point_base = None\n self.base_sound_path = (sb.Popen([\"rospack\", \"find\", \"laser_interface\"], stdout=sb.PIPE).communicate()[0]).strip()\n #self.sound = SoundClient()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L15_C8", "label": "self.dclick_cbs =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [14, 2, 0.2419, 0.0161, 2, 0.49, 0.0, 909, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.dclick_cbs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dclick_cbs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L16_C8", "label": "self.point_cbs =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [14, 2, 0.2581, 0.0161, 2, 0.49, 0.125, 608, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.point_cbs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.point_cbs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L17_C8", "label": "self.target_frame =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [14, 2, 0.2742, 0.0161, 2, 0.49, 0.25, 130, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.target_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.target_frame = target_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L18_C8", "label": "self.laser_point_base =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [14, 2, 0.2903, 0.0161, 2, 0.49, 0.375, 406, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.laser_point_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.laser_point_base = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L19_C8", "label": "self.base_sound_path = strip()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [14, 2, 0.3065, 0.0161, 2, 0.49, 0.5, 232, 3, 0, 0, 0, 973, 10, 3], "semantic": {"name": "self.base_sound_path", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " self.base_sound_path = (sb.Popen([\"rospack\", \"find\", \"laser_interface\"], stdout=sb.PIPE).communicate()[0]).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:If_L22_C8", "label": "if", "type": "if", "loc": [22, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [4, 2, 0.379, 0.0645, 2, 0.49, 0.625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tf_listener == None:\n self.tf_listener = tf.TransformListener()\n else:\n self.tf_listener = tf_listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L23_C12", "label": "self.tf_listener = TransformListener()", "type": "assigned_variable", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:If_L22_C8", "vector": [14, 3, 0.371, 0.0161, 3, 0.53, 0.0, 639, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_listener = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L25_C12", "label": "self.tf_listener =", "type": "assigned_variable", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:If_L22_C8", "vector": [14, 3, 0.4032, 0.0161, 3, 0.53, 1.0, 639, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tf_listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tf_listener = tf_listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L27_C8", "label": "Subscriber()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [8, 2, 0.4355, 0.0161, 2, 0.49, 0.75, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('cursor3d', gms.PointStamped, self.laser_point_handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L28_C8", "label": "self.double_click = Subscriber()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [14, 2, 0.4516, 0.0161, 2, 0.49, 0.875, 256, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.double_click", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.double_click = rospy.Subscriber('mouse_left_double_click', String, self.double_click_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L29_C8", "label": "system()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "vector": [8, 2, 0.4677, 0.0161, 2, 0.49, 1.0, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(\"aplay %s\" % (self.base_sound_path + '/sounds/beep_beep.wav'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "label": "transform_point", "type": "function", "loc": [33, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "vector": [2, 1, 0.5887, 0.129, 1, 0.6, 0.2, 911, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "transform_point", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_point(self, point_stamped):\n point_head = point_stamped.point\n #Tranform into base link\n base_T_head = tfu.transform(self.target_frame, point_stamped.header.frame_id, self.tf_listener)\n point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])\n point_mat_base = base_T_head * point_mat_head\n t_base, _ = tfu.matrix_as_tf(point_mat_base)\n return np.matrix(t_base).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L34_C8", "label": "point_head =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "vector": [14, 2, 0.5484, 0.0161, 2, 0.49, 0.0, 553, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_head = point_stamped.point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L36_C8", "label": "base_T_head = transform()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "vector": [14, 2, 0.5806, 0.0161, 2, 0.49, 0.2, 683, 3, 3, 0, 0, 48, 10, 1], "semantic": {"name": "base_T_head", "arg_names": [], "import_names": [], "rhs_call_name": "transform", "annotation": ""}, "snippet": " base_T_head = tfu.transform(self.target_frame, point_stamped.header.frame_id, self.tf_listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L37_C8", "label": "point_mat_head = translation_matrix()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "vector": [14, 2, 0.5968, 0.0161, 2, 0.49, 0.4, 237, 3, 1, 0, 0, 868, 10, 1], "semantic": {"name": "point_mat_head", "arg_names": [], "import_names": [], "rhs_call_name": "translation_matrix", "annotation": ""}, "snippet": " point_mat_head = tfu.translation_matrix([point_head.x, point_head.y, point_head.z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L38_C8", "label": "point_mat_base =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "vector": [14, 2, 0.6129, 0.0161, 2, 0.49, 0.6, 970, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point_mat_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point_mat_base = base_T_head * point_mat_head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L39_C8", "label": "t_base, _ = matrix_as_tf()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "vector": [14, 2, 0.629, 0.0161, 2, 0.49, 0.8, 448, 3, 1, 0, 0, 22, 10, 1], "semantic": {"name": "t_base, _", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_as_tf", "annotation": ""}, "snippet": " t_base, _ = tfu.matrix_as_tf(point_mat_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "vector": [13, 2, 0.6452, 0.0161, 2, 0.49, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(t_base).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L42_C4", "label": "laser_point_handler", "type": "function", "loc": [42, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "vector": [2, 1, 0.7177, 0.0968, 1, 0.6, 0.4, 910, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "laser_point_handler", "arg_names": ["self", "point_stamped"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def laser_point_handler(self, point_stamped):\n #self.sound.waveSound(self.base_sound_path + '/sounds/blow.wav').play()\n #os.system(\"aplay %s\" % (self.base_sound_path + '/sounds/beeeeeep.wav'))\n self.laser_point_base = self.transform_point(point_stamped)\n for f in self.point_cbs:\n f(self.laser_point_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L45_C8", "label": "self.laser_point_base = transform_point()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L42_C4", "vector": [14, 2, 0.7258, 0.0161, 2, 0.28, 0.0, 406, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "self.laser_point_base", "arg_names": [], "import_names": [], "rhs_call_name": "transform_point", "annotation": ""}, "snippet": " self.laser_point_base = self.transform_point(point_stamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L46_C8", "label": "for f", "type": "for", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L42_C4", "vector": [6, 2, 0.75, 0.0323, 2, 0.28, 1.0, 899, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in self.point_cbs:\n f(self.laser_point_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L47_C12", "label": "f()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L46_C8", "vector": [8, 3, 0.7581, 0.0161, 3, 0.6, 0.0, 899, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "f", "annotation": ""}, "snippet": " f(self.laser_point_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "label": "double_click_cb", "type": "function", "loc": [49, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "vector": [2, 1, 0.8468, 0.129, 1, 0.6, 0.6, 645, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "double_click_cb", "arg_names": ["self", "a_str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def double_click_cb(self, a_str):\n rospy.loginfo('Double CLICKED')\n #self.sound.waveSound(self.base_sound_path + '/sounds/beep.wav').play()\n os.system(\"aplay %s\" % (self.base_sound_path + '/sounds/beep_beep.wav'))\n #if self.laser_point_base != None:\n for f in self.dclick_cbs:\n f(self.laser_point_base)\n self.laser_point_base = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L50_C8", "label": "loginfo()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "vector": [8, 2, 0.8065, 0.0161, 2, 0.27, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo('Double CLICKED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L52_C8", "label": "system()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "vector": [8, 2, 0.8387, 0.0161, 2, 0.27, 0.3333, 856, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " os.system(\"aplay %s\" % (self.base_sound_path + '/sounds/beep_beep.wav'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L54_C8", "label": "for f", "type": "for", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "vector": [6, 2, 0.879, 0.0323, 2, 0.27, 0.6667, 899, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in self.dclick_cbs:\n f(self.laser_point_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L55_C12", "label": "f()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L54_C8", "vector": [8, 3, 0.8871, 0.0161, 3, 0.95, 0.0, 899, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "f", "annotation": ""}, "snippet": " f(self.laser_point_base)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L56_C8", "label": "self.laser_point_base =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "vector": [14, 2, 0.9032, 0.0161, 2, 0.27, 1.0, 406, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.laser_point_base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.laser_point_base = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L58_C4", "label": "add_double_click_cb", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "vector": [2, 1, 0.9435, 0.0323, 1, 0.6, 0.8, 164, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_double_click_cb", "arg_names": ["self", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_double_click_cb(self, func):\n self.dclick_cbs.append(func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L59_C8", "label": "append()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L58_C4", "vector": [8, 2, 0.9516, 0.0161, 2, 0.94, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.dclick_cbs.append(func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L61_C4", "label": "add_point_cb", "type": "function", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "vector": [2, 1, 0.9919, 0.0323, 1, 0.6, 1.0, 961, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_point_cb", "arg_names": ["self", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_point_cb(self, func):\n self.point_cbs.append(func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L62_C8", "label": "append()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L61_C4", "vector": [8, 2, 1.0, 0.0161, 2, 0.15, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.point_cbs.append(func)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:If_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:If_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:If_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:For_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99224:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99224:Expr_L62_C8"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
import os
import sys
import camera as cam
import re
import time
import random_forest as rf
#import opencv as cv
#import opencv.highgui as hg
import cv
import util as ut
from laser_detector import *
def count_down(times=3):
for i in range(times):
print 'in ', times - i
time.sleep(1)
def evaluate_classifier():
rf.evaluate_classifier(rf.RFBreiman, load_pickle('PatchClassifier.dataset.pickle'), 1, .7)
def show_processed(image, masks, detection, blobs, detector):
masker = Mask(image)
splitter = SplitColors(image)
r, g, b = splitter.split(image)
thresholded_image = masker.mask(masks[0], r, g, b)
draw_detection(thresholded_image, detection)
cv.ShowImage('thresholded', thresholded_image)
draw_detection(image, detection)
draw_blobs(image, blobs)
make_visible_binary_image(masks[0])
draw_detection(masks[0], detection)
make_visible_binary_image(masks[1])
make_visible_binary_image(masks[2])
cv.ShowImage("video", image)
cv.ShowImage('motion', masks[1])
cv.ShowImage('intensity', masks[2])
key = cv.WaitKey(10)
if detector != None:
if key == 'T': #down
detector.intensity_filter.thres_high = detector.intensity_filter.thres_high - 5
print 'detector.intensity_filter.thres =', detector.intensity_filter.thres_high
if key == 'R':
detector.intensity_filter.thres_high = detector.intensity_filter.thres_high + 5
print 'detector.intensity_filter.thres =', detector.intensity_filter.thres_high
if key == ' ':
cv.WaitKey()
def confirmation_prompt(confirm_phrase):
print confirm_phrase
print 'y(es)/n(no)'
k = cv.WaitKey()
if k == 'y':
return True
else:
return False
def learn_run(exposure = LaserPointerDetector.SUN_EXPOSURE, num_examples_to_collect=200, display_during_run = True):
cv.NamedWindow("video", 1)
cv.NamedWindow("thresholded", 1)
cv.NamedWindow('motion', 1)
cv.NamedWindow('intensity', 1)
cv.MoveWindow("video", 0, 0)
cv.MoveWindow("thresholded", 800, 0)
cv.MoveWindow("intensity", 0, 600)
cv.MoveWindow("motion", 800, 600)
#TODO: plug in some image source
#video = cam.VidereStereo(0, gain=96, exposure=exposure)
frames = video.next()
detector = LaserPointerDetector(frames[0], exposure=exposure,
dataset=PatchClassifier.DEFAULT_DATASET_FILE,
use_color=False, use_learning=False)
detector2 = LaserPointerDetector(frames[1], exposure=exposure,
dataset=PatchClassifier.DEFAULT_DATASET_FILE,
use_color=False, use_learning=False)
def append_examples_to_file(dataset, file = PatchClassifier.DEFAULT_DATASET_FILE):
try:
loaded_set = load_pickle(file)
dataset.append(loaded_set)
except IOError:
pass
dump_pickle(dataset, file)
print 'Saved examples!'
#Gather positive examples from laser detector
if confirmation_prompt('gather positive examples?'):
print 'Lets gather some positive examples... we need', num_examples_to_collect, 'examples'
positive_examples_for_classifier = []
count_down(0)
for i in xrange(10):
frames = video.next()
detector.detect(frames[0])
detector2.detect(frames[1])
for img in video:
image = None
combined = None
motion = None
intensity = None
laser_blob = None
intensity_motion_blob = None
for raw_image, detect in zip(img, [detector, detector2]):
before = time.time()
image, combined, laser_blob, intensity_motion_blob = detect.detect(raw_image)
diff = time.time() - before
#print 'took %.2f seconds to run or %.2f fps' % (diff, 1.0/diff)
if laser_blob != None:
instance = blob_to_input_instance(image, laser_blob)
if instance is not None:
positive_examples_for_classifier.append(instance)
print 'got', len(positive_examples_for_classifier), 'instances'
motion, intensity = detect.get_motion_intensity_images()
show_processed(image, [combined, motion, intensity], laser_blob, intensity_motion_blob, detector2)
if len(positive_examples_for_classifier) > num_examples_to_collect:
break
positive_instances_dataset = matrix_to_dataset(ut.list_mat_to_mat(positive_examples_for_classifier, axis=1))
append_examples_to_file(positive_instances_dataset)
if confirmation_prompt('gather negative examples?'):
#Gather negative examples from laser detector
print 'lets gather some negative examples... we need', num_examples_to_collect,' examples'
negative_examples_for_classifier = []
count_down(10)
for i in xrange(10):
frames = video.next()
detector.detect(frames[0])
detector2.detect(frames[1])
for img in video:
image = None
combined = None
motion = None
intensity = None
laser_blob = None
intensity_motion_blob = None
for raw_image, detect in zip(img, [detector, detector2]):
image, combined, laser_blob, intensity_motion_blob = detect.detect(raw_image)
if laser_blob != None:
instance = blob_to_input_instance(image, laser_blob)
if instance is not None:
negative_examples_for_classifier.append(instance)
print 'got', len(negative_examples_for_classifier), 'instances'
motion, intensity = detect.get_motion_intensity_images()
show_processed(image, [combined, motion, intensity], laser_blob, intensity_motion_blob, detector2)
if len(negative_examples_for_classifier) > (num_examples_to_collect*2):
break
negative_instances_dataset = matrix_to_dataset(ut.list_mat_to_mat(negative_examples_for_classifier, axis=1))
append_examples_to_file(negative_instances_dataset)
if confirmation_prompt('run classifier?'):
run(exposure, video = video, display=display_during_run)
def run(exposure, video=None, display=False, debug=False):
if display:
cv.NamedWindow("video", 1)
cv.MoveWindow("video", 0, 0)
if debug:
cv.NamedWindow('right', 1)
cv.MoveWindow("right", 800, 0)
cv.NamedWindow("thresholded", 1)
cv.NamedWindow('motion', 1)
cv.NamedWindow('intensity', 1)
cv.MoveWindow("thresholded", 800, 0)
cv.MoveWindow("intensity", 0, 600)
cv.MoveWindow("motion", 800, 600)
if video is None:
#video = cam.VidereStereo(0, gain=96, exposure=exposure)
video = cam.StereoFile('measuring_tape_red_left.avi','measuring_tape_red_right.avi')
frames = video.next()
detector = LaserPointerDetector(frames[0], LaserPointerDetector.SUN_EXPOSURE,
use_color=False, use_learning=True)
detector_right = LaserPointerDetector(frames[1], LaserPointerDetector.SUN_EXPOSURE,
use_color=False, use_learning=True, classifier=detector.classifier)
stereo_cam = cam.KNOWN_CAMERAS['videre_stereo2']
for i in xrange(10):
frames = video.next()
detector.detect(frames[0])
detector_right.detect(frames[1])
lt = cv.CreateImage((640,480), 8, 3)
rt = cv.CreateImage((640,480), 8, 3)
for l, r in video:
start_time = time.time()
#l = stereo_cam.camera_left.undistort_img(l)
#r = stereo_cam.camera_right.undistort_img(r)
cv.Copy(l, lt)
cv.Copy(r, rt)
l = lt
r = rt
undistort_time = time.time()
_, _, right_cam_detection, stats = detector_right.detect(r)
if debug:
draw_blobs(r, stats)
draw_detection(r, right_cam_detection)
cv.ShowImage('right', r)
image, combined, left_cam_detection, stats = detector.detect(l)
detect_time = time.time()
if debug:
motion, intensity = detector.get_motion_intensity_images()
show_processed(l, [combined, motion, intensity], left_cam_detection, stats, detector)
elif display:
#draw_blobs(l, stats)
draw_detection(l, left_cam_detection)
cv.ShowImage('video', l)
cv.WaitKey(10)
if right_cam_detection != None and left_cam_detection != None:
x = np.matrix(left_cam_detection['centroid']).T
xp = np.matrix(right_cam_detection['centroid']).T
result = stereo_cam.triangulate_3d(x, xp)
print '3D point located at', result['point'].T,
print 'distance %.2f error %.3f' % (np.linalg.norm(result['point']), result['error'])
triangulation_time = time.time()
diff = time.time() - start_time
print 'Main: Running at %.2f fps, took %.4f s' % (1.0 / diff, diff)
#print ' undistort took %.4f s' % (undistort_time - start_time)
#print ' detection took %.4f s' % (detect_time - undistort_time)
#print ' triangulation took %.4f s' % (triangulation_time - detect_time)
if __name__ == '__main__':
exposure = 0
if sys.argv[2] == 'sun':
exposure = LaserPointerDetector.SUN_EXPOSURE
print 'sun exposure!'
else:
exposure = LaserPointerDetector.NO_SUN_EXPOSURE
if sys.argv[1] == 'run':
print 'Running only...'
run(exposure = exposure, display = True)
if sys.argv[1] == 'learn':
print 'Running only...'
learn_run(exposure = exposure)
##=================================================================================================
##=================================================================================================
#def display_single(detection_source, mask_window='masked', detection_window='cam'):
# for frame, mask, loc, blobs in detection_source:
# make_visible_binary_image(mask)
# hg.cvShowImage(mask_window, mask)
# draw_detection(frame, loc)
# hg.cvShowImage(detection_window, frame)
# hg.cvWaitKey(10)
# yield frame, mask, loc, blobs
#def save_detection(prefix, frame_number, detection_bundle):
# #frame_number = 1
# #for frame, mask, loc, blobs in detection_source:
# frame, mask, loc, blobs = detection_bundle
# frame_name = prefix + 'frame' + str(frame_number) + '.png'
# hg.cvSaveImage(frame_name, frame)
# hg.cvSaveImage(prefix + 'frame' + str(frame_number) + '_mask.png', mask)
#
# pickle_file = open(prefix + 'frame' + str(frame_number) + '.pickle', 'w')
# pk.dump(loc, pickle_file)
# pickle_file.close()
#
# pickle_file = open(prefix + 'frame' + str(frame_number) + '_blobs.pickle', 'w')
# pk.dump(blobs, pickle_file)
# pickle_file.close()
#
# #frame_number = frame_number + 1
# #yield frame, mask, loc, blobs
# return frame, mask, loc, blobs
##=================================================================================================
##=================================================================================================
#def record_videos(stereo, prefix, folder):
# videos = []
# MPEG4 = 0x58564944
# count = 0
# while True:
# key = hg.cvWaitKey()
# while key != ' ':
# key = hg.cvWaitKey()
# left_file = folder + '/' + prefix+str(count) + '_left.avi'
# right_file = folder + '/' + prefix+str(count) + '_right.avi'
# lwrite = hg.cvCreateVideoWriter(left_file, MPEG4, 30, cvSize(640,480))
# rwrite = hg.cvCreateVideoWriter(right_file, MPEG4, 30, cvSize(640,480))
# for left, right in stereo:
# hg.cvWriteFrame(lwrite, left)
# hg.cvWriteFrame(rwrite, right)
# hg.cvShowImage('cam', left)
# key = hg.cvWaitKey(10)
# if key == ' ':
# break
# count = count + 1
# videos.append(left_file)
# videos.append(right_file)
#
# print 'Do you want to record another clip?'
# key = hg.cvWaitKey()
# if key == 'y':
# continue
# if key == 'n':
# break
# return videos
#def record_learn(session_name):
# '''
# NOTE: THIS SET OF FUNCTIONS NEED TO BE TESTED
# '''
# os.mkdir(session_name)
# hg.cvNamedWindow('cam', 1)
# sample_image = cv.cvCreateImage(cv.cvSize(640,480), 8, 3)
# hg.cvShowImage('cam', image)
# video = cam.VidereStereo(0, gain=96, exposure=LaserPointerDetector.SUN_EXPOSURE)
#
# print 'Let\'s gather positive examples, press space bar then point the laser pointer',
# print ' at various objects. Remember to not move the camera! Press spacebar again to stop.'
# positive_files = record_videos(video, 'positive', session_name)
#
# print 'Let\'s gather negative examples, press space bar then point the laser pointer',
# print ' at various objects. Remember to not move the camera! Press spacebar again to stop.'
# negative_files = record_videos(video, 'negative', session_name)
#
# print 'Performing detections, writing out images...'
# files_sets = [('positive/', positive_files), ('negative/', negative_files)]
# for label, files in files_sets:
# start_dir = session_name + '/' + label
# os.mkdir(start_dir)
# idx = 0
# for pair in files:
# for file in pair:
# video = cam.video_file(file)
# detector = LaserPointerDetector(cv.cvCreateImage(cv.cvSize(640,480), 8, 3), use_color=False, use_learning=False)
# frame_number = 0
# for img in video:
# image, mask, laser_blob, intensity_motion_blob = detector.detect(img)
# save_detection(start_dir + str(idx), frame_number, (image, mask, laser_blob, intensity_motion_blob))
# frame_number = frame_number + 1
# idx = idx + 1
#
# print 'running color learner'
# run_color_learner(session_name + '/positive')
#
# print 'running forest learner...'
# run_forest_learner(session_name)
##=================================================================================================
##=================================================================================================
#def as_iter_block(func, input):
# for p in input:
# yield func(p)
#def get_frames_from_folder(folder):
#
# def files_in(folder):
# root, dirs, files = os.walk(folder).next()
# return root, files
#
# def dir_in(folder):
# root, dirs, files = os.walk(folder).next()
# return root, dirs
#
# def select_frames(reg, name):
# return None != reg.match(name)
#
# def append_pref(pref, file):
# return pref + '/' + file
#
# reg = re.compile('\dframe\d*\.png')
# root, files = files_in(folder)
# selected_files = map(ft.partial(append_pref, root), filter(ft.partial(select_frames, reg), files))
# return selected_files
#def run_color_learner(folder):
# cf = ColorFilter((640,480))
# def bw_img_loader(filename):
# return hg.cvLoadImage(filename, hg.CV_LOAD_IMAGE_GRAYSCALE)
# files = get_frames_from_folder(folder)
# cf.learn_sequence(it.izip(cam.file_sequence(selected_files, hg.cvLoadImage),
# cam.file_sequence(selected_files, bw_img_loader, '_mask.png'),
# cam.file_sequence(selected_files, load_pickle, '.pickle')))
#def run_forest_learner(folder):
# pfiles = get_frames_from_folder(folder + '/positive')
# nfiles = get_frames_from_folder(folder + '/negative')
# pc = PatchClassifier()
# pc.learn(positive_examples = it.izip(cam.file_sequence(pfiles, hg.cvLoadImage),
# cam.file_sequence(pfiles, load_pickle, '_blobs.pickle')),
# negative_examples = it.izip(cam.file_sequence(nfiles, hg.cvLoadImage),
# cam.file_sequence(nfiles, load_pickle, '_blobs.pickle')))
##=================================================================================================
##=================================================================================================
#run(exposure = LaserPointerDetector.SUN_EXPOSURE)
#import sys
#session_name = sys.argv[1]
#record_learn(session_name)
##=================================================================================================
##=================================================================================================
## SAND BOX
##=================================================================================================
##=================================================================================================
## ===> Sand!
#def triangulate_cressel(camera, left_coord, right_coord, return_dict = True ):
# """ left_coord, right_coord -> cvPoint
# returns -> (3X1) vector in stereohead coordinate frame, error.
# stereohead coord frame is as defined in transforms.py
# code copied and modified slightly from self.get_3d_coord
# """
#
# right_point = cv.cvCreateMat(3,1,cv.CV_32F)
# left_point = cv.cvCreateMat(3,1,cv.CV_32F)
#
# if left_coord.__class__ == cv.cvPoint(0,0).__class__:
# left_point[0] = float(left_coord.x) # u
# left_point[1] = float(left_coord.y) # v
#
# left_point[2] = 1.0
# else:
# left_point[0] = float(left_coord[0]) # u
# left_point[1] = float(left_coord[1]) # v
# left_point[2] = 1.0
#
# if right_coord.__class__ == cv.cvPoint(0,0).__class__:
# right_point[0] = float(right_coord.x)
# right_point[1] = float(right_coord.y)
# right_point[2] = 1.0
# else:
# right_point[0] = float(right_coord[0])
# right_point[1] = float(right_coord[1])
# right_point[2] = 1.0
# # in the normalized image plane _point is the vector denoted as [ u; v; 1 ]
#
# right_vector = cv.cvCreateMat(3,1,cv.CV_32F)
# left_vector = cv.cvCreateMat(3,1,cv.CV_32F)
# output_vector = cv.cvCreateMat(3,1,cv.CV_32F)
#
# left_inv_intrinsic = camera.camera_left.inv_intrinsic_mat_cv
# right_inv_intrinsic = camera.camera_right.inv_intrinsic_mat_cv
# cv.cvGEMM(left_inv_intrinsic , left_point, 1, None, 1, left_vector, 0)
# cv.cvGEMM(right_inv_intrinsic, right_point, 1, None, 1, right_vector, 0)
#
# lv = np.matrix([left_vector[0], left_vector[1], left_vector[2]]).T
# rv = np.matrix([right_vector[0], right_vector[1], right_vector[2]]).T
#
# te = camera.R * lv
#
# a = cv.cvCreateMat( 3, 2, cv.CV_32F )
# a[0,0], a[1,0], a[2,0] = te[0,0], te[1,0], te[2,0]
# a[0,1], a[1,1], a[2,1] = rv[0,0], rv[1,0], rv[2,0]
#
# params = cv.cvCreateMat( 2, 1, cv.CV_32F )
#
# #linear least squares [X1 -X2]*[al;bet] - trans ~ 0
# # [left right]*[params] -translation ~0
# translation = cv.cvCreateMat(3,1,cv.CV_32F)
# translation[0] = -camera.T[0,0]
# translation[1] = -camera.T[1,0]
# translation[2] = -camera.T[2,0]
#
# cv.cvSolve( a, translation, params , cv.CV_SVD )
# alpha = params[0]
# beta = -params[1]
#
# vec_l = alpha * te + camera.T
# vec_r = beta * rv
#
# #compute reprojection error
# detection_error = np.linalg.norm(vec_r-vec_l)
#
# p = (vec_l + vec_r)/2.
#
# p = np.row_stack((p, np.matrix([1.])))
# # my xyz and cressel's are aligned and so I can use the
# # same transformation matrix -- advait
# #p = tr._stereoT['right'] * p
# p = p[0:3]/p[3,0]
#
# if return_dict:
# return {'output_vector': p, 'error':detection_error}
# else:
# return p, detection_error
##=================================================================================================
##=================================================================================================
| ajibawa-2023/Python-Code-Large/train/row_99225 | 191 | 566 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L29_C0", "label": "os import os", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0512, 0.0018, 0, 0.66, 0.0, 688, 0, 1, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L30_C0", "label": "sys import sys", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.053, 0.0018, 0, 0.66, 0.0667, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L31_C0", "label": "camera import cam", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0548, 0.0018, 0, 0.66, 0.1333, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L32_C0", "label": "re import re", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0565, 0.0018, 0, 0.66, 0.2, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L33_C0", "label": "time import time", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0583, 0.0018, 0, 0.66, 0.2667, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L34_C0", "label": "random_forest import rf", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0601, 0.0018, 0, 0.66, 0.3333, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "random_forest", "arg_names": [], "import_names": ["rf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import random_forest as rf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L37_C0", "label": "cv import cv", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0654, 0.0018, 0, 0.66, 0.4, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Import_L38_C0", "label": "util import ut", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0671, 0.0018, 0, 0.66, 0.4667, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:ImportFrom_L39_C0", "label": "from laser_detector import *", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0689, 0.0018, 0, 0.66, 0.5333, 8, 0, 1, 0, 0, 8, 0, 0], "semantic": {"name": "laser_detector", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from laser_detector import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L41_C0", "label": "count_down", "type": "function", "loc": [41, 44], "level": 0, "parent": null, "vector": [2, 0, 0.0751, 0.0071, 0, 0.66, 0.6, 672, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "count_down", "arg_names": ["times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def count_down(times=3):\n for i in range(times):\n print('in ', times - i)\n time.sleep(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L42_C4", "label": "for i", "type": "for", "loc": [42, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L41_C0", "vector": [6, 1, 0.076, 0.0053, 1, 0.53, 0.0, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(times):\n print('in ', times - i)\n time.sleep(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L43_C8", "label": "print()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L42_C4", "vector": [8, 2, 0.076, 0.0018, 2, 0.7, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('in ', times - i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L44_C8", "label": "sleep()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L42_C4", "vector": [8, 2, 0.0777, 0.0018, 2, 0.7, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L46_C0", "label": "evaluate_classifier", "type": "function", "loc": [46, 47], "level": 0, "parent": null, "vector": [2, 0, 0.0822, 0.0035, 0, 0.66, 0.6667, 233, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def evaluate_classifier():\n rf.evaluate_classifier(rf.RFBreiman, load_pickle('PatchClassifier.dataset.pickle'), 1, .7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L47_C4", "label": "evaluate_classifier()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L46_C0", "vector": [8, 1, 0.083, 0.0018, 1, 0.83, 0.0, 233, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " rf.evaluate_classifier(rf.RFBreiman, load_pickle('PatchClassifier.dataset.pickle'), 1, .7)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "label": "show_processed", "type": "function", "loc": [49, 78], "level": 0, "parent": null, "vector": [2, 0, 0.1122, 0.053, 0, 0.66, 0.7333, 141, 0, 5, 0, 0, 0, 0, 19], "semantic": {"name": "show_processed", "arg_names": ["image", "masks", "detection", "blobs", "detector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def show_processed(image, masks, detection, blobs, detector):\n masker = Mask(image)\n splitter = SplitColors(image)\n r, g, b = splitter.split(image)\n thresholded_image = masker.mask(masks[0], r, g, b)\n draw_detection(thresholded_image, detection)\n cv.ShowImage('thresholded', thresholded_image)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L50_C4", "label": "masker = Mask()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [14, 1, 0.0883, 0.0018, 1, 0.74, 0.0, 372, 3, 1, 0, 0, 976, 10, 1], "semantic": {"name": "masker", "arg_names": [], "import_names": [], "rhs_call_name": "Mask", "annotation": ""}, "snippet": " masker = Mask(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L51_C4", "label": "splitter = SplitColors()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [14, 1, 0.0901, 0.0018, 1, 0.74, 0.0625, 720, 3, 1, 0, 0, 70, 10, 1], "semantic": {"name": "splitter", "arg_names": [], "import_names": [], "rhs_call_name": "SplitColors", "annotation": ""}, "snippet": " splitter = SplitColors(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L52_C4", "label": "r, g, b = split()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [14, 1, 0.0919, 0.0018, 1, 0.74, 0.125, 236, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "r, g, b", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " r, g, b = splitter.split(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L53_C4", "label": "thresholded_image = mask()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [14, 1, 0.0936, 0.0018, 1, 0.74, 0.1875, 889, 3, 4, 0, 0, 904, 10, 1], "semantic": {"name": "thresholded_image", "arg_names": [], "import_names": [], "rhs_call_name": "mask", "annotation": ""}, "snippet": " thresholded_image = masker.mask(masks[0], r, g, b)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L54_C4", "label": "draw_detection()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.0954, 0.0018, 1, 0.74, 0.25, 674, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_detection", "arg_names": [], "import_names": [], "rhs_call_name": "draw_detection", "annotation": ""}, "snippet": " draw_detection(thresholded_image, detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L55_C4", "label": "ShowImage()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.0972, 0.0018, 1, 0.74, 0.3125, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('thresholded', thresholded_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L57_C4", "label": "draw_detection()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1007, 0.0018, 1, 0.74, 0.375, 674, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_detection", "arg_names": [], "import_names": [], "rhs_call_name": "draw_detection", "annotation": ""}, "snippet": " draw_detection(image, detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L58_C4", "label": "draw_blobs()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1025, 0.0018, 1, 0.74, 0.4375, 294, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_blobs", "arg_names": [], "import_names": [], "rhs_call_name": "draw_blobs", "annotation": ""}, "snippet": " draw_blobs(image, blobs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L60_C4", "label": "make_visible_binary_image()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.106, 0.0018, 1, 0.74, 0.5, 768, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_visible_binary_image", "arg_names": [], "import_names": [], "rhs_call_name": "make_visible_binary_image", "annotation": ""}, "snippet": " make_visible_binary_image(masks[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L61_C4", "label": "draw_detection()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1078, 0.0018, 1, 0.74, 0.5625, 674, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_detection", "arg_names": [], "import_names": [], "rhs_call_name": "draw_detection", "annotation": ""}, "snippet": " draw_detection(masks[0], detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L62_C4", "label": "make_visible_binary_image()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1095, 0.0018, 1, 0.74, 0.625, 768, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_visible_binary_image", "arg_names": [], "import_names": [], "rhs_call_name": "make_visible_binary_image", "annotation": ""}, "snippet": " make_visible_binary_image(masks[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L63_C4", "label": "make_visible_binary_image()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1113, 0.0018, 1, 0.74, 0.6875, 768, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_visible_binary_image", "arg_names": [], "import_names": [], "rhs_call_name": "make_visible_binary_image", "annotation": ""}, "snippet": " make_visible_binary_image(masks[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L65_C4", "label": "ShowImage()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1148, 0.0018, 1, 0.74, 0.75, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"video\", image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L66_C4", "label": "ShowImage()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1166, 0.0018, 1, 0.74, 0.8125, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('motion', masks[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L67_C4", "label": "ShowImage()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [8, 1, 0.1184, 0.0018, 1, 0.74, 0.875, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('intensity', masks[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L69_C4", "label": "key = WaitKey()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [14, 1, 0.1219, 0.0018, 1, 0.74, 0.9375, 230, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " key = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "label": "if", "type": "if", "loc": [70, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "vector": [4, 1, 0.1307, 0.0159, 1, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if detector != None:\n if key == 'T': #down\n detector.intensity_filter.thres_high = detector.intensity_filter.thres_high - 5\n print('detector.intensity_filter.thres =', detector.intensity_filter.thres_high)\n if key == 'R':\n detector.intensity_filter.thres_high = detector.intensity_filter.thres_high + 5\n print('detector.intensity_filter.thres =', detector.intensity_filter.thres_high)\n if key == ' ':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L71_C8", "label": "if", "type": "if", "loc": [71, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "vector": [4, 2, 0.1272, 0.0053, 2, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == 'T': #down\n detector.intensity_filter.thres_high = detector.intensity_filter.thres_high - 5\n print('detector.intensity_filter.thres =', detector.intensity_filter.thres_high)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L72_C12", "label": "detector.intensity_filter.thres_high =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L71_C8", "vector": [14, 3, 0.1272, 0.0018, 3, 0.33, 0.0, 1, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "detector.intensity_filter.thres_high", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " detector.intensity_filter.thres_high = detector.intensity_filter.thres_high - 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L73_C12", "label": "print()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L71_C8", "vector": [8, 3, 0.129, 0.0018, 3, 0.33, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('detector.intensity_filter.thres =', detector.intensity_filter.thres_high)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L74_C8", "label": "if", "type": "if", "loc": [74, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "vector": [4, 2, 0.1325, 0.0053, 2, 0.26, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == 'R':\n detector.intensity_filter.thres_high = detector.intensity_filter.thres_high + 5\n print('detector.intensity_filter.thres =', detector.intensity_filter.thres_high)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L75_C12", "label": "detector.intensity_filter.thres_high =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L74_C8", "vector": [14, 3, 0.1325, 0.0018, 3, 0.35, 0.0, 1, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "detector.intensity_filter.thres_high", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " detector.intensity_filter.thres_high = detector.intensity_filter.thres_high + 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L76_C12", "label": "print()", "type": "expression", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L74_C8", "vector": [8, 3, 0.1343, 0.0018, 3, 0.35, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('detector.intensity_filter.thres =', detector.intensity_filter.thres_high)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L77_C8", "label": "if", "type": "if", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "vector": [4, 2, 0.1369, 0.0035, 2, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == ' ':\n cv.WaitKey()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L78_C12", "label": "WaitKey()", "type": "expression", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L77_C8", "vector": [8, 3, 0.1378, 0.0018, 3, 0.38, 0.0, 885, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "label": "confirmation_prompt", "type": "function", "loc": [80, 87], "level": 0, "parent": null, "vector": [2, 0, 0.1475, 0.0141, 0, 0.66, 0.8, 387, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "confirmation_prompt", "arg_names": ["confirm_phrase"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def confirmation_prompt(confirm_phrase):\n print(confirm_phrase)\n print('y(es)/n(no)')\n k = cv.WaitKey()\n if k == 'y':\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L81_C4", "label": "print()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "vector": [8, 1, 0.1431, 0.0018, 1, 0.85, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(confirm_phrase)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L82_C4", "label": "print()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "vector": [8, 1, 0.1449, 0.0018, 1, 0.85, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('y(es)/n(no)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L83_C4", "label": "k = WaitKey()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "vector": [14, 1, 0.1466, 0.0018, 1, 0.85, 0.6667, 954, 3, 0, 0, 0, 885, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " k = cv.WaitKey()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L84_C4", "label": "if", "type": "if", "loc": [84, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "vector": [4, 1, 0.1511, 0.0071, 1, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == 'y':\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L84_C4", "vector": [13, 2, 0.1502, 0.0018, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L84_C4", "vector": [13, 2, 0.1537, 0.0018, 2, 0.54, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "label": "learn_run", "type": "function", "loc": [89, 189], "level": 0, "parent": null, "vector": [2, 0, 0.2456, 0.1784, 0, 0.66, 0.8667, 44, 0, 3, 0, 0, 0, 0, 57], "semantic": {"name": "learn_run", "arg_names": ["exposure", "num_examples_to_collect", "display_during_run"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def learn_run(exposure = LaserPointerDetector.SUN_EXPOSURE, num_examples_to_collect=200, display_during_run = True):\n cv.NamedWindow(\"video\", 1)\n cv.NamedWindow(\"thresholded\", 1)\n cv.NamedWindow('motion', 1)\n cv.NamedWindow('intensity', 1)\n\n cv.MoveWindow(\"video\", 0, 0)\n cv.MoveWindow(\"thresholded\", 800, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L90_C4", "label": "NamedWindow()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.159, 0.0018, 1, 0.64, 0.0, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"video\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L91_C4", "label": "NamedWindow()", "type": "expression", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1608, 0.0018, 1, 0.64, 0.0714, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"thresholded\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L92_C4", "label": "NamedWindow()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1625, 0.0018, 1, 0.64, 0.1429, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('motion', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L93_C4", "label": "NamedWindow()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1643, 0.0018, 1, 0.64, 0.2143, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('intensity', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L95_C4", "label": "MoveWindow()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1678, 0.0018, 1, 0.64, 0.2857, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"video\", 0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L96_C4", "label": "MoveWindow()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1696, 0.0018, 1, 0.64, 0.3571, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"thresholded\", 800, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L98_C4", "label": "MoveWindow()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1731, 0.0018, 1, 0.64, 0.4286, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"intensity\", 0, 600)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L99_C4", "label": "MoveWindow()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [8, 1, 0.1749, 0.0018, 1, 0.64, 0.5, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"motion\", 800, 600)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L103_C4", "label": "frames = next()", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [14, 1, 0.182, 0.0018, 1, 0.64, 0.5714, 26, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "frames", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " frames = video.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L104_C4", "label": "detector = LaserPointerDetector()", "type": "assigned_variable", "loc": [104, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [14, 1, 0.1855, 0.0053, 1, 0.64, 0.6429, 61, 3, 5, 0, 0, 555, 10, 1], "semantic": {"name": "detector", "arg_names": [], "import_names": [], "rhs_call_name": "LaserPointerDetector", "annotation": ""}, "snippet": " detector = LaserPointerDetector(frames[0], exposure=exposure, \n dataset=PatchClassifier.DEFAULT_DATASET_FILE,\n use_color=False, use_learning=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L107_C4", "label": "detector2 = LaserPointerDetector()", "type": "assigned_variable", "loc": [107, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [14, 1, 0.1908, 0.0053, 1, 0.64, 0.7143, 932, 3, 5, 0, 0, 555, 10, 1], "semantic": {"name": "detector2", "arg_names": [], "import_names": [], "rhs_call_name": "LaserPointerDetector", "annotation": ""}, "snippet": " detector2 = LaserPointerDetector(frames[1], exposure=exposure, \n dataset=PatchClassifier.DEFAULT_DATASET_FILE,\n use_color=False, use_learning=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "label": "append_examples_to_file", "type": "function", "loc": [111, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [2, 1, 0.2023, 0.0141, 1, 0.64, 0.7857, 328, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "append_examples_to_file", "arg_names": ["dataset", "file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def append_examples_to_file(dataset, file = PatchClassifier.DEFAULT_DATASET_FILE):\n try:\n loaded_set = load_pickle(file)\n dataset.append(loaded_set)\n except IOError:\n pass\n dump_pickle(dataset, file)\n print('Saved examples!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Try_L112_C8", "label": "try", "type": "try", "loc": [112, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "vector": [7, 2, 0.2014, 0.0088, 2, 0.88, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n loaded_set = load_pickle(file)\n dataset.append(loaded_set)\n except IOError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L113_C12", "label": "loaded_set = load_pickle()", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:Try_L112_C8", "vector": [14, 3, 0.1996, 0.0018, 3, 0.8, 0.0, 151, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "loaded_set", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " loaded_set = load_pickle(file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L114_C12", "label": "append()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:Try_L112_C8", "vector": [8, 3, 0.2014, 0.0018, 3, 0.8, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " dataset.append(loaded_set)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L117_C8", "label": "dump_pickle()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "vector": [8, 2, 0.2067, 0.0018, 2, 0.88, 0.5, 252, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "dump_pickle", "annotation": ""}, "snippet": " dump_pickle(dataset, file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L118_C8", "label": "print()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "vector": [8, 2, 0.2085, 0.0018, 2, 0.88, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Saved examples!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "label": "if", "type": "if", "loc": [121, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [4, 1, 0.2429, 0.0601, 1, 0.64, 0.8571, 0, 3, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confirmation_prompt('gather positive examples?'):\n print('Lets gather some positive examples... we need', num_examples_to_collect, 'examples')\n positive_examples_for_classifier = []\n count_down(0)\n for i in xrange(10):\n frames = video.next()\n detector.detect(frames[0])\n detector2.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L122_C8", "label": "print()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [8, 2, 0.2155, 0.0018, 2, 0.6, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Lets gather some positive examples... we need', num_examples_to_collect, 'examples')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L123_C8", "label": "positive_examples_for_classifier =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [14, 2, 0.2173, 0.0018, 2, 0.6, 0.1667, 913, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "positive_examples_for_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " positive_examples_for_classifier = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L124_C8", "label": "count_down()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [8, 2, 0.2191, 0.0018, 2, 0.6, 0.3333, 672, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "count_down", "arg_names": [], "import_names": [], "rhs_call_name": "count_down", "annotation": ""}, "snippet": " count_down(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "label": "for i", "type": "for", "loc": [125, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [6, 2, 0.2235, 0.0071, 2, 0.6, 0.5, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(10):\n frames = video.next()\n detector.detect(frames[0])\n detector2.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L126_C12", "label": "frames = next()", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "vector": [14, 3, 0.2226, 0.0018, 3, 0.61, 0.0, 26, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "frames", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " frames = video.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L127_C12", "label": "detect()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "vector": [8, 3, 0.2244, 0.0018, 3, 0.61, 0.5, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "detect", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " detector.detect(frames[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L128_C12", "label": "detect()", "type": "expression", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "vector": [8, 3, 0.2261, 0.0018, 3, 0.61, 1.0, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "detect", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " detector2.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "label": "for img", "type": "for", "loc": [130, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [6, 2, 0.2491, 0.0406, 2, 0.6, 0.6667, 200, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for img in video:\n image = None\n combined = None\n motion = None\n intensity = None\n laser_blob = None\n intensity_motion_blob = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L131_C12", "label": "image =", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [14, 3, 0.2314, 0.0018, 3, 0.6, 0.0, 505, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " image = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L132_C12", "label": "combined =", "type": "assigned_variable", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [14, 3, 0.2332, 0.0018, 3, 0.6, 0.125, 339, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "combined", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L133_C12", "label": "motion =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [14, 3, 0.235, 0.0018, 3, 0.6, 0.25, 759, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " motion = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L134_C12", "label": "intensity =", "type": "assigned_variable", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [14, 3, 0.2367, 0.0018, 3, 0.6, 0.375, 845, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "intensity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L135_C12", "label": "laser_blob =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [14, 3, 0.2385, 0.0018, 3, 0.6, 0.5, 178, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "laser_blob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " laser_blob = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L136_C12", "label": "intensity_motion_blob =", "type": "assigned_variable", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [14, 3, 0.2403, 0.0018, 3, 0.6, 0.625, 67, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "intensity_motion_blob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity_motion_blob = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "label": "for raw_image, detect", "type": "for", "loc": [138, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [6, 3, 0.2527, 0.0194, 3, 0.6, 0.75, 193, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "raw_image, detect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for raw_image, detect in zip(img, [detector, detector2]):\n before = time.time()\n image, combined, laser_blob, intensity_motion_blob = detect.detect(raw_image)\n diff = time.time() - before\n #print 'took %.2f seconds to run or %.2f fps' % (diff, 1.0/diff)\n if laser_blob != None:\n instance = blob_to_input_instance(image, laser_blob)\n if instance is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L139_C16", "label": "before = time()", "type": "assigned_variable", "loc": [139, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "vector": [14, 4, 0.2456, 0.0018, 4, 0.94, 0.0, 255, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "before", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " before = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L140_C16", "label": "image, combined, laser_blob, intensity_motion_blob = detect()", "type": "assigned_variable", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "vector": [14, 4, 0.2473, 0.0018, 4, 0.94, 0.25, 819, 3, 1, 0, 0, 654, 10, 1], "semantic": {"name": "image, combined, laser_blob, intensity_motion_blob", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " image, combined, laser_blob, intensity_motion_blob = detect.detect(raw_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L141_C16", "label": "diff =", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "vector": [14, 4, 0.2491, 0.0018, 4, 0.94, 0.5, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = time.time() - before"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L143_C16", "label": "if", "type": "if", "loc": [143, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "vector": [4, 4, 0.2562, 0.0088, 4, 0.94, 0.75, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if laser_blob != None:\n instance = blob_to_input_instance(image, laser_blob)\n if instance is not None:\n positive_examples_for_classifier.append(instance)\n print('got', len(positive_examples_for_classifier), 'instances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L144_C20", "label": "instance = blob_to_input_instance()", "type": "assigned_variable", "loc": [144, 144], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L143_C16", "vector": [14, 5, 0.2544, 0.0018, 5, 0.08, 0.0, 255, 3, 2, 0, 0, 24, 10, 1], "semantic": {"name": "instance", "arg_names": [], "import_names": [], "rhs_call_name": "blob_to_input_instance", "annotation": ""}, "snippet": " instance = blob_to_input_instance(image, laser_blob)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L145_C20", "label": "if", "type": "if", "loc": [145, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L143_C16", "vector": [4, 5, 0.258, 0.0053, 5, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is not None:\n positive_examples_for_classifier.append(instance)\n print('got', len(positive_examples_for_classifier), 'instances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L146_C24", "label": "append()", "type": "expression", "loc": [146, 146], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L145_C20", "vector": [8, 6, 0.258, 0.0018, 6, 0.5, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " positive_examples_for_classifier.append(instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L147_C24", "label": "print()", "type": "expression", "loc": [147, 147], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L145_C20", "vector": [8, 6, 0.2597, 0.0018, 6, 0.5, 1.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('got', len(positive_examples_for_classifier), 'instances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L148_C16", "label": "motion, intensity = get_motion_intensity_images()", "type": "assigned_variable", "loc": [148, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "vector": [14, 4, 0.2615, 0.0018, 4, 0.94, 1.0, 145, 3, 0, 0, 0, 865, 10, 1], "semantic": {"name": "motion, intensity", "arg_names": [], "import_names": [], "rhs_call_name": "get_motion_intensity_images", "annotation": ""}, "snippet": " motion, intensity = detect.get_motion_intensity_images()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L150_C12", "label": "show_processed()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [8, 3, 0.265, 0.0018, 3, 0.6, 0.875, 141, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "show_processed", "arg_names": [], "import_names": [], "rhs_call_name": "show_processed", "annotation": ""}, "snippet": " show_processed(image, [combined, motion, intensity], laser_blob, intensity_motion_blob, detector2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L151_C12", "label": "if", "type": "if", "loc": [151, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "vector": [4, 3, 0.2677, 0.0035, 3, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(positive_examples_for_classifier) > num_examples_to_collect:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L153_C8", "label": "positive_instances_dataset = matrix_to_dataset()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [14, 2, 0.2703, 0.0018, 2, 0.6, 0.8333, 176, 3, 1, 0, 0, 242, 10, 2], "semantic": {"name": "positive_instances_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_dataset", "annotation": ""}, "snippet": " positive_instances_dataset = matrix_to_dataset(ut.list_mat_to_mat(positive_examples_for_classifier, axis=1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L154_C8", "label": "append_examples_to_file()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "vector": [8, 2, 0.2721, 0.0018, 2, 0.6, 1.0, 328, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append_examples_to_file", "arg_names": [], "import_names": [], "rhs_call_name": "append_examples_to_file", "annotation": ""}, "snippet": " append_examples_to_file(positive_instances_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "label": "if", "type": "if", "loc": [156, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [4, 1, 0.3021, 0.0548, 1, 0.64, 0.9286, 0, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confirmation_prompt('gather negative examples?'):\n #Gather negative examples from laser detector\n print('lets gather some negative examples... we need', num_examples_to_collect,' examples')\n negative_examples_for_classifier = []\n count_down(10)\n for i in xrange(10):\n frames = video.next()\n detector.detect(frames[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L158_C8", "label": "print()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [8, 2, 0.2792, 0.0018, 2, 0.48, 0.0, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('lets gather some negative examples... we need', num_examples_to_collect,' examples')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L159_C8", "label": "negative_examples_for_classifier =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [14, 2, 0.2809, 0.0018, 2, 0.48, 0.1667, 139, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "negative_examples_for_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " negative_examples_for_classifier = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L160_C8", "label": "count_down()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [8, 2, 0.2827, 0.0018, 2, 0.48, 0.3333, 672, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "count_down", "arg_names": [], "import_names": [], "rhs_call_name": "count_down", "annotation": ""}, "snippet": " count_down(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "label": "for i", "type": "for", "loc": [161, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [6, 2, 0.2871, 0.0071, 2, 0.48, 0.5, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(10):\n frames = video.next()\n detector.detect(frames[0])\n detector2.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L162_C12", "label": "frames = next()", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "vector": [14, 3, 0.2862, 0.0018, 3, 0.12, 0.0, 26, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "frames", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " frames = video.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L163_C12", "label": "detect()", "type": "expression", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "vector": [8, 3, 0.288, 0.0018, 3, 0.12, 0.5, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "detect", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " detector.detect(frames[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L164_C12", "label": "detect()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "vector": [8, 3, 0.2898, 0.0018, 3, 0.12, 1.0, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "detect", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " detector2.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "label": "for img", "type": "for", "loc": [166, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [6, 2, 0.3092, 0.0336, 2, 0.48, 0.6667, 200, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for img in video:\n image = None\n combined = None\n motion = None\n intensity = None\n laser_blob = None\n intensity_motion_blob = None\n for raw_image, detect in zip(img, [detector, detector2]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L167_C12", "label": "image =", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [14, 3, 0.2951, 0.0018, 3, 0.9, 0.0, 505, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " image = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L168_C12", "label": "combined =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [14, 3, 0.2968, 0.0018, 3, 0.9, 0.125, 339, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "combined", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " combined = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L169_C12", "label": "motion =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [14, 3, 0.2986, 0.0018, 3, 0.9, 0.25, 759, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "motion", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " motion = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L170_C12", "label": "intensity =", "type": "assigned_variable", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [14, 3, 0.3004, 0.0018, 3, 0.9, 0.375, 845, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "intensity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L171_C12", "label": "laser_blob =", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [14, 3, 0.3021, 0.0018, 3, 0.9, 0.5, 178, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "laser_blob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " laser_blob = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L172_C12", "label": "intensity_motion_blob =", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [14, 3, 0.3039, 0.0018, 3, 0.9, 0.625, 67, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "intensity_motion_blob", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " intensity_motion_blob = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "label": "for raw_image, detect", "type": "for", "loc": [173, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [6, 3, 0.3118, 0.0141, 3, 0.9, 0.75, 193, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "raw_image, detect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for raw_image, detect in zip(img, [detector, detector2]):\n image, combined, laser_blob, intensity_motion_blob = detect.detect(raw_image)\n if laser_blob != None:\n instance = blob_to_input_instance(image, laser_blob)\n if instance is not None:\n negative_examples_for_classifier.append(instance)\n print('got', len(negative_examples_for_classifier), 'instances')\n motion, intensity = detect.get_motion_intensity_images()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L174_C16", "label": "image, combined, laser_blob, intensity_motion_blob = detect()", "type": "assigned_variable", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "vector": [14, 4, 0.3074, 0.0018, 4, 0.05, 0.0, 819, 3, 1, 0, 0, 654, 10, 1], "semantic": {"name": "image, combined, laser_blob, intensity_motion_blob", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " image, combined, laser_blob, intensity_motion_blob = detect.detect(raw_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L175_C16", "label": "if", "type": "if", "loc": [175, 179], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "vector": [4, 4, 0.3127, 0.0088, 4, 0.05, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if laser_blob != None:\n instance = blob_to_input_instance(image, laser_blob)\n if instance is not None:\n negative_examples_for_classifier.append(instance)\n print('got', len(negative_examples_for_classifier), 'instances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L176_C20", "label": "instance = blob_to_input_instance()", "type": "assigned_variable", "loc": [176, 176], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L175_C16", "vector": [14, 5, 0.311, 0.0018, 5, 0.74, 0.0, 255, 3, 2, 0, 0, 24, 10, 1], "semantic": {"name": "instance", "arg_names": [], "import_names": [], "rhs_call_name": "blob_to_input_instance", "annotation": ""}, "snippet": " instance = blob_to_input_instance(image, laser_blob)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L177_C20", "label": "if", "type": "if", "loc": [177, 179], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L175_C16", "vector": [4, 5, 0.3145, 0.0053, 5, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is not None:\n negative_examples_for_classifier.append(instance)\n print('got', len(negative_examples_for_classifier), 'instances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L178_C24", "label": "append()", "type": "expression", "loc": [178, 178], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L177_C20", "vector": [8, 6, 0.3145, 0.0018, 6, 0.64, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " negative_examples_for_classifier.append(instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L179_C24", "label": "print()", "type": "expression", "loc": [179, 179], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L177_C20", "vector": [8, 6, 0.3163, 0.0018, 6, 0.64, 1.0, 535, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('got', len(negative_examples_for_classifier), 'instances')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L180_C16", "label": "motion, intensity = get_motion_intensity_images()", "type": "assigned_variable", "loc": [180, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "vector": [14, 4, 0.318, 0.0018, 4, 0.05, 1.0, 145, 3, 0, 0, 0, 865, 10, 1], "semantic": {"name": "motion, intensity", "arg_names": [], "import_names": [], "rhs_call_name": "get_motion_intensity_images", "annotation": ""}, "snippet": " motion, intensity = detect.get_motion_intensity_images()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L182_C12", "label": "show_processed()", "type": "expression", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [8, 3, 0.3216, 0.0018, 3, 0.9, 0.875, 141, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "show_processed", "arg_names": [], "import_names": [], "rhs_call_name": "show_processed", "annotation": ""}, "snippet": " show_processed(image, [combined, motion, intensity], laser_blob, intensity_motion_blob, detector2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L183_C12", "label": "if", "type": "if", "loc": [183, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "vector": [4, 3, 0.3242, 0.0035, 3, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(negative_examples_for_classifier) > (num_examples_to_collect*2):\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L185_C8", "label": "negative_instances_dataset = matrix_to_dataset()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [14, 2, 0.3269, 0.0018, 2, 0.48, 0.8333, 772, 3, 1, 0, 0, 242, 10, 2], "semantic": {"name": "negative_instances_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_dataset", "annotation": ""}, "snippet": " negative_instances_dataset = matrix_to_dataset(ut.list_mat_to_mat(negative_examples_for_classifier, axis=1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L186_C8", "label": "append_examples_to_file()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "vector": [8, 2, 0.3286, 0.0018, 2, 0.48, 1.0, 328, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append_examples_to_file", "arg_names": [], "import_names": [], "rhs_call_name": "append_examples_to_file", "annotation": ""}, "snippet": " append_examples_to_file(negative_instances_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L188_C4", "label": "if", "type": "if", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "vector": [4, 1, 0.333, 0.0035, 1, 0.64, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confirmation_prompt('run classifier?'):\n run(exposure, video = video, display=display_during_run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L189_C8", "label": "run()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L188_C4", "vector": [8, 2, 0.3339, 0.0018, 2, 0.4, 0.0, 679, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " run(exposure, video = video, display=display_during_run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "label": "run", "type": "function", "loc": [191, 262], "level": 0, "parent": null, "vector": [2, 0, 0.4002, 0.1272, 0, 0.66, 0.9333, 679, 0, 4, 0, 0, 0, 0, 44], "semantic": {"name": "run", "arg_names": ["exposure", "video", "display", "debug"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def run(exposure, video=None, display=False, debug=False):\n if display:\n cv.NamedWindow(\"video\", 1)\n cv.MoveWindow(\"video\", 0, 0)\n\n if debug:\n cv.NamedWindow('right', 1)\n cv.MoveWindow(\"right\", 800, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L192_C4", "label": "if", "type": "if", "loc": [192, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [4, 1, 0.341, 0.0053, 1, 0.19, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if display:\n cv.NamedWindow(\"video\", 1)\n cv.MoveWindow(\"video\", 0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L193_C8", "label": "NamedWindow()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L192_C4", "vector": [8, 2, 0.341, 0.0018, 2, 0.62, 0.0, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"video\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L194_C8", "label": "MoveWindow()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L192_C4", "vector": [8, 2, 0.3428, 0.0018, 2, 0.62, 1.0, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"video\", 0, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "label": "if", "type": "if", "loc": [196, 205], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [4, 1, 0.3542, 0.0177, 1, 0.19, 0.1, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if debug:\n cv.NamedWindow('right', 1)\n cv.MoveWindow(\"right\", 800, 0)\n cv.NamedWindow(\"thresholded\", 1)\n cv.NamedWindow('motion', 1)\n cv.NamedWindow('intensity', 1)\n\n cv.MoveWindow(\"thresholded\", 800, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L197_C8", "label": "NamedWindow()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3481, 0.0018, 2, 0.89, 0.0, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('right', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L198_C8", "label": "MoveWindow()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3498, 0.0018, 2, 0.89, 0.1429, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"right\", 800, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L199_C8", "label": "NamedWindow()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3516, 0.0018, 2, 0.89, 0.2857, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"thresholded\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L200_C8", "label": "NamedWindow()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3534, 0.0018, 2, 0.89, 0.4286, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('motion', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L201_C8", "label": "NamedWindow()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3551, 0.0018, 2, 0.89, 0.5714, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('intensity', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L203_C8", "label": "MoveWindow()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3587, 0.0018, 2, 0.89, 0.7143, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"thresholded\", 800, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L204_C8", "label": "MoveWindow()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3604, 0.0018, 2, 0.89, 0.8571, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"intensity\", 0, 600)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L205_C8", "label": "MoveWindow()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "vector": [8, 2, 0.3622, 0.0018, 2, 0.89, 1.0, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(\"motion\", 800, 600)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L207_C4", "label": "if", "type": "if", "loc": [207, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [4, 1, 0.3675, 0.0053, 1, 0.19, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if video is None:\n #video = cam.VidereStereo(0, gain=96, exposure=exposure)\n video = cam.StereoFile('measuring_tape_red_left.avi','measuring_tape_red_right.avi')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L209_C8", "label": "video = StereoFile()", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L207_C4", "vector": [14, 2, 0.3693, 0.0018, 2, 0.81, 0.0, 54, 3, 2, 0, 0, 956, 10, 1], "semantic": {"name": "video", "arg_names": [], "import_names": [], "rhs_call_name": "StereoFile", "annotation": ""}, "snippet": " video = cam.StereoFile('measuring_tape_red_left.avi','measuring_tape_red_right.avi')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L211_C4", "label": "frames = next()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [14, 1, 0.3728, 0.0018, 1, 0.19, 0.3, 26, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "frames", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " frames = video.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L212_C4", "label": "detector = LaserPointerDetector()", "type": "assigned_variable", "loc": [212, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [14, 1, 0.3754, 0.0035, 1, 0.19, 0.4, 61, 3, 4, 0, 0, 555, 10, 1], "semantic": {"name": "detector", "arg_names": [], "import_names": [], "rhs_call_name": "LaserPointerDetector", "annotation": ""}, "snippet": " detector = LaserPointerDetector(frames[0], LaserPointerDetector.SUN_EXPOSURE, \n use_color=False, use_learning=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L214_C4", "label": "detector_right = LaserPointerDetector()", "type": "assigned_variable", "loc": [214, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [14, 1, 0.379, 0.0035, 1, 0.19, 0.5, 267, 3, 5, 0, 0, 555, 10, 1], "semantic": {"name": "detector_right", "arg_names": [], "import_names": [], "rhs_call_name": "LaserPointerDetector", "annotation": ""}, "snippet": " detector_right = LaserPointerDetector(frames[1], LaserPointerDetector.SUN_EXPOSURE, \n use_color=False, use_learning=True, classifier=detector.classifier)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L216_C4", "label": "stereo_cam =", "type": "assigned_variable", "loc": [216, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [14, 1, 0.3816, 0.0018, 1, 0.19, 0.6, 736, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stereo_cam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stereo_cam = cam.KNOWN_CAMERAS['videre_stereo2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "label": "for i", "type": "for", "loc": [218, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [6, 1, 0.3878, 0.0071, 1, 0.19, 0.7, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(10):\n frames = video.next()\n detector.detect(frames[0])\n detector_right.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L219_C8", "label": "frames = next()", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "vector": [14, 2, 0.3869, 0.0018, 2, 0.15, 0.0, 26, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "frames", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " frames = video.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L220_C8", "label": "detect()", "type": "expression", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "vector": [8, 2, 0.3887, 0.0018, 2, 0.15, 0.5, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "detect", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " detector.detect(frames[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L221_C8", "label": "detect()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "vector": [8, 2, 0.3905, 0.0018, 2, 0.15, 1.0, 654, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "detect", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " detector_right.detect(frames[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L223_C4", "label": "lt = CreateImage()", "type": "assigned_variable", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [14, 1, 0.394, 0.0018, 1, 0.19, 0.8, 525, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "lt", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " lt = cv.CreateImage((640,480), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L224_C4", "label": "rt = CreateImage()", "type": "assigned_variable", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [14, 1, 0.3958, 0.0018, 1, 0.19, 0.9, 991, 3, 3, 0, 0, 288, 10, 1], "semantic": {"name": "rt", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " rt = cv.CreateImage((640,480), 8, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "label": "for l, r", "type": "for", "loc": [225, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "vector": [6, 1, 0.4302, 0.0671, 1, 0.19, 1.0, 781, 2, 0, 0, 0, 0, 0, 24], "semantic": {"name": "l, r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for l, r in video:\n start_time = time.time()\n #l = stereo_cam.camera_left.undistort_img(l)\n #r = stereo_cam.camera_right.undistort_img(r)\n cv.Copy(l, lt)\n cv.Copy(r, rt)\n l = lt\n r = rt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L226_C8", "label": "start_time = time()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.3993, 0.0018, 2, 0.04, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L229_C8", "label": "Copy()", "type": "expression", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [8, 2, 0.4046, 0.0018, 2, 0.04, 0.0714, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Copy", "arg_names": [], "import_names": [], "rhs_call_name": "Copy", "annotation": ""}, "snippet": " cv.Copy(l, lt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L230_C8", "label": "Copy()", "type": "expression", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [8, 2, 0.4064, 0.0018, 2, 0.04, 0.1429, 295, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Copy", "arg_names": [], "import_names": [], "rhs_call_name": "Copy", "annotation": ""}, "snippet": " cv.Copy(r, rt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L231_C8", "label": "l =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4081, 0.0018, 2, 0.04, 0.2143, 810, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l = lt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L232_C8", "label": "r =", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4099, 0.0018, 2, 0.04, 0.2857, 436, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = rt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L233_C8", "label": "undistort_time = time()", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4117, 0.0018, 2, 0.04, 0.3571, 523, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "undistort_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " undistort_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L235_C8", "label": "_, _, right_cam_detection, stats = detect()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4152, 0.0018, 2, 0.04, 0.4286, 46, 3, 1, 0, 0, 654, 10, 1], "semantic": {"name": "_, _, right_cam_detection, stats", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " _, _, right_cam_detection, stats = detector_right.detect(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "label": "if", "type": "if", "loc": [236, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [4, 2, 0.4196, 0.0071, 2, 0.04, 0.5, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if debug:\n draw_blobs(r, stats)\n draw_detection(r, right_cam_detection)\n cv.ShowImage('right', r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L237_C12", "label": "draw_blobs()", "type": "expression", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "vector": [8, 3, 0.4187, 0.0018, 3, 0.62, 0.0, 294, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_blobs", "arg_names": [], "import_names": [], "rhs_call_name": "draw_blobs", "annotation": ""}, "snippet": " draw_blobs(r, stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L238_C12", "label": "draw_detection()", "type": "expression", "loc": [238, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "vector": [8, 3, 0.4205, 0.0018, 3, 0.62, 0.5, 674, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_detection", "arg_names": [], "import_names": [], "rhs_call_name": "draw_detection", "annotation": ""}, "snippet": " draw_detection(r, right_cam_detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L239_C12", "label": "ShowImage()", "type": "expression", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "vector": [8, 3, 0.4223, 0.0018, 3, 0.62, 1.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('right', r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L241_C8", "label": "image, combined, left_cam_detection, stats = detect()", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4258, 0.0018, 2, 0.04, 0.5714, 165, 3, 1, 0, 0, 654, 10, 1], "semantic": {"name": "image, combined, left_cam_detection, stats", "arg_names": [], "import_names": [], "rhs_call_name": "detect", "annotation": ""}, "snippet": " image, combined, left_cam_detection, stats = detector.detect(l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L242_C8", "label": "detect_time = time()", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4276, 0.0018, 2, 0.04, 0.6429, 630, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "detect_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " detect_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "label": "if", "type": "if", "loc": [244, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [4, 2, 0.4373, 0.0141, 2, 0.04, 0.7143, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if debug: \n motion, intensity = detector.get_motion_intensity_images()\n show_processed(l, [combined, motion, intensity], left_cam_detection, stats, detector)\n elif display:\n #draw_blobs(l, stats)\n draw_detection(l, left_cam_detection)\n cv.ShowImage('video', l)\n cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L245_C12", "label": "motion, intensity = get_motion_intensity_images()", "type": "assigned_variable", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "vector": [14, 3, 0.4329, 0.0018, 3, 0.27, 0.0, 145, 3, 0, 0, 0, 865, 10, 1], "semantic": {"name": "motion, intensity", "arg_names": [], "import_names": [], "rhs_call_name": "get_motion_intensity_images", "annotation": ""}, "snippet": " motion, intensity = detector.get_motion_intensity_images()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L246_C12", "label": "show_processed()", "type": "expression", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "vector": [8, 3, 0.4346, 0.0018, 3, 0.27, 0.5, 141, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "show_processed", "arg_names": [], "import_names": [], "rhs_call_name": "show_processed", "annotation": ""}, "snippet": " show_processed(l, [combined, motion, intensity], left_cam_detection, stats, detector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "label": "if", "type": "if", "loc": [247, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "vector": [4, 3, 0.4399, 0.0088, 3, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif display:\n #draw_blobs(l, stats)\n draw_detection(l, left_cam_detection)\n cv.ShowImage('video', l)\n cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L249_C12", "label": "draw_detection()", "type": "expression", "loc": [249, 249], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "vector": [8, 4, 0.4399, 0.0018, 4, 0.01, 0.0, 674, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "draw_detection", "arg_names": [], "import_names": [], "rhs_call_name": "draw_detection", "annotation": ""}, "snippet": " draw_detection(l, left_cam_detection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L250_C12", "label": "ShowImage()", "type": "expression", "loc": [250, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "vector": [8, 4, 0.4417, 0.0018, 4, 0.01, 0.5, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('video', l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L251_C12", "label": "WaitKey()", "type": "expression", "loc": [251, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "vector": [8, 4, 0.4435, 0.0018, 4, 0.01, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "label": "if", "type": "if", "loc": [253, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [4, 2, 0.4514, 0.0106, 2, 0.04, 0.7857, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if right_cam_detection != None and left_cam_detection != None:\n x = np.matrix(left_cam_detection['centroid']).T\n xp = np.matrix(right_cam_detection['centroid']).T\n result = stereo_cam.triangulate_3d(x, xp)\n print('3D point located at', result['point'].T,)\n print('distance %.2f error %.3f' % (np.linalg.norm(result['point']), result['error']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L254_C12", "label": "x =", "type": "assigned_variable", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "vector": [14, 3, 0.4488, 0.0018, 3, 0.01, 0.0, 190, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = np.matrix(left_cam_detection['centroid']).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L255_C12", "label": "xp =", "type": "assigned_variable", "loc": [255, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "vector": [14, 3, 0.4505, 0.0018, 3, 0.01, 0.25, 575, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "xp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " xp = np.matrix(right_cam_detection['centroid']).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L256_C12", "label": "result = triangulate_3d()", "type": "assigned_variable", "loc": [256, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "vector": [14, 3, 0.4523, 0.0018, 3, 0.01, 0.5, 51, 3, 2, 0, 0, 860, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "triangulate_3d", "annotation": ""}, "snippet": " result = stereo_cam.triangulate_3d(x, xp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L257_C12", "label": "print()", "type": "expression", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "vector": [8, 3, 0.4541, 0.0018, 3, 0.01, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('3D point located at', result['point'].T,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L258_C12", "label": "print()", "type": "expression", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "vector": [8, 3, 0.4558, 0.0018, 3, 0.01, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('distance %.2f error %.3f' % (np.linalg.norm(result['point']), result['error']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L259_C8", "label": "triangulation_time = time()", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4576, 0.0018, 2, 0.04, 0.8571, 74, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "triangulation_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " triangulation_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L261_C8", "label": "diff =", "type": "assigned_variable", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [14, 2, 0.4611, 0.0018, 2, 0.04, 0.9286, 833, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = time.time() - start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L262_C8", "label": "print()", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "vector": [8, 2, 0.4629, 0.0018, 2, 0.04, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Main: Running at %.2f fps, took %.4f s' % (1.0 / diff, diff))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "label": "if", "type": "if", "loc": [267, 281], "level": 0, "parent": null, "vector": [4, 0, 0.4841, 0.0265, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n exposure = 0\n if sys.argv[2] == 'sun':\n exposure = LaserPointerDetector.SUN_EXPOSURE\n print('sun exposure!')\n else:\n exposure = LaserPointerDetector.NO_SUN_EXPOSURE\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L268_C4", "label": "exposure =", "type": "assigned_variable", "loc": [268, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "vector": [14, 1, 0.4735, 0.0018, 1, 0.08, 0.0, 759, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "exposure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exposure = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "label": "if", "type": "if", "loc": [269, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "vector": [4, 1, 0.4788, 0.0088, 1, 0.08, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.argv[2] == 'sun':\n exposure = LaserPointerDetector.SUN_EXPOSURE\n print('sun exposure!')\n else:\n exposure = LaserPointerDetector.NO_SUN_EXPOSURE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L270_C8", "label": "exposure =", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "vector": [14, 2, 0.477, 0.0018, 2, 0.46, 0.0, 759, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "exposure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exposure = LaserPointerDetector.SUN_EXPOSURE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L271_C8", "label": "print()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "vector": [8, 2, 0.4788, 0.0018, 2, 0.46, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('sun exposure!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L273_C8", "label": "exposure =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "vector": [14, 2, 0.4823, 0.0018, 2, 0.46, 1.0, 759, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "exposure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exposure = LaserPointerDetector.NO_SUN_EXPOSURE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L275_C4", "label": "if", "type": "if", "loc": [275, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "vector": [4, 1, 0.4876, 0.0053, 1, 0.08, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.argv[1] == 'run':\n print('Running only...')\n run(exposure = exposure, display = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L276_C8", "label": "print()", "type": "expression", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L275_C4", "vector": [8, 2, 0.4876, 0.0018, 2, 0.87, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Running only...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L277_C8", "label": "run()", "type": "expression", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L275_C4", "vector": [8, 2, 0.4894, 0.0018, 2, 0.87, 1.0, 679, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " run(exposure = exposure, display = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L279_C4", "label": "if", "type": "if", "loc": [279, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "vector": [4, 1, 0.4947, 0.0053, 1, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.argv[1] == 'learn':\n print('Running only...')\n learn_run(exposure = exposure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L280_C8", "label": "print()", "type": "expression", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L279_C4", "vector": [8, 2, 0.4947, 0.0018, 2, 0.81, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Running only...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L281_C8", "label": "learn_run()", "type": "expression", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L279_C4", "vector": [8, 2, 0.4965, 0.0018, 2, 0.81, 1.0, 44, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "learn_run", "arg_names": [], "import_names": [], "rhs_call_name": "learn_run", "annotation": ""}, "snippet": " learn_run(exposure = exposure)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Try_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:Try_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:Try_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L139_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L140_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L143_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L143_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L144_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L143_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L145_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L145_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L146_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L145_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L147_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L138_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L148_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L175_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L175_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L176_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L175_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L177_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L177_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L178_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L177_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L179_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L180_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L207_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L244_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L255_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:For_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L267_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99225:If_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99225:Expr_L281_C8"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
import numpy as np
#from pylab import *
def pca_gain_threshold(s, percentage_change_threshold=.15):
if s.__class__ != np.ndarray:
raise ValueError('Need ndarray as input.')
shifted = np.concatenate((s[1:].copy(), np.array([s[-1]])), axis=1)
diff = s - shifted
percent_diff = diff / s
positions = np.where(percent_diff < percentage_change_threshold)
return positions[0][0]
def pca_variance_threshold(eigen_values, percent_variance=.9):
eigen_sum = np.sum(eigen_values)
#print 'pca_variance_threshold: eigen_sum', eigen_sum
eigen_normed = np.cumsum(eigen_values) / eigen_sum
positions = np.where(eigen_normed > percent_variance)
print 'pca_variance_threshold: percent_variance', percent_variance
#print positions
return positions[0][0]
def pca(data):
cov_data = np.cov(data)
u, s, vh = np.linalg.svd(cov_data)
return u,s,vh
def pca_vectors(data, percent_variance):
u, s, vh = pca(data)
number_of_vectors = pca_variance_threshold(s, percent_variance=percent_variance)
return np.matrix(u[:,0:number_of_vectors+1])
def randomized_vectors(dataset, number_of_vectors):
rvectors = np.matrix(np.random.random_sample((dataset.num_attributes(), number_of_vectors))) * 2 - 1.0
lengths = np.diag(1.0 / np.power(np.sum(np.power(rvectors, 2), axis=0), 0.5))
return rvectors * lengths
| ajibawa-2023/Python-Code-Large/train/row_99226 | 26 | 65 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Import_L29_C0", "label": "numpy import np", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.4462, 0.0154, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "label": "pca_gain_threshold", "type": "function", "loc": [32, 39], "level": 0, "parent": null, "vector": [2, 0, 0.5462, 0.1231, 0, 0.66, 0.2, 171, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "pca_gain_threshold", "arg_names": ["s", "percentage_change_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_gain_threshold(s, percentage_change_threshold=.15):\n if s.__class__ != np.ndarray:\n raise ValueError('Need ndarray as input.') \n shifted = np.concatenate((s[1:].copy(), np.array([s[-1]])), axis=1)\n diff = s - shifted\n percent_diff = diff / s\n positions = np.where(percent_diff < percentage_change_threshold)\n return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:If_L33_C4", "label": "if", "type": "if", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "vector": [4, 1, 0.5154, 0.0308, 1, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s.__class__ != np.ndarray:\n raise ValueError('Need ndarray as input.') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L35_C4", "label": "shifted = concatenate()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "vector": [14, 1, 0.5385, 0.0154, 1, 0.83, 0.2, 221, 3, 2, 0, 0, 63, 10, 3], "semantic": {"name": "shifted", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " shifted = np.concatenate((s[1:].copy(), np.array([s[-1]])), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L36_C4", "label": "diff =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "vector": [14, 1, 0.5538, 0.0154, 1, 0.83, 0.4, 833, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = s - shifted"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L37_C4", "label": "percent_diff =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "vector": [14, 1, 0.5692, 0.0154, 1, 0.83, 0.6, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "percent_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percent_diff = diff / s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L38_C4", "label": "positions = where()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "vector": [14, 1, 0.5846, 0.0154, 1, 0.83, 0.8, 320, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "positions", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " positions = np.where(percent_diff < percentage_change_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L39_C4", "label": "return", "type": "return", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "vector": [13, 1, 0.6, 0.0154, 1, 0.83, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "label": "pca_variance_threshold", "type": "function", "loc": [41, 48], "level": 0, "parent": null, "vector": [2, 0, 0.6846, 0.1231, 0, 0.66, 0.4, 311, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "pca_variance_threshold", "arg_names": ["eigen_values", "percent_variance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_variance_threshold(eigen_values, percent_variance=.9):\n eigen_sum = np.sum(eigen_values)\n #print 'pca_variance_threshold: eigen_sum', eigen_sum\n eigen_normed = np.cumsum(eigen_values) / eigen_sum\n positions = np.where(eigen_normed > percent_variance)\n print('pca_variance_threshold: percent_variance', percent_variance)\n #print positions\n return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L42_C4", "label": "eigen_sum = sum()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "vector": [14, 1, 0.6462, 0.0154, 1, 0.21, 0.0, 400, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "eigen_sum", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " eigen_sum = np.sum(eigen_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L44_C4", "label": "eigen_normed =", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "vector": [14, 1, 0.6769, 0.0154, 1, 0.21, 0.25, 959, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "eigen_normed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " eigen_normed = np.cumsum(eigen_values) / eigen_sum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L45_C4", "label": "positions = where()", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "vector": [14, 1, 0.6923, 0.0154, 1, 0.21, 0.5, 320, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "positions", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " positions = np.where(eigen_normed > percent_variance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Expr_L46_C4", "label": "print()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "vector": [8, 1, 0.7077, 0.0154, 1, 0.21, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pca_variance_threshold: percent_variance', percent_variance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L48_C4", "label": "return", "type": "return", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "vector": [13, 1, 0.7385, 0.0154, 1, 0.21, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "label": "pca", "type": "function", "loc": [50, 53], "level": 0, "parent": null, "vector": [2, 0, 0.7923, 0.0615, 0, 0.66, 0.6, 425, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "pca", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca(data):\n cov_data = np.cov(data)\n u, s, vh = np.linalg.svd(cov_data)\n return u,s,vh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L51_C4", "label": "cov_data = cov()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "vector": [14, 1, 0.7846, 0.0154, 1, 0.05, 0.0, 897, 3, 1, 0, 0, 251, 10, 1], "semantic": {"name": "cov_data", "arg_names": [], "import_names": [], "rhs_call_name": "cov", "annotation": ""}, "snippet": " cov_data = np.cov(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L52_C4", "label": "u, s, vh = svd()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "vector": [14, 1, 0.8, 0.0154, 1, 0.05, 0.5, 625, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "u, s, vh", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " u, s, vh = np.linalg.svd(cov_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L53_C4", "label": "return", "type": "return", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "vector": [13, 1, 0.8154, 0.0154, 1, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u,s,vh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "label": "pca_vectors", "type": "function", "loc": [55, 58], "level": 0, "parent": null, "vector": [2, 0, 0.8692, 0.0615, 0, 0.66, 0.8, 712, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "pca_vectors", "arg_names": ["data", "percent_variance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_vectors(data, percent_variance):\n u, s, vh = pca(data)\n number_of_vectors = pca_variance_threshold(s, percent_variance=percent_variance)\n return np.matrix(u[:,0:number_of_vectors+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L56_C4", "label": "u, s, vh = pca()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "vector": [14, 1, 0.8615, 0.0154, 1, 0.61, 0.0, 625, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "u, s, vh", "arg_names": [], "import_names": [], "rhs_call_name": "pca", "annotation": ""}, "snippet": " u, s, vh = pca(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L57_C4", "label": "number_of_vectors = pca_variance_threshold()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "vector": [14, 1, 0.8769, 0.0154, 1, 0.61, 0.5, 903, 3, 2, 0, 0, 311, 10, 1], "semantic": {"name": "number_of_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "pca_variance_threshold", "annotation": ""}, "snippet": " number_of_vectors = pca_variance_threshold(s, percent_variance=percent_variance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L58_C4", "label": "return", "type": "return", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "vector": [13, 1, 0.8923, 0.0154, 1, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(u[:,0:number_of_vectors+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "label": "randomized_vectors", "type": "function", "loc": [60, 63], "level": 0, "parent": null, "vector": [2, 0, 0.9462, 0.0615, 0, 0.66, 1.0, 889, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "randomized_vectors", "arg_names": ["dataset", "number_of_vectors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def randomized_vectors(dataset, number_of_vectors):\n rvectors = np.matrix(np.random.random_sample((dataset.num_attributes(), number_of_vectors))) * 2 - 1.0\n lengths = np.diag(1.0 / np.power(np.sum(np.power(rvectors, 2), axis=0), 0.5))\n return rvectors * lengths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L61_C4", "label": "rvectors =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "vector": [14, 1, 0.9385, 0.0154, 1, 0.98, 0.0, 274, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rvectors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rvectors = np.matrix(np.random.random_sample((dataset.num_attributes(), number_of_vectors))) * 2 - 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L62_C4", "label": "lengths = diag()", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "vector": [14, 1, 0.9538, 0.0154, 1, 0.98, 0.5, 214, 3, 1, 0, 0, 288, 10, 4], "semantic": {"name": "lengths", "arg_names": [], "import_names": [], "rhs_call_name": "diag", "annotation": ""}, "snippet": " lengths = np.diag(1.0 / np.power(np.sum(np.power(rvectors, 2), axis=0), 0.5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L63_C4", "label": "return", "type": "return", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "vector": [13, 1, 0.9692, 0.0154, 1, 0.98, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rvectors * lengths"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:If_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99226:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99226:Return_L63_C4"}] |
from pkg import *
import cv
import laser_interface.blob as blob
class CombineMasks:
def __init__(self, sample_image, channels=1):
self.combined = cv.CreateImage(cv.GetSize(sample_image), 8 , channels)
def combine(self, images):
cv.Set(self.combined, 1)
for img in images:
cv.Mul(self.combined, img, self.combined)
return self.combined
class Mask:
def __init__(self, sample_image):
self.thres_red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.thres_green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.thres_blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.merged_frame = cv.CreateImage(cv.GetSize(sample_image), 8 , 3)
def mask(self, mask, r, g, b):
cv.Mul(r, mask, self.thres_red_img)
cv.Mul(g, mask, self.thres_green_img)
cv.Mul(b, mask, self.thres_blue_img)
cv.Merge(self.thres_blue_img, self.thres_green_img, self.thres_red_img, None, self.merged_frame);
return self.merged_frame
class SplitColors:
def __init__(self, sample_image):
self.green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
def split(self, image):
cv.Split(image, self.blue_img, self.green_img, self.red_img, None);
return (self.red_img, self.green_img, self.blue_img)
class BrightnessThreshold:
def __init__(self, sample_image, max_area): #, tune=False):
#self.thres_low = thres_low
#self.thres_high = thres_high
self.max_area = max_area
#self.set_thresholds([thres_low, thres_high])
#self.csplit = SplitColors(sample_image)
#if should_mask:
# self.mask = Mask(sample_image)
self.thresholded_low = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.thresholded_high = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.thresholded_combined = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
#self.should_mask = should_mask
#self.channel = channel
#self.debug = False
#self.tune = tune
#if tune:
# cv.NamedWindow('low', 1)
# cv.NamedWindow('high', 1)
#def set_thresholds(self, thresholds):
# self.thres_low = thresholds[0]
# self.thresh_high = thresholds[1]
def get_thresholded_image(self):
return self.thresholded_combined
def threshold(self, thres_low, thres_high, thres_chan):
result_val = 1 #Change result_val to 255 if need to view image
cv.Threshold(thres_chan, self.thresholded_low, thres_low, result_val, cv.CV_THRESH_BINARY)
cv.Dilate(self.thresholded_low, self.thresholded_low) #thresholded_low thresholded image using threshold for dark regions
blob.remove_large_blobs(self.thresholded_low, self.max_area)
cv.Threshold(thres_chan, self.thresholded_high, thres_high, result_val, cv.CV_THRESH_BINARY)
cv.Dilate(self.thresholded_high, self.thresholded_high) #thresholded_high thresholded image using threshold for bright regions
blob.remove_large_blobs(self.thresholded_high, self.max_area)#, show=True)
cv.Or(self.thresholded_low, self.thresholded_high, self.thresholded_combined)
return self.thresholded_combined
class MotionSubtract:
def __init__(self, sample_image, max_area, adaptation_rate=0.8, threshold=10):
self.max_area = max_area
self.accumulator = cv.CreateImage(cv.GetSize(sample_image), 32, 1)
cv.SetZero(self.accumulator)
self.thresholded_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)
self.difference_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)
self.green32_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)
self.adaptation_rate = adaptation_rate
self.threshold = threshold
def get_thresholded_image(self):
return self.thresholded_img
def subtract(self, thres_chan):
cv.RunningAvg(thres_chan, self.accumulator, self.adaptation_rate)
cv.CvtScale(thres_chan, self.green32_img)
cv.Sub(self.green32_img, self.accumulator, self.difference_img)
cv.Threshold(self.difference_img, self.thresholded_img, self.threshold, 1, cv.CV_THRESH_BINARY)
cv.Dilate(self.thresholded_img, self.thresholded_img, iterations=1)
blob.remove_large_blobs(self.thresholded_img, max_area = self.max_area)
return self.thresholded_img
def make_visible_binary_image(img):
cv.Threshold(img, img, 0, 255, cv.CV_THRESH_BINARY)
| ajibawa-2023/Python-Code-Large/train/row_99228 | 71 | 105 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99228:ImportFrom_L1_C0", "label": "from pkg import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0095, 0.0095, 0, 0.66, 0.0, 489, 0, 1, 0, 0, 489, 0, 0], "semantic": {"name": "pkg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pkg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Import_L2_C0", "label": "cv import cv", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.019, 0.0095, 0, 0.66, 0.125, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Import_L3_C0", "label": "laser_interface.blob import blob", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0286, 0.0095, 0, 0.66, 0.25, 145, 0, 1, 0, 0, 145, 0, 0], "semantic": {"name": "laser_interface.blob", "arg_names": [], "import_names": ["blob"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_interface.blob as blob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L5_C0", "label": "CombineMasks", "type": "class", "loc": [5, 13], "level": 0, "parent": null, "vector": [3, 0, 0.0857, 0.0857, 0, 0.66, 0.375, 256, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "CombineMasks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CombineMasks:\n def __init__(self, sample_image, channels=1):\n self.combined = cv.CreateImage(cv.GetSize(sample_image), 8 , channels)\n\n def combine(self, images):\n cv.Set(self.combined, 1)\n for img in images:\n cv.Mul(self.combined, img, self.combined)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L6_C4", "label": "__init__", "type": "function", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L5_C0", "vector": [2, 1, 0.0619, 0.019, 1, 0.09, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "sample_image", "channels"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sample_image, channels=1):\n self.combined = cv.CreateImage(cv.GetSize(sample_image), 8 , channels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L7_C8", "label": "self.combined = CreateImage()", "type": "assigned_variable", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L6_C4", "vector": [14, 2, 0.0667, 0.0095, 2, 0.89, 0.0, 762, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.combined", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.combined = cv.CreateImage(cv.GetSize(sample_image), 8 , channels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "label": "combine", "type": "function", "loc": [9, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L5_C0", "vector": [2, 1, 0.1048, 0.0476, 1, 0.09, 1.0, 624, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "combine", "arg_names": ["self", "images"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def combine(self, images):\n cv.Set(self.combined, 1)\n for img in images:\n cv.Mul(self.combined, img, self.combined)\n return self.combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L10_C8", "label": "Set()", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "vector": [8, 2, 0.0952, 0.0095, 2, 0.48, 0.0, 438, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Set", "arg_names": [], "import_names": [], "rhs_call_name": "Set", "annotation": ""}, "snippet": " cv.Set(self.combined, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:For_L11_C8", "label": "for img", "type": "for", "loc": [11, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "vector": [6, 2, 0.1095, 0.019, 2, 0.48, 0.5, 200, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for img in images:\n cv.Mul(self.combined, img, self.combined)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L12_C12", "label": "Mul()", "type": "expression", "loc": [12, 12], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:For_L11_C8", "vector": [8, 3, 0.1143, 0.0095, 3, 0.37, 0.0, 504, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Mul", "arg_names": [], "import_names": [], "rhs_call_name": "Mul", "annotation": ""}, "snippet": " cv.Mul(self.combined, img, self.combined)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L13_C8", "label": "return", "type": "return", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "vector": [13, 2, 0.1238, 0.0095, 2, 0.48, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L15_C0", "label": "Mask", "type": "class", "loc": [15, 27], "level": 0, "parent": null, "vector": [3, 0, 0.2, 0.1238, 0, 0.66, 0.5, 976, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "Mask", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Mask:\n def __init__(self, sample_image):\n self.thres_red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.thres_green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.thres_blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.merged_frame = cv.CreateImage(cv.GetSize(sample_image), 8 , 3)\n\n def mask(self, mask, r, g, b):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "label": "__init__", "type": "function", "loc": [16, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L15_C0", "vector": [2, 1, 0.1714, 0.0476, 1, 0.86, 0.0, 555, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self", "sample_image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sample_image):\n self.thres_red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.thres_green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.thres_blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.merged_frame = cv.CreateImage(cv.GetSize(sample_image), 8 , 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L17_C8", "label": "self.thres_red_img = CreateImage()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "vector": [14, 2, 0.1619, 0.0095, 2, 0.18, 0.0, 446, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thres_red_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thres_red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L18_C8", "label": "self.thres_green_img = CreateImage()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "vector": [14, 2, 0.1714, 0.0095, 2, 0.18, 0.3333, 939, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thres_green_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thres_green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L19_C8", "label": "self.thres_blue_img = CreateImage()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "vector": [14, 2, 0.181, 0.0095, 2, 0.18, 0.6667, 582, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thres_blue_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thres_blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L20_C8", "label": "self.merged_frame = CreateImage()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "vector": [14, 2, 0.1905, 0.0095, 2, 0.18, 1.0, 854, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.merged_frame", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.merged_frame = cv.CreateImage(cv.GetSize(sample_image), 8 , 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "label": "mask", "type": "function", "loc": [22, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L15_C0", "vector": [2, 1, 0.2333, 0.0571, 1, 0.86, 1.0, 904, 0, 5, 1, 0, 0, 0, 4], "semantic": {"name": "mask", "arg_names": ["self", "mask", "r", "g", "b"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mask(self, mask, r, g, b):\n cv.Mul(r, mask, self.thres_red_img)\n cv.Mul(g, mask, self.thres_green_img)\n cv.Mul(b, mask, self.thres_blue_img)\n cv.Merge(self.thres_blue_img, self.thres_green_img, self.thres_red_img, None, self.merged_frame);\n return self.merged_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L23_C8", "label": "Mul()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "vector": [8, 2, 0.219, 0.0095, 2, 0.01, 0.0, 504, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Mul", "arg_names": [], "import_names": [], "rhs_call_name": "Mul", "annotation": ""}, "snippet": " cv.Mul(r, mask, self.thres_red_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L24_C8", "label": "Mul()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "vector": [8, 2, 0.2286, 0.0095, 2, 0.01, 0.25, 504, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Mul", "arg_names": [], "import_names": [], "rhs_call_name": "Mul", "annotation": ""}, "snippet": " cv.Mul(g, mask, self.thres_green_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L25_C8", "label": "Mul()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "vector": [8, 2, 0.2381, 0.0095, 2, 0.01, 0.5, 504, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Mul", "arg_names": [], "import_names": [], "rhs_call_name": "Mul", "annotation": ""}, "snippet": " cv.Mul(b, mask, self.thres_blue_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L26_C8", "label": "Merge()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "vector": [8, 2, 0.2476, 0.0095, 2, 0.01, 0.75, 677, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Merge", "arg_names": [], "import_names": [], "rhs_call_name": "Merge", "annotation": ""}, "snippet": " cv.Merge(self.thres_blue_img, self.thres_green_img, self.thres_red_img, None, self.merged_frame);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "vector": [13, 2, 0.2571, 0.0095, 2, 0.01, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.merged_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L29_C0", "label": "SplitColors", "type": "class", "loc": [29, 37], "level": 0, "parent": null, "vector": [3, 0, 0.3143, 0.0857, 0, 0.66, 0.625, 70, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "SplitColors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SplitColors:\n def __init__(self, sample_image):\n self.green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n\n def split(self, image):\n cv.Split(image, self.blue_img, self.green_img, self.red_img, None);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "label": "__init__", "type": "function", "loc": [30, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L29_C0", "vector": [2, 1, 0.3, 0.0381, 1, 0.85, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "sample_image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sample_image):\n self.green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L31_C8", "label": "self.green_img = CreateImage()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "vector": [14, 2, 0.2952, 0.0095, 2, 0.43, 0.0, 50, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.green_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.green_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L32_C8", "label": "self.red_img = CreateImage()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "vector": [14, 2, 0.3048, 0.0095, 2, 0.43, 0.5, 736, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.red_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.red_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L33_C8", "label": "self.blue_img = CreateImage()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "vector": [14, 2, 0.3143, 0.0095, 2, 0.43, 1.0, 120, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.blue_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.blue_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L35_C4", "label": "split", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L29_C0", "vector": [2, 1, 0.3429, 0.0286, 1, 0.85, 1.0, 908, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "split", "arg_names": ["self", "image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def split(self, image):\n cv.Split(image, self.blue_img, self.green_img, self.red_img, None);\n return (self.red_img, self.green_img, self.blue_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L36_C8", "label": "Split()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L35_C4", "vector": [8, 2, 0.3429, 0.0095, 2, 0.71, 0.0, 551, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Split", "arg_names": [], "import_names": [], "rhs_call_name": "Split", "annotation": ""}, "snippet": " cv.Split(image, self.blue_img, self.green_img, self.red_img, None);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L35_C4", "vector": [13, 2, 0.3524, 0.0095, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (self.red_img, self.green_img, self.blue_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "label": "BrightnessThreshold", "type": "class", "loc": [39, 78], "level": 0, "parent": null, "vector": [3, 0, 0.5571, 0.381, 0, 0.66, 0.75, 650, 0, 3, 0, 0, 0, 0, 13], "semantic": {"name": "BrightnessThreshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BrightnessThreshold:\n def __init__(self, sample_image, max_area): #, tune=False):\n #self.thres_low = thres_low\n #self.thres_high = thres_high\n self.max_area = max_area\n #self.set_thresholds([thres_low, thres_high])\n #self.csplit = SplitColors(sample_image)\n #if should_mask:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "label": "__init__", "type": "function", "loc": [40, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "vector": [2, 1, 0.4286, 0.1048, 1, 0.25, 0.0, 555, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "sample_image", "max_area"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sample_image, max_area): #, tune=False):\n #self.thres_low = thres_low\n #self.thres_high = thres_high\n self.max_area = max_area\n #self.set_thresholds([thres_low, thres_high])\n #self.csplit = SplitColors(sample_image)\n #if should_mask:\n # self.mask = Mask(sample_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L43_C8", "label": "self.max_area =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "vector": [14, 2, 0.4095, 0.0095, 2, 0.67, 0.0, 75, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_area", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_area = max_area"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L48_C8", "label": "self.thresholded_low = CreateImage()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "vector": [14, 2, 0.4571, 0.0095, 2, 0.67, 0.3333, 165, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thresholded_low", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thresholded_low = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L49_C8", "label": "self.thresholded_high = CreateImage()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "vector": [14, 2, 0.4667, 0.0095, 2, 0.67, 0.6667, 763, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thresholded_high", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thresholded_high = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L50_C8", "label": "self.thresholded_combined = CreateImage()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "vector": [14, 2, 0.4762, 0.0095, 2, 0.67, 1.0, 604, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thresholded_combined", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thresholded_combined = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L63_C4", "label": "get_thresholded_image", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "vector": [2, 1, 0.6048, 0.019, 1, 0.25, 0.5, 612, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_thresholded_image", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_thresholded_image(self):\n return self.thresholded_combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L63_C4", "vector": [13, 2, 0.6095, 0.0095, 2, 0.57, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.thresholded_combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "label": "threshold", "type": "function", "loc": [66, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "vector": [2, 1, 0.6857, 0.1238, 1, 0.25, 1.0, 635, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "threshold", "arg_names": ["self", "thres_low", "thres_high", "thres_chan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def threshold(self, thres_low, thres_high, thres_chan):\n result_val = 1 #Change result_val to 255 if need to view image\n\n cv.Threshold(thres_chan, self.thresholded_low, thres_low, result_val, cv.CV_THRESH_BINARY)\n cv.Dilate(self.thresholded_low, self.thresholded_low) #thresholded_low thresholded image using threshold for dark regions\n blob.remove_large_blobs(self.thresholded_low, self.max_area)\n\n cv.Threshold(thres_chan, self.thresholded_high, thres_high, result_val, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L67_C8", "label": "result_val =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [14, 2, 0.6381, 0.0095, 2, 0.09, 0.0, 612, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "result_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result_val = 1 #Change result_val to 255 if need to view image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L69_C8", "label": "Threshold()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.6571, 0.0095, 2, 0.09, 0.125, 302, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Threshold", "arg_names": [], "import_names": [], "rhs_call_name": "Threshold", "annotation": ""}, "snippet": " cv.Threshold(thres_chan, self.thresholded_low, thres_low, result_val, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L70_C8", "label": "Dilate()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.6667, 0.0095, 2, 0.09, 0.25, 207, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Dilate", "arg_names": [], "import_names": [], "rhs_call_name": "Dilate", "annotation": ""}, "snippet": " cv.Dilate(self.thresholded_low, self.thresholded_low) #thresholded_low thresholded image using threshold for dark regions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L71_C8", "label": "remove_large_blobs()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.6762, 0.0095, 2, 0.09, 0.375, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "remove_large_blobs", "arg_names": [], "import_names": [], "rhs_call_name": "remove_large_blobs", "annotation": ""}, "snippet": " blob.remove_large_blobs(self.thresholded_low, self.max_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L73_C8", "label": "Threshold()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.6952, 0.0095, 2, 0.09, 0.5, 302, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Threshold", "arg_names": [], "import_names": [], "rhs_call_name": "Threshold", "annotation": ""}, "snippet": " cv.Threshold(thres_chan, self.thresholded_high, thres_high, result_val, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L74_C8", "label": "Dilate()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.7048, 0.0095, 2, 0.09, 0.625, 207, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Dilate", "arg_names": [], "import_names": [], "rhs_call_name": "Dilate", "annotation": ""}, "snippet": " cv.Dilate(self.thresholded_high, self.thresholded_high) #thresholded_high thresholded image using threshold for bright regions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L75_C8", "label": "remove_large_blobs()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.7143, 0.0095, 2, 0.09, 0.75, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "remove_large_blobs", "arg_names": [], "import_names": [], "rhs_call_name": "remove_large_blobs", "annotation": ""}, "snippet": " blob.remove_large_blobs(self.thresholded_high, self.max_area)#, show=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L77_C8", "label": "Or()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [8, 2, 0.7333, 0.0095, 2, 0.09, 0.875, 914, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Or", "arg_names": [], "import_names": [], "rhs_call_name": "Or", "annotation": ""}, "snippet": " cv.Or(self.thresholded_low, self.thresholded_high, self.thresholded_combined)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L78_C8", "label": "return", "type": "return", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "vector": [13, 2, 0.7429, 0.0095, 2, 0.09, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.thresholded_combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "label": "MotionSubtract", "type": "class", "loc": [80, 101], "level": 0, "parent": null, "vector": [3, 0, 0.8619, 0.2095, 0, 0.66, 0.875, 785, 0, 3, 0, 0, 0, 0, 15], "semantic": {"name": "MotionSubtract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MotionSubtract:\n def __init__(self, sample_image, max_area, adaptation_rate=0.8, threshold=10):\n self.max_area = max_area\n self.accumulator = cv.CreateImage(cv.GetSize(sample_image), 32, 1)\n cv.SetZero(self.accumulator)\n self.thresholded_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.difference_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)\n self.green32_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "label": "__init__", "type": "function", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "vector": [2, 1, 0.8095, 0.0857, 1, 0.19, 0.0, 555, 0, 5, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "sample_image", "max_area", "adaptation_rate", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sample_image, max_area, adaptation_rate=0.8, threshold=10):\n self.max_area = max_area\n self.accumulator = cv.CreateImage(cv.GetSize(sample_image), 32, 1)\n cv.SetZero(self.accumulator)\n self.thresholded_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)\n self.difference_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)\n self.green32_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)\n self.adaptation_rate = adaptation_rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L82_C8", "label": "self.max_area =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.781, 0.0095, 2, 0.02, 0.0, 75, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_area", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_area = max_area"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L83_C8", "label": "self.accumulator = CreateImage()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.7905, 0.0095, 2, 0.02, 0.1429, 55, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.accumulator", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.accumulator = cv.CreateImage(cv.GetSize(sample_image), 32, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L84_C8", "label": "SetZero()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [8, 2, 0.8, 0.0095, 2, 0.02, 0.2857, 446, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetZero", "arg_names": [], "import_names": [], "rhs_call_name": "SetZero", "annotation": ""}, "snippet": " cv.SetZero(self.accumulator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L85_C8", "label": "self.thresholded_img = CreateImage()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.8095, 0.0095, 2, 0.02, 0.4286, 486, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.thresholded_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.thresholded_img = cv.CreateImage(cv.GetSize(sample_image), 8 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L86_C8", "label": "self.difference_img = CreateImage()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.819, 0.0095, 2, 0.02, 0.5714, 708, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.difference_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.difference_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L87_C8", "label": "self.green32_img = CreateImage()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.8286, 0.0095, 2, 0.02, 0.7143, 307, 3, 3, 0, 0, 288, 10, 2], "semantic": {"name": "self.green32_img", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImage", "annotation": ""}, "snippet": " self.green32_img = cv.CreateImage(cv.GetSize(sample_image), 32 , 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L88_C8", "label": "self.adaptation_rate =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.8381, 0.0095, 2, 0.02, 0.8571, 776, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.adaptation_rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.adaptation_rate = adaptation_rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L89_C8", "label": "self.threshold =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "vector": [14, 2, 0.8476, 0.0095, 2, 0.02, 1.0, 493, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.threshold = threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L91_C4", "label": "get_thresholded_image", "type": "function", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "vector": [2, 1, 0.8714, 0.019, 1, 0.19, 0.5, 612, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_thresholded_image", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_thresholded_image(self):\n return self.thresholded_img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L91_C4", "vector": [13, 2, 0.8762, 0.0095, 2, 0.58, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.thresholded_img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "label": "subtract", "type": "function", "loc": [94, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "vector": [2, 1, 0.9286, 0.0762, 1, 0.19, 1.0, 495, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "subtract", "arg_names": ["self", "thres_chan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def subtract(self, thres_chan):\n cv.RunningAvg(thres_chan, self.accumulator, self.adaptation_rate)\n cv.CvtScale(thres_chan, self.green32_img)\n cv.Sub(self.green32_img, self.accumulator, self.difference_img)\n cv.Threshold(self.difference_img, self.thresholded_img, self.threshold, 1, cv.CV_THRESH_BINARY)\n cv.Dilate(self.thresholded_img, self.thresholded_img, iterations=1)\n blob.remove_large_blobs(self.thresholded_img, max_area = self.max_area)\n return self.thresholded_img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L95_C8", "label": "RunningAvg()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [8, 2, 0.9048, 0.0095, 2, 0.98, 0.0, 989, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "RunningAvg", "arg_names": [], "import_names": [], "rhs_call_name": "RunningAvg", "annotation": ""}, "snippet": " cv.RunningAvg(thres_chan, self.accumulator, self.adaptation_rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L96_C8", "label": "CvtScale()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [8, 2, 0.9143, 0.0095, 2, 0.98, 0.1667, 582, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "CvtScale", "arg_names": [], "import_names": [], "rhs_call_name": "CvtScale", "annotation": ""}, "snippet": " cv.CvtScale(thres_chan, self.green32_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L97_C8", "label": "Sub()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [8, 2, 0.9238, 0.0095, 2, 0.98, 0.3333, 570, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Sub", "arg_names": [], "import_names": [], "rhs_call_name": "Sub", "annotation": ""}, "snippet": " cv.Sub(self.green32_img, self.accumulator, self.difference_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L98_C8", "label": "Threshold()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [8, 2, 0.9333, 0.0095, 2, 0.98, 0.5, 302, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Threshold", "arg_names": [], "import_names": [], "rhs_call_name": "Threshold", "annotation": ""}, "snippet": " cv.Threshold(self.difference_img, self.thresholded_img, self.threshold, 1, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L99_C8", "label": "Dilate()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [8, 2, 0.9429, 0.0095, 2, 0.98, 0.6667, 207, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Dilate", "arg_names": [], "import_names": [], "rhs_call_name": "Dilate", "annotation": ""}, "snippet": " cv.Dilate(self.thresholded_img, self.thresholded_img, iterations=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L100_C8", "label": "remove_large_blobs()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [8, 2, 0.9524, 0.0095, 2, 0.98, 0.8333, 556, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "remove_large_blobs", "arg_names": [], "import_names": [], "rhs_call_name": "remove_large_blobs", "annotation": ""}, "snippet": " blob.remove_large_blobs(self.thresholded_img, max_area = self.max_area)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L101_C8", "label": "return", "type": "return", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "vector": [13, 2, 0.9619, 0.0095, 2, 0.98, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.thresholded_img"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L103_C0", "label": "make_visible_binary_image", "type": "function", "loc": [103, 104], "level": 0, "parent": null, "vector": [2, 0, 0.9857, 0.019, 0, 0.66, 1.0, 768, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "make_visible_binary_image", "arg_names": ["img"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_visible_binary_image(img):\n cv.Threshold(img, img, 0, 255, cv.CV_THRESH_BINARY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L104_C4", "label": "Threshold()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L103_C0", "vector": [8, 1, 0.9905, 0.0095, 1, 0.76, 0.0, 302, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "Threshold", "arg_names": [], "import_names": [], "rhs_call_name": "Threshold", "annotation": ""}, "snippet": " cv.Threshold(img, img, 0, 255, cv.CV_THRESH_BINARY)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:For_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:For_L11_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L12_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:ClassDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Return_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99228:FunctionDef_L103_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99228:Expr_L104_C4"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
#from opencv import cv
#from opencv import highgui
import numpy as np
import pickle as pk
def list_mat_to_mat(list_mat, axis=0):
return np.concatenate(tuple(list_mat), axis=axis)
def load_pickle(filename):
p = open(filename, 'r')
picklelicious = pk.load(p)
p.close()
return picklelicious
def dump_pickle(object, filename):
pickle_file = open(filename, 'w')
pk.dump(object, pickle_file)
pickle_file.close()
#import Image as Image
#cv2np_type_dict = {cv.CV_16S : (np.int16, 1),
# cv.CV_16SC : (np.int16, 1),
# cv.CV_16SC1 : (np.int16, 1),
# cv.CV_16SC2 : (np.int16, 2),
# cv.CV_16SC3 : (np.int16, 3),
# cv.CV_16SC4 : (np.int16, 4),
# cv.CV_16U : (np.uint16, 1),
# cv.CV_16UC : (np.uint16, 1),
# cv.CV_16UC1 : (np.uint16, 1),
# cv.CV_16UC2 : (np.uint16, 2),
# cv.CV_16UC3 : (np.uint16, 3),
# cv.CV_16UC4 : (np.uint16, 4),
# cv.CV_32F : (np.float32, 1),
# cv.CV_32FC : (np.float32, 1),
# cv.CV_32FC1 : (np.float32, 1),
# cv.CV_32FC2 : (np.float32, 2),
# cv.CV_32FC3 : (np.float32, 3),
# cv.CV_32FC4 : (np.float32, 4),
# cv.CV_32S : (np.int32, 1),
# cv.CV_32SC : (np.int32, 1),
# cv.CV_32SC1 : (np.int32, 1),
# cv.CV_32SC2 : (np.int32, 2),
# cv.CV_32SC3 : (np.int32, 3),
# cv.CV_32SC4 : (np.int32, 4),
# cv.CV_64F : (np.float64, 1),
# cv.CV_64FC : (np.float64, 1),
# cv.CV_64FC1 : (np.float64, 1),
# cv.CV_64FC2 : (np.float64, 2),
# cv.CV_64FC3 : (np.float64, 3),
# cv.CV_64FC4 : (np.float64, 4),
# cv.CV_8S : (np.int8, 1),
# cv.CV_8SC : (np.int8, 1),
# cv.CV_8SC1 : (np.int8, 1),
# cv.CV_8SC2 : (np.int8, 2),
# cv.CV_8SC3 : (np.int8, 3),
# cv.CV_8SC4 : (np.int8, 4),
# cv.CV_8U : (np.uint8, 1),
# cv.CV_8UC : (np.uint8, 1),
# cv.CV_8UC1 : (np.uint8, 1),
# cv.CV_8UC2 : (np.uint8, 2),
# cv.CV_8UC3 : (np.uint8, 3),
# cv.CV_8UC4 : (np.uint8, 4)}
#def numpymat2cvmat(nmat):
# raise RuntimeError("numpymat2cvmat: use something else")
# #cvmat = cv.cvCreateMat(nmat.shape[0],nmat.shape[1],cv.CV_32FC1)
# #for i in range(nmat.shape[0]):
# # for j in range(nmat.shape[1]):
# # #print cvmat[i][j]
# # #print nmat[i,j]
# # cvmat[i,j] = nmat[i,j]
# #return cvmat
#
#def cvmat2numpymat(cvmat):
# raise RuntimeError("cvmat2numpymat: use something else")
# #nmat = np.zeros((cvmat.width,cvmat.height))
# #for i in range(cvmat.width):
# # for j in range(cvmat.height):
# # nmat[i][j] = cvmat[i][j]
# #return nmat
#
#def cv2np(im, format='RGB'):
# raise RuntimeError("cv2np: use something else")
# #if format == 'BGR':
# # cv.cvCvtColor( im, im, cv.CV_BGR2RGB )
# #numpy_type, nchannels = cv2np_type_dict[cv.cvGetElemType(im)]
# #array_size = [im.height, im.width, nchannels]
# #np_im = np.frombuffer(im.imageData, dtype=numpy_type,
# # count=im.height*im.width*nchannels*(im.depth/8))
# #return np.reshape(np_im, array_size)
#def np2cv(im):
# raise RuntimeError("np2cv: use something else")
# #image = np2pil( im )
# #image.save('test.bmp', 'BMP')
# #cvim = highgui.cvLoadImage('test.bmp')
# #return cvim
#def np2pil( im ):
# """ for grayscale - all values must be between 0 and 255.
# not sure about color yet.
# """
# raise RuntimeError("np2pil: moved to hrl_lib.util")
# ##TODO: print 'util.np2cv: works for texseg.py'
# ##TODO: print 'util.np2cv: more extensive tests would be useful'
# #if len(im.shape) == 3:
# # shp = im.shape
# # channels = shp[2]
# # height, width = shp[0], shp[1]
# #elif len(im.shape) == 2:
# # height, width = im.shape
# # channels = 1
# #else:
# # raise AssertionError("unrecognized shape for the input image. should be 3 or 2, but was %d." % len(im.shape))
# #
# #if channels == 3:
# # image = Image.fromstring( "RGB", (width, height), im.tostring() )
# #if channels == 1:
# # im = np.array(im, dtype=np.uint8)
# # image = Image.fromarray(im)
# # #image = Image.fromstring( "L", (width, height), im.tostring() )
# #
# #return image
| ajibawa-2023/Python-Code-Large/train/row_99229 | 13 | 171 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Import_L31_C0", "label": "numpy import np", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1813, 0.0058, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Import_L32_C0", "label": "pickle import pk", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1871, 0.0058, 0, 0.66, 0.25, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pk"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle as pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L34_C0", "label": "list_mat_to_mat", "type": "function", "loc": [34, 35], "level": 0, "parent": null, "vector": [2, 0, 0.2018, 0.0117, 0, 0.66, 0.5, 162, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "list_mat_to_mat", "arg_names": ["list_mat", "axis"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def list_mat_to_mat(list_mat, axis=0):\n\treturn np.concatenate(tuple(list_mat), axis=axis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Return_L35_C1", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L34_C0", "vector": [13, 1, 0.2047, 0.0058, 1, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn np.concatenate(tuple(list_mat), axis=axis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "label": "load_pickle", "type": "function", "loc": [37, 41], "level": 0, "parent": null, "vector": [2, 0, 0.2281, 0.0292, 0, 0.66, 0.75, 65, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "load_pickle", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_pickle(filename):\n p = open(filename, 'r')\n picklelicious = pk.load(p)\n p.close()\n return picklelicious"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Assign_L38_C4", "label": "p = open()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "vector": [14, 1, 0.2222, 0.0058, 1, 0.09, 0.0, 491, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " p = open(filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Assign_L39_C4", "label": "picklelicious = load()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "vector": [14, 1, 0.2281, 0.0058, 1, 0.09, 0.3333, 536, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "picklelicious", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " picklelicious = pk.load(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Expr_L40_C4", "label": "close()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "vector": [8, 1, 0.2339, 0.0058, 1, 0.09, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " p.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Return_L41_C4", "label": "return", "type": "return", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "vector": [13, 1, 0.2398, 0.0058, 1, 0.09, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return picklelicious"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "label": "dump_pickle", "type": "function", "loc": [43, 46], "level": 0, "parent": null, "vector": [2, 0, 0.2602, 0.0234, 0, 0.66, 1.0, 252, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "dump_pickle", "arg_names": ["object", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dump_pickle(object, filename):\n pickle_file = open(filename, 'w')\n pk.dump(object, pickle_file)\n pickle_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Assign_L44_C4", "label": "pickle_file = open()", "type": "assigned_variable", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "vector": [14, 1, 0.2573, 0.0058, 1, 0.61, 0.0, 757, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "pickle_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " pickle_file = open(filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Expr_L45_C4", "label": "dump()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "vector": [8, 1, 0.2632, 0.0058, 1, 0.61, 0.5, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " pk.dump(object, pickle_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99229:Expr_L46_C4", "label": "close()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "vector": [8, 1, 0.269, 0.0058, 1, 0.61, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " pickle_file.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Return_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Return_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99229:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99229:Expr_L46_C4"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import roslib
roslib.load_manifest('laser_interface')
import rospy
CURSOR_TOPIC = 'cursor3d'
VIZ_TOPIC = 'viz_cursor_3d'
MOUSE_CLICK_TOPIC = 'mouse_click'
MOUSE_R_CLICK_TOPIC = 'mouse_r_click'
MOUSE_DOUBLE_CLICK_TOPIC = 'mouse_left_double_click'
MOUSE_R_DOUBLE_CLICK_TOPIC = 'mouse_right_double_click'
LASER_MODE_TOPIC = 'laser_mode'
| ajibawa-2023/Python-Code-Large/train/row_99230 | 10 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Import_L27_C0", "label": "roslib import roslib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.7297, 0.027, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Expr_L28_C0", "label": "load_manifest()", "type": "expression", "loc": [28, 28], "level": 0, "parent": null, "vector": [8, 0, 0.7568, 0.027, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('laser_interface')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Import_L29_C0", "label": "rospy import rospy", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.7838, 0.027, 0, 0.66, 0.2222, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L31_C0", "label": "CURSOR_TOPIC =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.8378, 0.027, 0, 0.66, 0.3333, 687, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CURSOR_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CURSOR_TOPIC = 'cursor3d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L32_C0", "label": "VIZ_TOPIC =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.8649, 0.027, 0, 0.66, 0.4444, 529, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VIZ_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VIZ_TOPIC = 'viz_cursor_3d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L33_C0", "label": "MOUSE_CLICK_TOPIC =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.8919, 0.027, 0, 0.66, 0.5556, 652, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_CLICK_TOPIC = 'mouse_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L34_C0", "label": "MOUSE_R_CLICK_TOPIC =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9189, 0.027, 0, 0.66, 0.6667, 595, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_R_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_R_CLICK_TOPIC = 'mouse_r_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L35_C0", "label": "MOUSE_DOUBLE_CLICK_TOPIC =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9459, 0.027, 0, 0.66, 0.7778, 984, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_DOUBLE_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_DOUBLE_CLICK_TOPIC = 'mouse_left_double_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L36_C0", "label": "MOUSE_R_DOUBLE_CLICK_TOPIC =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.973, 0.027, 0, 0.66, 0.8889, 792, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_R_DOUBLE_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_R_DOUBLE_CLICK_TOPIC = 'mouse_right_double_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99230:Assign_L37_C0", "label": "LASER_MODE_TOPIC =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.027, 0, 0.66, 1.0, 123, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LASER_MODE_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LASER_MODE_TOPIC = 'laser_mode'"}] | [] |
from pkg import *
from geometry_msgs.msg import Point
import sys
class Echo:
def echo(self, point):
print 'x y z', point.x, point.y, point.z
rospy.Publisher(CURSOR_TOPIC, Point, Echo().echo)
rospy.init_node('cursor3d_listener')
rospy.spin()
| ajibawa-2023/Python-Code-Large/train/row_99231 | 9 | 16 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99231:ImportFrom_L1_C0", "label": "from pkg import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 489, 0, 1, 0, 0, 489, 0, 0], "semantic": {"name": "pkg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pkg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:ImportFrom_L2_C0", "label": "from geometry_msgs.msg import Point", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0625, 0, 0.66, 0.1667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1875, 0.0625, 0, 0.66, 0.3333, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:ClassDef_L5_C0", "label": "Echo", "type": "class", "loc": [5, 7], "level": 0, "parent": null, "vector": [3, 0, 0.375, 0.1875, 0, 0.66, 0.5, 165, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Echo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Echo:\n def echo(self, point):\n print('x y z', point.x, point.y, point.z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:FunctionDef_L6_C4", "label": "echo", "type": "function", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99231:ClassDef_L5_C0", "vector": [2, 1, 0.4062, 0.125, 1, 0.53, 0.0, 807, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "echo", "arg_names": ["self", "point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def echo(self, point):\n print('x y z', point.x, point.y, point.z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:Expr_L7_C8", "label": "print()", "type": "expression", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99231:FunctionDef_L6_C4", "vector": [8, 2, 0.4375, 0.0625, 2, 0.45, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('x y z', point.x, point.y, point.z)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:Expr_L9_C0", "label": "Publisher()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.5625, 0.0625, 0, 0.66, 0.6667, 45, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "Publisher", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "rospy.Publisher(CURSOR_TOPIC, Point, Echo().echo)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:Expr_L10_C0", "label": "init_node()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.625, 0.0625, 0, 0.66, 0.8333, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node('cursor3d_listener')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99231:Expr_L11_C0", "label": "spin()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.6875, 0.0625, 0, 0.66, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": "rospy.spin()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99231:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99231:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99231:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99231:Expr_L7_C8"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
#import videre as vd
#import opencv as cv
#from opencv import highgui as hg
from pkg import *
import cv
import numpy as np
from sensor_msgs.msg import CameraInfo
import util as ut
import math as m
import time
###################################################################################################
# Cameras
# The camera classes in this file are separated into two different types of
# classes. In the first group are hardware camera classes meant for
# abstracting away hardware devices that provide a grid of pixels at every
# time step. The second group contain abstract mathematical camera classes
# which satisfies the definition of a camera as a device that transform 3D
# world points into 2D coordinates in a plane.
#
# This was done so that different hardware camera classes can be swapped in
# and out without requiring that the mathematical abstract camera be changed.
# For example, to work off of a video recorded from disk the geometric camera class
# can remain the same while the hardware camera class is swapped for one that
# provide images from a file.
###################################################################################################
###################################################################################################
# Geometric reasoning functions
###################################################################################################
def homo_transform3d(R, t):
T = np.matrix(np.zeros((4,4)))
T[0:3, 0:3] = R
T[0:3, 3] = t
T[3,3] = 1.0
return T
#Rotates the coordinate frame counterclockwise
def Rx(a):
return np.matrix([[1, 0, 0,],
[0, m.cos(a), m.sin(a)],
[0, -m.sin(a), m.cos(a)]])
#Rotates the coordinate frame counterclockwise
def Ry(a):
return np.matrix([[m.cos(a), 0, -m.sin(a)],
[0, 1, 0],
[m.sin(a), 0, m.cos(a)]])
#Rotates the coordinate frame counterclockwise
def Rz(a):
return np.matrix([[ m.cos(a), m.sin(a), 0],
[-m.sin(a), m.cos(a), 0],
[ 0, 0, 1]])
def rotation(rx,ry,rz):
return Rx(rx) * Ry(ry) * Rz(rz)
def points_on_line(homogeneous2d_line, img_height):
a = homogeneous2d_line[0,0]
b = homogeneous2d_line[1,0]
c = homogeneous2d_line[2,0]
if b == 0:
x = -c/a
return [np.matrix([x, 0, 1]).T,
np.matrix([x, img_height, 1])]
else:
return [np.matrix([-c/a, 0, 1]),
np.matrix([(-b/a) * img_height - (c/a), img_height, 1])]
def tuple_to_homo(p):
return np.matrix([p[0], p[1], 1]).T
def cvpoint_to_homo(p):
return np.matrix([p.x, p.y, 1]).T
def homo_to_cvpoint(p):
p = p / p[-1,0]
#return cv.Point(int(round(p[0,0])), int(round(p[1,0])))
return (int(round(p[0,0])), int(round(p[1,0])))
def rodrigues(vec):
cvvec = ut.numpymat2cvmat(vec)
dst = cv.CreateMat(3, 3, cv.CV_32FC1)
cv.Rodrigues2(cvvec, dst)
return ut.cvmat2numpymat(dst).T
def normalize_homo_point(point):
point = point / point[-1,0]
return point
def homo_to_point(homo_point):
p = normalize_homo_point(homo_point)
return p[0:-1,:]
def point_to_homo(point):
return np.concatenate((point, 1.0+np.zeros((1,point.shape[1]))), axis=0)
def general_projection_matrix():
P = np.matrix(np.zeros((3,4)))
P[0:3, 0:3] = np.eye(3)
return P
###################################################################################################
# Hardware Cameras
###################################################################################################
class ROSStereoListener:
def __init__(self, topics, rate=30.0, name='stereo_listener'):
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import hrl_lib.rutils as ru
self.listener = ru.GenericListener(name, [Image, Image], topics, rate)
self.lbridge = CvBridge()
self.rbridge = CvBridge()
def next(self):
#print 'ros_stereo_listener'
lros, rros = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)
lcv = self.lbridge.imgmsg_to_cv(lros, 'bgr8')
rcv = self.rbridge.imgmsg_to_cv(rros, 'bgr8')
return lcv, rcv
class StereoFile:
def __init__(self, left_file, right_file):
self.left = cv.CreateFileCapture(left_file);
self.right = cv.CreateFileCapture(right_file);
#self.total_frames = hg.cvGetCaptureProperty(self.left, hg.CV_CAP_PROP_FRAME_COUNT)
def next(self):
tup = (cv.QueryFrame(self.left), cv.QueryFrame(self.right))
#frame_numb = hg.cvGetCaptureProperty(self.left, hg.CV_CAP_PROP_POS_FRAMES )
#if tup[0] == None or tup[1] == None or frame_numb >= self.total_frames:
if tup[0] == None or tup[1] == None:
raise StopIteration()
return tup
def __iter__(self):
return self
###################################################################################################
# Geometric Cameras
###################################################################################################
# StereoCamera(ROSCameraCalibration('/wide_stereo/left/image_rect_color'), ROSCameraCalibration('/wide_stereo/right/image_rect_color'))
class ROSStereoCalibration:
def __init__(self, left_chan, right_chan):
self.left = ROSCameraCalibration(left_chan)
self.right = ROSCameraCalibration(right_chan)
while not self.right.has_msg:
time.sleep(.2)
self.R = np.matrix(np.eye(3)) #Using rectified images, no R needed.
self.T = self.right.P[:, 3].copy() #Copy so that we don't modify P by accident
self.T[0,0] = -self.T[0,0] / self.right.P[0,0] #Adjust for scaling term in projection matrix
##
# @param x
# @param xright 2x1 matrices
def triangulate_3d(self, xleft, xright):
#Klp = np.linalg.inv(self.left.K)
#Krp = np.linalg.inv(self.right.K)
# Use the K embedded in P instead K as
# rectified images are the result of P
Klp = np.linalg.inv(self.left.P[0:3, 0:3])
Krp = np.linalg.inv(self.right.P[0:3, 0:3])
wleft = Klp * point_to_homo(xleft)
wright = Krp * point_to_homo(xright)
print 'ROSStereoCalibration: xleft', wleft.T
print 'ROSStereoCalibration: xright', wright.T
A = np.concatenate((wleft, -self.R * wright), axis=1)
b = self.T
x_hat = np.linalg.inv(A.T * A) * A.T * b
left_estimate = x_hat[0,0] * wleft
right_estimate = x_hat[1,0] * self.R * wright + self.T
print 'ROSStereoCalibration: alpha, beta', x_hat
print 'ROSStereoCalibration: left est', left_estimate.T
print 'ROSStereoCalibration: right est', right_estimate.T
print 'A * x_hat', (A * x_hat).T
print 'T', b.T
print 'A*x-b', np.linalg.norm((A*x_hat) - b)
p = (left_estimate + right_estimate)/2.0
print 'ROSStereoCalibration: p', p.T
return {'point': p, 'error':np.linalg.norm(left_estimate- right_estimate)}
class ROSCameraCalibration:
def __init__(self, channel):
rospy.Subscriber(channel, CameraInfo, self.camera_info)
self.has_msg = False
def camera_info(self, msg):
self.distortion = np.matrix(msg.D)
self.K = np.reshape(np.matrix(msg.K), (3,3))
self.R = np.reshape(np.matrix(msg.R), (3,3))
self.P = np.reshape(np.matrix(msg.P), (3,4))
self.w = msg.width
self.h = msg.height
self.has_msg = True
def project(self, p):
return self.P * p
if __name__ == "__main__":
KNOWN_CAMERAS = {}
test = "test_gain"
if 'test_hdr' == test:
cv.NamedWindow("left_eye", 1)
cv.NamedWindow("right_eye", 1)
cv.NamedWindow("left_eye_low", 1)
cv.NamedWindow("right_eye_low", 1)
cam = VidereHDR(0)
base_exposure = 100
for ll, lr, l, r in cam:
cv.ShowImage("left_eye_low", ll)
cv.ShowImage("right_eye_low", lr)
cv.ShowImage("left_eye", l)
cv.ShowImage("right_eye", r)
key = cv.WaitKey(10)
if 'R' == key: #up
base_exposure = base_exposure + 1
vd.set_exposure(cam.camera.capture, base_exposure)
print base_exposure
elif 'T' == key:
base_exposure = base_exposure - 1
vd.set_exposure(cam.camera.capture, base_exposure)
print base_exposure
| ajibawa-2023/Python-Code-Large/train/row_99233 | 144 | 273 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ImportFrom_L32_C0", "label": "from pkg import *", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1172, 0.0037, 0, 0.66, 0.0, 489, 0, 1, 0, 0, 489, 0, 0], "semantic": {"name": "pkg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pkg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L34_C0", "label": "cv import cv", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1245, 0.0037, 0, 0.66, 0.04, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L35_C0", "label": "numpy import np", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1282, 0.0037, 0, 0.66, 0.08, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ImportFrom_L36_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1319, 0.0037, 0, 0.66, 0.12, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L38_C0", "label": "util import ut", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1392, 0.0037, 0, 0.66, 0.16, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L39_C0", "label": "math import m", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.0037, 0, 0.66, 0.2, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["m"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math as m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L40_C0", "label": "time import time", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1465, 0.0037, 0, 0.66, 0.24, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "label": "homo_transform3d", "type": "function", "loc": [62, 67], "level": 0, "parent": null, "vector": [2, 0, 0.2363, 0.022, 0, 0.66, 0.28, 56, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "homo_transform3d", "arg_names": ["R", "t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def homo_transform3d(R, t):\n T = np.matrix(np.zeros((4,4)))\n T[0:3, 0:3] = R\n T[0:3, 3] = t\n T[3,3] = 1.0\n return T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L63_C4", "label": "T = matrix()", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "vector": [14, 1, 0.2308, 0.0037, 1, 0.55, 0.0, 716, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "T", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " T = np.matrix(np.zeros((4,4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L64_C4", "label": "assign", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "vector": [14, 1, 0.2344, 0.0037, 1, 0.55, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " T[0:3, 0:3] = R"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L65_C4", "label": "assign", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "vector": [14, 1, 0.2381, 0.0037, 1, 0.55, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " T[0:3, 3] = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L66_C4", "label": "assign", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "vector": [14, 1, 0.2418, 0.0037, 1, 0.55, 0.75, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " T[3,3] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L67_C4", "label": "return", "type": "return", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "vector": [13, 1, 0.2454, 0.0037, 1, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L70_C0", "label": "Rx", "type": "function", "loc": [70, 73], "level": 0, "parent": null, "vector": [2, 0, 0.2619, 0.0147, 0, 0.66, 0.32, 820, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "Rx", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Rx(a):\n return np.matrix([[1, 0, 0,],\n [0, m.cos(a), m.sin(a)],\n [0, -m.sin(a), m.cos(a)]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L71_C4", "label": "return", "type": "return", "loc": [71, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L70_C0", "vector": [13, 1, 0.2637, 0.011, 1, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix([[1, 0, 0,],\n [0, m.cos(a), m.sin(a)],\n [0, -m.sin(a), m.cos(a)]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L76_C0", "label": "Ry", "type": "function", "loc": [76, 79], "level": 0, "parent": null, "vector": [2, 0, 0.2839, 0.0147, 0, 0.66, 0.36, 417, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "Ry", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Ry(a):\n return np.matrix([[m.cos(a), 0, -m.sin(a)],\n [0, 1, 0],\n [m.sin(a), 0, m.cos(a)]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L77_C4", "label": "return", "type": "return", "loc": [77, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L76_C0", "vector": [13, 1, 0.2857, 0.011, 1, 0.09, 0.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix([[m.cos(a), 0, -m.sin(a)],\n [0, 1, 0],\n [m.sin(a), 0, m.cos(a)]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L82_C0", "label": "Rz", "type": "function", "loc": [82, 85], "level": 0, "parent": null, "vector": [2, 0, 0.3059, 0.0147, 0, 0.66, 0.4, 936, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "Rz", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Rz(a):\n return np.matrix([[ m.cos(a), m.sin(a), 0],\n [-m.sin(a), m.cos(a), 0],\n [ 0, 0, 1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L82_C0", "vector": [13, 1, 0.3077, 0.011, 1, 0.76, 0.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix([[ m.cos(a), m.sin(a), 0],\n [-m.sin(a), m.cos(a), 0],\n [ 0, 0, 1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L87_C0", "label": "rotation", "type": "function", "loc": [87, 88], "level": 0, "parent": null, "vector": [2, 0, 0.3205, 0.0073, 0, 0.66, 0.44, 122, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "rotation", "arg_names": ["rx", "ry", "rz"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rotation(rx,ry,rz):\n return Rx(rx) * Ry(ry) * Rz(rz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L87_C0", "vector": [13, 1, 0.3223, 0.0037, 1, 0.25, 0.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Rx(rx) * Ry(ry) * Rz(rz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "label": "points_on_line", "type": "function", "loc": [90, 100], "level": 0, "parent": null, "vector": [2, 0, 0.348, 0.0403, 0, 0.66, 0.48, 151, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "points_on_line", "arg_names": ["homogeneous2d_line", "img_height"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def points_on_line(homogeneous2d_line, img_height):\n a = homogeneous2d_line[0,0]\n b = homogeneous2d_line[1,0]\n c = homogeneous2d_line[2,0]\n if b == 0:\n x = -c/a\n return [np.matrix([x, 0, 1]).T, \n np.matrix([x, img_height, 1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L91_C4", "label": "a =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "vector": [14, 1, 0.3333, 0.0037, 1, 0.05, 0.0, 475, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a = homogeneous2d_line[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L92_C4", "label": "b =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "vector": [14, 1, 0.337, 0.0037, 1, 0.05, 0.3333, 756, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b = homogeneous2d_line[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L93_C4", "label": "c =", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "vector": [14, 1, 0.3407, 0.0037, 1, 0.05, 0.6667, 411, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = homogeneous2d_line[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "label": "if", "type": "if", "loc": [94, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "vector": [4, 1, 0.3553, 0.0256, 1, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if b == 0:\n x = -c/a\n return [np.matrix([x, 0, 1]).T, \n np.matrix([x, img_height, 1])]\n else:\n return [np.matrix([-c/a, 0, 1]), \n np.matrix([(-b/a) * img_height - (c/a), img_height, 1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L95_C8", "label": "x =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "vector": [14, 2, 0.348, 0.0037, 2, 0.85, 0.0, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = -c/a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "vector": [13, 2, 0.3535, 0.0073, 2, 0.85, 0.5, 0, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [np.matrix([x, 0, 1]).T, \n np.matrix([x, img_height, 1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L99_C8", "label": "return", "type": "return", "loc": [99, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "vector": [13, 2, 0.3645, 0.0073, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [np.matrix([-c/a, 0, 1]), \n np.matrix([(-b/a) * img_height - (c/a), img_height, 1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L102_C0", "label": "tuple_to_homo", "type": "function", "loc": [102, 103], "level": 0, "parent": null, "vector": [2, 0, 0.3755, 0.0073, 0, 0.66, 0.52, 655, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "tuple_to_homo", "arg_names": ["p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def tuple_to_homo(p):\n return np.matrix([p[0], p[1], 1]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L103_C4", "label": "return", "type": "return", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L102_C0", "vector": [13, 1, 0.3773, 0.0037, 1, 0.78, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix([p[0], p[1], 1]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L105_C0", "label": "cvpoint_to_homo", "type": "function", "loc": [105, 106], "level": 0, "parent": null, "vector": [2, 0, 0.3864, 0.0073, 0, 0.66, 0.56, 68, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "cvpoint_to_homo", "arg_names": ["p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cvpoint_to_homo(p):\n return np.matrix([p.x, p.y, 1]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L105_C0", "vector": [13, 1, 0.3883, 0.0037, 1, 0.66, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix([p.x, p.y, 1]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L108_C0", "label": "homo_to_cvpoint", "type": "function", "loc": [108, 111], "level": 0, "parent": null, "vector": [2, 0, 0.4011, 0.0147, 0, 0.66, 0.6, 50, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "homo_to_cvpoint", "arg_names": ["p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def homo_to_cvpoint(p):\n p = p / p[-1,0]\n #return cv.Point(int(round(p[0,0])), int(round(p[1,0])))\n return (int(round(p[0,0])), int(round(p[1,0])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L109_C4", "label": "p =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L108_C0", "vector": [14, 1, 0.3993, 0.0037, 1, 0.64, 0.0, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = p / p[-1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L111_C4", "label": "return", "type": "return", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L108_C0", "vector": [13, 1, 0.4066, 0.0037, 1, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (int(round(p[0,0])), int(round(p[1,0])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "label": "rodrigues", "type": "function", "loc": [113, 117], "level": 0, "parent": null, "vector": [2, 0, 0.4212, 0.0183, 0, 0.66, 0.64, 58, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "rodrigues", "arg_names": ["vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rodrigues(vec):\n cvvec = ut.numpymat2cvmat(vec)\n dst = cv.CreateMat(3, 3, cv.CV_32FC1)\n cv.Rodrigues2(cvvec, dst)\n return ut.cvmat2numpymat(dst).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L114_C4", "label": "cvvec = numpymat2cvmat()", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "vector": [14, 1, 0.4176, 0.0037, 1, 0.47, 0.0, 593, 3, 1, 0, 0, 275, 10, 1], "semantic": {"name": "cvvec", "arg_names": [], "import_names": [], "rhs_call_name": "numpymat2cvmat", "annotation": ""}, "snippet": " cvvec = ut.numpymat2cvmat(vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L115_C4", "label": "dst = CreateMat()", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "vector": [14, 1, 0.4212, 0.0037, 1, 0.47, 0.3333, 856, 3, 3, 0, 0, 892, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMat", "annotation": ""}, "snippet": " dst = cv.CreateMat(3, 3, cv.CV_32FC1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L116_C4", "label": "Rodrigues2()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "vector": [8, 1, 0.4249, 0.0037, 1, 0.47, 0.6667, 528, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Rodrigues2", "arg_names": [], "import_names": [], "rhs_call_name": "Rodrigues2", "annotation": ""}, "snippet": " cv.Rodrigues2(cvvec, dst)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L117_C4", "label": "return", "type": "return", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "vector": [13, 1, 0.4286, 0.0037, 1, 0.47, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ut.cvmat2numpymat(dst).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L119_C0", "label": "normalize_homo_point", "type": "function", "loc": [119, 121], "level": 0, "parent": null, "vector": [2, 0, 0.4396, 0.011, 0, 0.66, 0.68, 149, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "normalize_homo_point", "arg_names": ["point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def normalize_homo_point(point):\n point = point / point[-1,0]\n return point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L120_C4", "label": "point =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L119_C0", "vector": [14, 1, 0.4396, 0.0037, 1, 0.7, 0.0, 16, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point = point / point[-1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L121_C4", "label": "return", "type": "return", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L119_C0", "vector": [13, 1, 0.4432, 0.0037, 1, 0.7, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L123_C0", "label": "homo_to_point", "type": "function", "loc": [123, 125], "level": 0, "parent": null, "vector": [2, 0, 0.4542, 0.011, 0, 0.66, 0.72, 897, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "homo_to_point", "arg_names": ["homo_point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def homo_to_point(homo_point):\n p = normalize_homo_point(homo_point)\n return p[0:-1,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L124_C4", "label": "p = normalize_homo_point()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L123_C0", "vector": [14, 1, 0.4542, 0.0037, 1, 0.99, 0.0, 491, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_homo_point", "annotation": ""}, "snippet": " p = normalize_homo_point(homo_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L125_C4", "label": "return", "type": "return", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L123_C0", "vector": [13, 1, 0.4579, 0.0037, 1, 0.99, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return p[0:-1,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L127_C0", "label": "point_to_homo", "type": "function", "loc": [127, 128], "level": 0, "parent": null, "vector": [2, 0, 0.467, 0.0073, 0, 0.66, 0.76, 116, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "point_to_homo", "arg_names": ["point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def point_to_homo(point):\n return np.concatenate((point, 1.0+np.zeros((1,point.shape[1]))), axis=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L128_C4", "label": "return", "type": "return", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L127_C0", "vector": [13, 1, 0.4689, 0.0037, 1, 0.07, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.concatenate((point, 1.0+np.zeros((1,point.shape[1]))), axis=0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "label": "general_projection_matrix", "type": "function", "loc": [130, 133], "level": 0, "parent": null, "vector": [2, 0, 0.4817, 0.0147, 0, 0.66, 0.8, 384, 0, 0, 1, 0, 0, 0, 3], "semantic": {"name": "general_projection_matrix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def general_projection_matrix():\n P = np.matrix(np.zeros((3,4)))\n P[0:3, 0:3] = np.eye(3)\n return P"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L131_C4", "label": "P = matrix()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "vector": [14, 1, 0.4799, 0.0037, 1, 0.69, 0.0, 707, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "P", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " P = np.matrix(np.zeros((3,4)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L132_C4", "label": " = eye()", "type": "assigned_variable", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "vector": [14, 1, 0.4835, 0.0037, 1, 0.69, 0.5, 0, 3, 1, 0, 0, 881, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "eye", "annotation": ""}, "snippet": " P[0:3, 0:3] = np.eye(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L133_C4", "label": "return", "type": "return", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "vector": [13, 1, 0.4872, 0.0037, 1, 0.69, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return P"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L138_C0", "label": "ROSStereoListener", "type": "class", "loc": [138, 152], "level": 0, "parent": null, "vector": [3, 0, 0.5311, 0.0549, 0, 0.66, 0.84, 383, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "ROSStereoListener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROSStereoListener:\n def __init__(self, topics, rate=30.0, name='stereo_listener'):\n from sensor_msgs.msg import Image\n from cv_bridge import CvBridge, CvBridgeError\n import hrl_lib.rutils as ru\n self.listener = ru.GenericListener(name, [Image, Image], topics, rate)\n self.lbridge = CvBridge()\n self.rbridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "label": "__init__", "type": "function", "loc": [139, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L138_C0", "vector": [2, 1, 0.5201, 0.0256, 1, 0.8, 0.0, 555, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "topics", "rate", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, topics, rate=30.0, name='stereo_listener'):\n from sensor_msgs.msg import Image\n from cv_bridge import CvBridge, CvBridgeError\n import hrl_lib.rutils as ru\n self.listener = ru.GenericListener(name, [Image, Image], topics, rate)\n self.lbridge = CvBridge()\n self.rbridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ImportFrom_L140_C8", "label": "from sensor_msgs.msg import Image", "type": "import", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "vector": [1, 2, 0.5128, 0.0037, 2, 0.47, 0.0, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["Image"], "rhs_call_name": "", "annotation": ""}, "snippet": " from sensor_msgs.msg import Image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ImportFrom_L141_C8", "label": "from cv_bridge import CvBridge, CvBridgeError", "type": "import", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "vector": [1, 2, 0.5165, 0.0037, 2, 0.47, 0.2, 851, 0, 2, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge", "CvBridgeError"], "rhs_call_name": "", "annotation": ""}, "snippet": " from cv_bridge import CvBridge, CvBridgeError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L142_C8", "label": "hrl_lib.rutils import ru", "type": "import", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "vector": [1, 2, 0.5201, 0.0037, 2, 0.47, 0.4, 847, 0, 1, 0, 0, 847, 0, 0], "semantic": {"name": "hrl_lib.rutils", "arg_names": [], "import_names": ["ru"], "rhs_call_name": "", "annotation": ""}, "snippet": " import hrl_lib.rutils as ru"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L143_C8", "label": "self.listener = GenericListener()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "vector": [14, 2, 0.5238, 0.0037, 2, 0.47, 0.6, 686, 3, 4, 0, 0, 36, 10, 1], "semantic": {"name": "self.listener", "arg_names": [], "import_names": [], "rhs_call_name": "GenericListener", "annotation": ""}, "snippet": " self.listener = ru.GenericListener(name, [Image, Image], topics, rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L144_C8", "label": "self.lbridge = CvBridge()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "vector": [14, 2, 0.5275, 0.0037, 2, 0.47, 0.8, 177, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "self.lbridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " self.lbridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L145_C8", "label": "self.rbridge = CvBridge()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "vector": [14, 2, 0.5311, 0.0037, 2, 0.47, 1.0, 786, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "self.rbridge", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " self.rbridge = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "label": "next", "type": "function", "loc": [147, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L138_C0", "vector": [2, 1, 0.5476, 0.022, 1, 0.8, 1.0, 11, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "next", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def next(self):\n #print 'ros_stereo_listener'\n lros, rros = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)\n lcv = self.lbridge.imgmsg_to_cv(lros, 'bgr8')\n rcv = self.rbridge.imgmsg_to_cv(rros, 'bgr8')\n return lcv, rcv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L149_C8", "label": "lros, rros = read()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "vector": [14, 2, 0.5458, 0.0037, 2, 0.78, 0.0, 118, 3, 4, 0, 0, 453, 10, 1], "semantic": {"name": "lros, rros", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " lros, rros = self.listener.read(allow_duplication=False, willing_to_wait=True, warn=False, quiet=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L150_C8", "label": "lcv = imgmsg_to_cv()", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "vector": [14, 2, 0.5495, 0.0037, 2, 0.78, 0.3333, 550, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "lcv", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " lcv = self.lbridge.imgmsg_to_cv(lros, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L151_C8", "label": "rcv = imgmsg_to_cv()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "vector": [14, 2, 0.5531, 0.0037, 2, 0.78, 0.6667, 748, 3, 2, 0, 0, 181, 10, 1], "semantic": {"name": "rcv", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " rcv = self.rbridge.imgmsg_to_cv(rros, 'bgr8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L152_C8", "label": "return", "type": "return", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "vector": [13, 2, 0.5568, 0.0037, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return lcv, rcv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "label": "StereoFile", "type": "class", "loc": [155, 171], "level": 0, "parent": null, "vector": [3, 0, 0.5971, 0.0623, 0, 0.66, 0.88, 956, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "StereoFile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StereoFile:\n def __init__(self, left_file, right_file):\n self.left = cv.CreateFileCapture(left_file);\n self.right = cv.CreateFileCapture(right_file);\n #self.total_frames = hg.cvGetCaptureProperty(self.left, hg.CV_CAP_PROP_FRAME_COUNT)\n\n def next(self):\n tup = (cv.QueryFrame(self.left), cv.QueryFrame(self.right))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L156_C4", "label": "__init__", "type": "function", "loc": [156, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "vector": [2, 1, 0.5751, 0.011, 1, 0.35, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "left_file", "right_file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, left_file, right_file):\n self.left = cv.CreateFileCapture(left_file);\n self.right = cv.CreateFileCapture(right_file);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L157_C8", "label": "self.left = CreateFileCapture()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L156_C4", "vector": [14, 2, 0.5751, 0.0037, 2, 0.63, 0.0, 643, 3, 1, 0, 0, 976, 10, 1], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "CreateFileCapture", "annotation": ""}, "snippet": " self.left = cv.CreateFileCapture(left_file);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L158_C8", "label": "self.right = CreateFileCapture()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L156_C4", "vector": [14, 2, 0.5788, 0.0037, 2, 0.63, 1.0, 683, 3, 1, 0, 0, 976, 10, 1], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "CreateFileCapture", "annotation": ""}, "snippet": " self.right = cv.CreateFileCapture(right_file);"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "label": "next", "type": "function", "loc": [161, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "vector": [2, 1, 0.6026, 0.0293, 1, 0.35, 0.5, 11, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "next", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def next(self):\n tup = (cv.QueryFrame(self.left), cv.QueryFrame(self.right))\n #frame_numb = hg.cvGetCaptureProperty(self.left, hg.CV_CAP_PROP_POS_FRAMES )\n\n #if tup[0] == None or tup[1] == None or frame_numb >= self.total_frames:\n if tup[0] == None or tup[1] == None:\n raise StopIteration()\n return tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L162_C8", "label": "tup =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "vector": [14, 2, 0.5934, 0.0037, 2, 0.7, 0.0, 218, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "tup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tup = (cv.QueryFrame(self.left), cv.QueryFrame(self.right))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L166_C8", "label": "if", "type": "if", "loc": [166, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "vector": [4, 2, 0.6099, 0.0073, 2, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tup[0] == None or tup[1] == None:\n raise StopIteration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "vector": [13, 2, 0.6154, 0.0037, 2, 0.7, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L170_C4", "label": "__iter__", "type": "function", "loc": [170, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "vector": [2, 1, 0.6245, 0.0073, 1, 0.35, 1.0, 891, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L171_C8", "label": "return", "type": "return", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L170_C4", "vector": [13, 2, 0.6264, 0.0037, 2, 0.66, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L177_C0", "label": "ROSStereoCalibration", "type": "class", "loc": [177, 220], "level": 0, "parent": null, "vector": [3, 0, 0.7271, 0.1612, 0, 0.66, 0.92, 61, 0, 2, 0, 0, 0, 0, 23], "semantic": {"name": "ROSStereoCalibration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROSStereoCalibration:\n def __init__(self, left_chan, right_chan):\n self.left = ROSCameraCalibration(left_chan)\n self.right = ROSCameraCalibration(right_chan)\n while not self.right.has_msg:\n time.sleep(.2)\n\n self.R = np.matrix(np.eye(3)) #Using rectified images, no R needed."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "label": "__init__", "type": "function", "loc": [178, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L177_C0", "vector": [2, 1, 0.6667, 0.033, 1, 0.29, 0.0, 555, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "left_chan", "right_chan"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, left_chan, right_chan):\n self.left = ROSCameraCalibration(left_chan)\n self.right = ROSCameraCalibration(right_chan)\n while not self.right.has_msg:\n time.sleep(.2)\n\n self.R = np.matrix(np.eye(3)) #Using rectified images, no R needed.\n self.T = self.right.P[:, 3].copy() #Copy so that we don't modify P by accident"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L179_C8", "label": "self.left = ROSCameraCalibration()", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "vector": [14, 2, 0.6557, 0.0037, 2, 0.92, 0.0, 643, 3, 1, 0, 0, 289, 10, 1], "semantic": {"name": "self.left", "arg_names": [], "import_names": [], "rhs_call_name": "ROSCameraCalibration", "annotation": ""}, "snippet": " self.left = ROSCameraCalibration(left_chan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L180_C8", "label": "self.right = ROSCameraCalibration()", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "vector": [14, 2, 0.6593, 0.0037, 2, 0.92, 0.2, 683, 3, 1, 0, 0, 289, 10, 1], "semantic": {"name": "self.right", "arg_names": [], "import_names": [], "rhs_call_name": "ROSCameraCalibration", "annotation": ""}, "snippet": " self.right = ROSCameraCalibration(right_chan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:While_L181_C8", "label": "while", "type": "while", "loc": [181, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "vector": [5, 2, 0.6648, 0.0073, 2, 0.92, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self.right.has_msg:\n time.sleep(.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L182_C12", "label": "sleep()", "type": "expression", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:While_L181_C8", "vector": [8, 3, 0.6667, 0.0037, 3, 0.93, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(.2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L184_C8", "label": "self.R = matrix()", "type": "assigned_variable", "loc": [184, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "vector": [14, 2, 0.674, 0.0037, 2, 0.92, 0.6, 333, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "self.R", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.R = np.matrix(np.eye(3)) #Using rectified images, no R needed."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L185_C8", "label": "self.T = copy()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "vector": [14, 2, 0.6777, 0.0037, 2, 0.92, 0.8, 88, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "self.T", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.T = self.right.P[:, 3].copy() #Copy so that we don't modify P by accident"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L186_C8", "label": "assign", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "vector": [14, 2, 0.6813, 0.0037, 2, 0.92, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.T[0,0] = -self.T[0,0] / self.right.P[0,0] #Adjust for scaling term in projection matrix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "label": "triangulate_3d", "type": "function", "loc": [191, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L177_C0", "vector": [2, 1, 0.7527, 0.1099, 1, 0.29, 1.0, 860, 0, 3, 1, 0, 0, 0, 17], "semantic": {"name": "triangulate_3d", "arg_names": ["self", "xleft", "xright"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def triangulate_3d(self, xleft, xright):\n #Klp = np.linalg.inv(self.left.K)\n #Krp = np.linalg.inv(self.right.K)\n # Use the K embedded in P instead K as \n # rectified images are the result of P\n Klp = np.linalg.inv(self.left.P[0:3, 0:3]) \n Krp = np.linalg.inv(self.right.P[0:3, 0:3])\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L196_C8", "label": "Klp = inv()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7179, 0.0037, 2, 0.44, 0.0, 239, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "Klp", "arg_names": [], "import_names": [], "rhs_call_name": "inv", "annotation": ""}, "snippet": " Klp = np.linalg.inv(self.left.P[0:3, 0:3]) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L197_C8", "label": "Krp = inv()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7216, 0.0037, 2, 0.44, 0.0526, 951, 3, 1, 0, 0, 761, 10, 1], "semantic": {"name": "Krp", "arg_names": [], "import_names": [], "rhs_call_name": "inv", "annotation": ""}, "snippet": " Krp = np.linalg.inv(self.right.P[0:3, 0:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L199_C8", "label": "wleft =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7289, 0.0037, 2, 0.44, 0.1053, 195, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wleft", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wleft = Klp * point_to_homo(xleft)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L200_C8", "label": "wright =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7326, 0.0037, 2, 0.44, 0.1579, 254, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wright", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wright = Krp * point_to_homo(xright)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L202_C8", "label": "print()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7399, 0.0037, 2, 0.44, 0.2105, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROSStereoCalibration: xleft', wleft.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L203_C8", "label": "print()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7436, 0.0037, 2, 0.44, 0.2632, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROSStereoCalibration: xright', wright.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L205_C8", "label": "A = concatenate()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7509, 0.0037, 2, 0.44, 0.3158, 429, 3, 2, 0, 0, 63, 10, 1], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " A = np.concatenate((wleft, -self.R * wright), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L206_C8", "label": "b =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7546, 0.0037, 2, 0.44, 0.3684, 756, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b = self.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L208_C8", "label": "x_hat =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7619, 0.0037, 2, 0.44, 0.4211, 840, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "x_hat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_hat = np.linalg.inv(A.T * A) * A.T * b"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L209_C8", "label": "left_estimate =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7656, 0.0037, 2, 0.44, 0.4737, 236, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "left_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left_estimate = x_hat[0,0] * wleft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L210_C8", "label": "right_estimate =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7692, 0.0037, 2, 0.44, 0.5263, 156, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right_estimate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right_estimate = x_hat[1,0] * self.R * wright + self.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L211_C8", "label": "print()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7729, 0.0037, 2, 0.44, 0.5789, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROSStereoCalibration: alpha, beta', x_hat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L212_C8", "label": "print()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7766, 0.0037, 2, 0.44, 0.6316, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROSStereoCalibration: left est', left_estimate.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L213_C8", "label": "print()", "type": "expression", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7802, 0.0037, 2, 0.44, 0.6842, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROSStereoCalibration: right est', right_estimate.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L214_C8", "label": "print()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7839, 0.0037, 2, 0.44, 0.7368, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('A * x_hat', (A * x_hat).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L215_C8", "label": "print()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7875, 0.0037, 2, 0.44, 0.7895, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('T', b.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L216_C8", "label": "print()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.7912, 0.0037, 2, 0.44, 0.8421, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('A*x-b', np.linalg.norm((A*x_hat) - b))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L218_C8", "label": "p =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [14, 2, 0.7985, 0.0037, 2, 0.44, 0.8947, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = (left_estimate + right_estimate)/2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L219_C8", "label": "print()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [8, 2, 0.8022, 0.0037, 2, 0.44, 0.9474, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('ROSStereoCalibration: p', p.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L220_C8", "label": "return", "type": "return", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "vector": [13, 2, 0.8059, 0.0037, 2, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'point': p, 'error':np.linalg.norm(left_estimate- right_estimate)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "label": "ROSCameraCalibration", "type": "class", "loc": [223, 238], "level": 0, "parent": null, "vector": [3, 0, 0.8443, 0.0586, 0, 0.66, 0.96, 289, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "ROSCameraCalibration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ROSCameraCalibration:\n def __init__(self, channel):\n rospy.Subscriber(channel, CameraInfo, self.camera_info)\n self.has_msg = False\n\n def camera_info(self, msg):\n self.distortion = np.matrix(msg.D)\n self.K = np.reshape(np.matrix(msg.K), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L224_C4", "label": "__init__", "type": "function", "loc": [224, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "vector": [2, 1, 0.8242, 0.011, 1, 0.17, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "channel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, channel):\n rospy.Subscriber(channel, CameraInfo, self.camera_info)\n self.has_msg = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L225_C8", "label": "Subscriber()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L224_C4", "vector": [8, 2, 0.8242, 0.0037, 2, 0.44, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(channel, CameraInfo, self.camera_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L226_C8", "label": "self.has_msg =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L224_C4", "vector": [14, 2, 0.8278, 0.0037, 2, 0.44, 1.0, 477, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_msg = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "label": "camera_info", "type": "function", "loc": [228, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "vector": [2, 1, 0.848, 0.0293, 1, 0.17, 0.5, 652, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "camera_info", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def camera_info(self, msg):\n self.distortion = np.matrix(msg.D)\n self.K = np.reshape(np.matrix(msg.K), (3,3))\n self.R = np.reshape(np.matrix(msg.R), (3,3))\n self.P = np.reshape(np.matrix(msg.P), (3,4))\n self.w = msg.width\n self.h = msg.height\n self.has_msg = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L229_C8", "label": "self.distortion = matrix()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8388, 0.0037, 2, 0.53, 0.0, 647, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "self.distortion", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " self.distortion = np.matrix(msg.D)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L230_C8", "label": "self.K = reshape()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8425, 0.0037, 2, 0.53, 0.1667, 210, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.K", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.K = np.reshape(np.matrix(msg.K), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L231_C8", "label": "self.R = reshape()", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8462, 0.0037, 2, 0.53, 0.3333, 333, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.R", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.R = np.reshape(np.matrix(msg.R), (3,3))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L232_C8", "label": "self.P = reshape()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8498, 0.0037, 2, 0.53, 0.5, 612, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "self.P", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " self.P = np.reshape(np.matrix(msg.P), (3,4))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L233_C8", "label": "self.w =", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8535, 0.0037, 2, 0.53, 0.6667, 642, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.w = msg.width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L234_C8", "label": "self.h =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8571, 0.0037, 2, 0.53, 0.8333, 164, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.h", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.h = msg.height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L235_C8", "label": "self.has_msg =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "vector": [14, 2, 0.8608, 0.0037, 2, 0.53, 1.0, 477, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_msg = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L237_C4", "label": "project", "type": "function", "loc": [237, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "vector": [2, 1, 0.87, 0.0073, 1, 0.17, 1.0, 841, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "project", "arg_names": ["self", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def project(self, p):\n return self.P * p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L238_C8", "label": "return", "type": "return", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L237_C4", "vector": [13, 2, 0.8718, 0.0037, 2, 0.86, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.P * p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "label": "if", "type": "if", "loc": [242, 270], "level": 0, "parent": null, "vector": [4, 0, 0.9377, 0.1062, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n KNOWN_CAMERAS = {}\n test = \"test_gain\"\n\n if 'test_hdr' == test:\n cv.NamedWindow(\"left_eye\", 1)\n cv.NamedWindow(\"right_eye\", 1)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L243_C4", "label": "KNOWN_CAMERAS =", "type": "assigned_variable", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "vector": [14, 1, 0.8901, 0.0037, 1, 0.05, 0.0, 85, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "KNOWN_CAMERAS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " KNOWN_CAMERAS = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L244_C4", "label": "test =", "type": "assigned_variable", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "vector": [14, 1, 0.8938, 0.0037, 1, 0.05, 0.5, 224, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test = \"test_gain\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "label": "if", "type": "if", "loc": [246, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "vector": [4, 1, 0.9451, 0.0916, 1, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'test_hdr' == test:\n cv.NamedWindow(\"left_eye\", 1)\n cv.NamedWindow(\"right_eye\", 1)\n\n cv.NamedWindow(\"left_eye_low\", 1)\n cv.NamedWindow(\"right_eye_low\", 1)\n\n cam = VidereHDR(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L247_C8", "label": "NamedWindow()", "type": "expression", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [8, 2, 0.9048, 0.0037, 2, 0.97, 0.0, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"left_eye\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L248_C8", "label": "NamedWindow()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [8, 2, 0.9084, 0.0037, 2, 0.97, 0.1667, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"right_eye\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L250_C8", "label": "NamedWindow()", "type": "expression", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [8, 2, 0.9158, 0.0037, 2, 0.97, 0.3333, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"left_eye_low\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L251_C8", "label": "NamedWindow()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [8, 2, 0.9194, 0.0037, 2, 0.97, 0.5, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(\"right_eye_low\", 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L253_C8", "label": "cam = VidereHDR()", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [14, 2, 0.9267, 0.0037, 2, 0.97, 0.6667, 155, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "cam", "arg_names": [], "import_names": [], "rhs_call_name": "VidereHDR", "annotation": ""}, "snippet": " cam = VidereHDR(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L254_C8", "label": "base_exposure =", "type": "assigned_variable", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [14, 2, 0.9304, 0.0037, 2, 0.97, 0.8333, 770, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "base_exposure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_exposure = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "label": "for ll, lr, l, r", "type": "for", "loc": [256, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "vector": [6, 2, 0.9634, 0.0549, 2, 0.97, 1.0, 902, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "ll, lr, l, r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for ll, lr, l, r in cam:\n cv.ShowImage(\"left_eye_low\", ll)\n cv.ShowImage(\"right_eye_low\", lr)\n cv.ShowImage(\"left_eye\", l)\n cv.ShowImage(\"right_eye\", r)\n key = cv.WaitKey(10)\n\n if 'R' == key: #up"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L257_C12", "label": "ShowImage()", "type": "expression", "loc": [257, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "vector": [8, 3, 0.9414, 0.0037, 3, 0.85, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"left_eye_low\", ll)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L258_C12", "label": "ShowImage()", "type": "expression", "loc": [258, 258], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "vector": [8, 3, 0.9451, 0.0037, 3, 0.85, 0.2, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"right_eye_low\", lr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L259_C12", "label": "ShowImage()", "type": "expression", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "vector": [8, 3, 0.9487, 0.0037, 3, 0.85, 0.4, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"left_eye\", l)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L260_C12", "label": "ShowImage()", "type": "expression", "loc": [260, 260], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "vector": [8, 3, 0.9524, 0.0037, 3, 0.85, 0.6, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(\"right_eye\", r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L261_C12", "label": "key = WaitKey()", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "vector": [14, 3, 0.956, 0.0037, 3, 0.85, 0.8, 230, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " key = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "label": "if", "type": "if", "loc": [263, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "vector": [4, 3, 0.9762, 0.0293, 3, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'R' == key: #up\n base_exposure = base_exposure + 1\n vd.set_exposure(cam.camera.capture, base_exposure)\n print(base_exposure)\n elif 'T' == key:\n base_exposure = base_exposure - 1\n vd.set_exposure(cam.camera.capture, base_exposure)\n print(base_exposure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L264_C16", "label": "base_exposure =", "type": "assigned_variable", "loc": [264, 264], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "vector": [14, 4, 0.967, 0.0037, 4, 0.79, 0.0, 770, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_exposure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_exposure = base_exposure + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L265_C16", "label": "set_exposure()", "type": "expression", "loc": [265, 265], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "vector": [8, 4, 0.9707, 0.0037, 4, 0.79, 0.3333, 611, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_exposure", "arg_names": [], "import_names": [], "rhs_call_name": "set_exposure", "annotation": ""}, "snippet": " vd.set_exposure(cam.camera.capture, base_exposure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L266_C16", "label": "print()", "type": "expression", "loc": [266, 266], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "vector": [8, 4, 0.9744, 0.0037, 4, 0.79, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(base_exposure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "label": "if", "type": "if", "loc": [267, 270], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "vector": [4, 4, 0.9835, 0.0147, 4, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif 'T' == key:\n base_exposure = base_exposure - 1\n vd.set_exposure(cam.camera.capture, base_exposure)\n print(base_exposure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L268_C16", "label": "base_exposure =", "type": "assigned_variable", "loc": [268, 268], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "vector": [14, 5, 0.9817, 0.0037, 5, 0.0, 0.0, 770, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_exposure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_exposure = base_exposure - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L269_C16", "label": "set_exposure()", "type": "expression", "loc": [269, 269], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "vector": [8, 5, 0.9853, 0.0037, 5, 0.0, 0.5, 611, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_exposure", "arg_names": [], "import_names": [], "rhs_call_name": "set_exposure", "annotation": ""}, "snippet": " vd.set_exposure(cam.camera.capture, base_exposure)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L270_C16", "label": "print()", "type": "expression", "loc": [270, 270], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "vector": [8, 5, 0.989, 0.0037, 5, 0.0, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(base_exposure)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L87_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L113_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:ImportFrom_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:ImportFrom_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Import_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L138_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L155_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:While_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:While_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:ClassDef_L223_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Return_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L242_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L258_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L260_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:For_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L264_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L265_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L266_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L263_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Assign_L268_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L269_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99233:If_L267_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99233:Expr_L270_C16"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
from pkg import *
from std_msgs.msg import Position
from std_msgs.msg import BaseVel
from std_msgs.msg import RobotBase2DOdom
import sys
import numpy as np
import nodes as n
import camera as cam
import math
from pyrob.voice import say
from StringIO import StringIO
class FollowBehavior:
def __init__(self, velocity_topic):
self.not_inited = True
self.velocity_topic = velocity_topic
self.last_said = ''
def init_pose(self, robot_pose):
R = cam.Rx(math.radians(90)) * cam.Ry(math.radians(-90))
T = np.matrix([-.095, 0,.162]).T
self.base_T_camera = cam.homo_transform3d(R, T)
self.robot_pose = n.ConstNode(robot_pose)
self.local_pos = n.nav.V_KeepLocal_P2d_V(self.robot_pose, n.ConstNode(np.matrix([0.0, 0.0]).T))
self.attr = n.nav.V_LinearAttract_V(self.local_pos, dead_zone = 0.20, far_dist = 1.0)
self.cmd = n.nav.R_Conv_V(self.attr, allow_backwards_driving = False)
self.should_stop = self.attr.is_done()
self.cmd.max_vel = .5
self.has_stopped = False
self.count = 0
self.attr.verbosity = -1
print 'FollowBehavior: ready!'
def cursor_moved(self, point):
#Transform into base's coordinate frame
point3d = np.matrix([point.x, point.y, point.z, 1.0]).T
print 'FollowBehavior.cursor_moved: got point', point3d.T
new_point = self.base_T_camera * point3d
sio = StringIO()
print >>sio, int(round(np.linalg.norm(point3d[0:3]) * 100.0))
new_saying = sio.getvalue()
if new_saying != self.last_said:
say(new_saying)
self.last_said = new_saying
#Drop the z, store as homogeneous coordinates
goal2d = new_point[0:2, 0]
print 'FollowBehavior.cursor_moved: 2d goal', goal2d.T
self.local_pos.remember(n.ConstNode(goal2d))
self.has_stopped = False
def robot_moved(self, update):
if self.not_inited:
self.init_pose(n.Pose2D(update.pos.x, update.pos.y, update.pos.th))
self.not_inited = False
else:
self.robot_pose.const = n.Pose2D(update.pos.x, update.pos.y, update.pos.th)
def run(self):
if self.not_inited:
return
#base_command = self.cmd.val(self.count)
#print 'publishing', base_command.forward_vel, base_command.rot_vel
if self.should_stop.val(self.count) and not self.has_stopped:
self.velocity_topic.publish(BaseVel(0,0))
#print 'stoppping'
self.has_stopped = True
say('done')
elif not self.has_stopped:
#print 'HAS STOPPED'
base_command = self.cmd.val(self.count)
msg = BaseVel(base_command.forward_vel, base_command.rot_vel)
#print 'publishing', base_command.forward_vel, base_command.rot_vel
self.velocity_topic.publish(msg)
self.count = self.count + 1
class FakeTopic:
def publish(self, something):
pass
class FakePoint:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
if __name__ == '__main__':
import time
pub = rospy.TopicPub('cmd_vel', BaseVel)
follow_behavior = FollowBehavior(pub)
rospy.TopicSub('odom', RobotBase2DOdom, follow_behavior.robot_moved)
rospy.TopicSub(CURSOR_TOPIC, Position, follow_behavior.cursor_moved)
rospy.ready(sys.argv[0])
#follow_behavior.cursor_moved(FakePoint(0.0,0.0,1.0))
while not rospy.isShutdown():
follow_behavior.run()
time.sleep(0.016)
#follow_behavior = FollowBehavior(FakeTopic())
#def transform2D(o_p, o_angle):
# """
# Takes as input o_P_* and angle, both descriptions of the new coordinate
# frame in the original frame (frame o). Returns a transfrom *_T_o that
# describes points in the new coordinate frame (frame *).
# The transformation applies a translation then a rotation.
# """
# t = numpy.matrix(numpy.eye(3))
# t[0:2][:,2] = -1 * o_p
# return rot_mat(o_angle) * t
#
#def rot_mat(a):
# """
# Makes a homogeneous rotation matrix that rotates the coordinate system
# counter cw
# i.e. rotates points clockwise
# """
# return numpy.matrix([[math.cos(a), math.sin(a), 0],
# [-1*math.sin(a), math.cos(a), 0],
# [0, 0, 1]])
#
#class FollowLight:
# def __init__(self, velocity_topic):
# self.base_T_camera = np.matrix(np.zeros((3,4)))
# self.dead_zone = 0.02
# self.far_dist = 1.0 #Distance beyond which we don't care
# self.min_attr = 0.3 #Set min attraction to be 30% of maximum speed
#
# self.velocity_topic = velocity_topic
# self.goal_b = [0.0, 0.0]
# self.A_T_O = transform2d(np.matrix([0.0, 0.0]).T, 0.0)
#
# def cursor_moved(self, point):
# #Transform into base's coordinate frame
# point3d = np.matrix([point.x, point.y, point.z, 1.0]).T
# new_point = self.base_T_camera * point3d
#
# #Drop the z, store as homogeneous coordinates
# self.goal_b = new_point[0:2, 0]
#
# def robot_moved(self, update):
# #Frames
# # A previous position of robot in global frame
# # B current position of robot in global frame
# # O global frame
# B_T_O = transform2d(np.matrix([update.pos.x, update.pos.y]).T,
# update.pos.th)
#
# #transform goal with this update
# goal_a = self.goal_b
# B_T_A = B_T_O * np.linalg.inv(self.A_T_O)
# self.goal_b = B_T_A * goal_a
# self.A_T_O = B_T_O
#
# def run(self):
# #given goal position, calculate velocity vector
# distance = np.linalg.norm(goal)
# if distance > self.dead_zone:
# mag = ((1 - self.min_attr) / (self.far_dist - self.dead_zone)) * norm_dist + self.min_attr
# mag = min(max(mag, self.min_attr), 1.0)
# out = mag * (goal / dist)
# vx =
# else:
# vw =
#
# #send to robot
# self.velocity_topic.publish(BaseVel(vx,vw))
| ajibawa-2023/Python-Code-Large/train/row_99234 | 77 | 269 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ImportFrom_L29_C0", "label": "from pkg import *", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.1078, 0.0037, 0, 0.66, 0.0, 489, 0, 1, 0, 0, 489, 0, 0], "semantic": {"name": "pkg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pkg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ImportFrom_L30_C0", "label": "from std_msgs.msg import Position", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1115, 0.0037, 0, 0.66, 0.0714, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Position"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ImportFrom_L31_C0", "label": "from std_msgs.msg import BaseVel", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1152, 0.0037, 0, 0.66, 0.1429, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["BaseVel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import BaseVel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ImportFrom_L32_C0", "label": "from std_msgs.msg import RobotBase2DOdom", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.119, 0.0037, 0, 0.66, 0.2143, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["RobotBase2DOdom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import RobotBase2DOdom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L33_C0", "label": "sys import sys", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1227, 0.0037, 0, 0.66, 0.2857, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L34_C0", "label": "numpy import np", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.1264, 0.0037, 0, 0.66, 0.3571, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L35_C0", "label": "nodes import n", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.1301, 0.0037, 0, 0.66, 0.4286, 696, 0, 1, 0, 0, 696, 0, 0], "semantic": {"name": "nodes", "arg_names": [], "import_names": ["n"], "rhs_call_name": "", "annotation": ""}, "snippet": "import nodes as n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L36_C0", "label": "camera import cam", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.1338, 0.0037, 0, 0.66, 0.5, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L37_C0", "label": "math import math", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1375, 0.0037, 0, 0.66, 0.5714, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ImportFrom_L38_C0", "label": "from pyrob.voice import say", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1413, 0.0037, 0, 0.66, 0.6429, 597, 0, 1, 0, 0, 597, 0, 0], "semantic": {"name": "pyrob.voice", "arg_names": [], "import_names": ["say"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pyrob.voice import say"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ImportFrom_L39_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.145, 0.0037, 0, 0.66, 0.7143, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "StringIO", "arg_names": [], "import_names": ["StringIO"], "rhs_call_name": "", "annotation": ""}, "snippet": "from StringIO import StringIO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "label": "FollowBehavior", "type": "class", "loc": [41, 103], "level": 0, "parent": null, "vector": [3, 0, 0.2677, 0.2342, 0, 0.66, 0.7857, 405, 0, 5, 0, 0, 0, 0, 32], "semantic": {"name": "FollowBehavior", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FollowBehavior:\n def __init__(self, velocity_topic):\n self.not_inited = True\n self.velocity_topic = velocity_topic\n self.last_said = ''\n\n def init_pose(self, robot_pose):\n R = cam.Rx(math.radians(90)) * cam.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "label": "__init__", "type": "function", "loc": [42, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "vector": [2, 1, 0.1617, 0.0149, 1, 0.37, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "velocity_topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, velocity_topic):\n self.not_inited = True\n self.velocity_topic = velocity_topic\n self.last_said = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L43_C8", "label": "self.not_inited =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "vector": [14, 2, 0.1599, 0.0037, 2, 0.64, 0.0, 542, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.not_inited", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.not_inited = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L44_C8", "label": "self.velocity_topic =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "vector": [14, 2, 0.1636, 0.0037, 2, 0.64, 0.5, 314, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.velocity_topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.velocity_topic = velocity_topic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L45_C8", "label": "self.last_said =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "vector": [14, 2, 0.1673, 0.0037, 2, 0.64, 1.0, 359, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.last_said", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_said = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "label": "init_pose", "type": "function", "loc": [47, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "vector": [2, 1, 0.2007, 0.0558, 1, 0.37, 0.25, 87, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "init_pose", "arg_names": ["self", "robot_pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_pose(self, robot_pose):\n R = cam.Rx(math.radians(90)) * cam.Ry(math.radians(-90))\n T = np.matrix([-.095, 0,.162]).T\n self.base_T_camera = cam.homo_transform3d(R, T)\n self.robot_pose = n.ConstNode(robot_pose)\n self.local_pos = n.nav.V_KeepLocal_P2d_V(self.robot_pose, n.ConstNode(np.matrix([0.0, 0.0]).T))\n self.attr\t = n.nav.V_LinearAttract_V(self.local_pos, dead_zone = 0.20, far_dist = 1.0)\n self.cmd = n.nav.R_Conv_V(self.attr, allow_backwards_driving = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L48_C8", "label": "R =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.1784, 0.0037, 2, 0.44, 0.0, 467, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " R = cam.Rx(math.radians(90)) * cam.Ry(math.radians(-90))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L49_C8", "label": "T =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.1822, 0.0037, 2, 0.44, 0.0833, 716, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "T", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " T = np.matrix([-.095, 0,.162]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L50_C8", "label": "self.base_T_camera = homo_transform3d()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.1859, 0.0037, 2, 0.44, 0.1667, 605, 3, 2, 0, 0, 56, 10, 1], "semantic": {"name": "self.base_T_camera", "arg_names": [], "import_names": [], "rhs_call_name": "homo_transform3d", "annotation": ""}, "snippet": " self.base_T_camera = cam.homo_transform3d(R, T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L51_C8", "label": "self.robot_pose = ConstNode()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.1896, 0.0037, 2, 0.44, 0.25, 747, 3, 1, 0, 0, 85, 10, 1], "semantic": {"name": "self.robot_pose", "arg_names": [], "import_names": [], "rhs_call_name": "ConstNode", "annotation": ""}, "snippet": " self.robot_pose = n.ConstNode(robot_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L52_C8", "label": "self.local_pos = V_KeepLocal_P2d_V()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.1933, 0.0037, 2, 0.44, 0.3333, 778, 3, 2, 0, 0, 708, 10, 3], "semantic": {"name": "self.local_pos", "arg_names": [], "import_names": [], "rhs_call_name": "V_KeepLocal_P2d_V", "annotation": ""}, "snippet": " self.local_pos = n.nav.V_KeepLocal_P2d_V(self.robot_pose, n.ConstNode(np.matrix([0.0, 0.0]).T))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L53_C8", "label": "self.attr = V_LinearAttract_V()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.197, 0.0037, 2, 0.44, 0.4167, 351, 3, 3, 0, 0, 689, 10, 1], "semantic": {"name": "self.attr", "arg_names": [], "import_names": [], "rhs_call_name": "V_LinearAttract_V", "annotation": ""}, "snippet": " self.attr\t = n.nav.V_LinearAttract_V(self.local_pos, dead_zone = 0.20, far_dist = 1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L54_C8", "label": "self.cmd = R_Conv_V()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.2007, 0.0037, 2, 0.44, 0.5, 985, 3, 2, 0, 0, 745, 10, 1], "semantic": {"name": "self.cmd", "arg_names": [], "import_names": [], "rhs_call_name": "R_Conv_V", "annotation": ""}, "snippet": " self.cmd = n.nav.R_Conv_V(self.attr, allow_backwards_driving = False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L55_C8", "label": "self.should_stop = is_done()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.2045, 0.0037, 2, 0.44, 0.5833, 958, 3, 0, 0, 0, 883, 10, 1], "semantic": {"name": "self.should_stop", "arg_names": [], "import_names": [], "rhs_call_name": "is_done", "annotation": ""}, "snippet": " self.should_stop = self.attr.is_done()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L57_C8", "label": "self.cmd.max_vel =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.2119, 0.0037, 2, 0.44, 0.6667, 118, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.cmd.max_vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cmd.max_vel = .5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L58_C8", "label": "self.has_stopped =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.2156, 0.0037, 2, 0.44, 0.75, 685, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_stopped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L59_C8", "label": "self.count =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.2193, 0.0037, 2, 0.44, 0.8333, 340, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.count = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L60_C8", "label": "self.attr.verbosity =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [14, 2, 0.223, 0.0037, 2, 0.44, 0.9167, 136, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.attr.verbosity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.attr.verbosity = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L61_C8", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "vector": [8, 2, 0.2268, 0.0037, 2, 0.44, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('FollowBehavior: ready!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "label": "cursor_moved", "type": "function", "loc": [63, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "vector": [2, 1, 0.2621, 0.0595, 1, 0.37, 0.5, 276, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "cursor_moved", "arg_names": ["self", "point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cursor_moved(self, point):\n #Transform into base's coordinate frame\n point3d = np.matrix([point.x, point.y, point.z, 1.0]).T\n print('FollowBehavior.cursor_moved: got point', point3d.T)\n new_point = self.base_T_camera * point3d\n sio = StringIO()\n new_saying = sio.getvalue()\n if new_saying != self.last_said:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L65_C8", "label": "point3d =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [14, 2, 0.2416, 0.0037, 2, 0.57, 0.0, 846, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "point3d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " point3d = np.matrix([point.x, point.y, point.z, 1.0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L66_C8", "label": "print()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [8, 2, 0.2454, 0.0037, 2, 0.57, 0.1111, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('FollowBehavior.cursor_moved: got point', point3d.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L67_C8", "label": "new_point =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [14, 2, 0.2491, 0.0037, 2, 0.57, 0.2222, 879, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_point = self.base_T_camera * point3d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L68_C8", "label": "sio = StringIO()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [14, 2, 0.2528, 0.0037, 2, 0.57, 0.3333, 828, 3, 0, 0, 0, 609, 10, 1], "semantic": {"name": "sio", "arg_names": [], "import_names": [], "rhs_call_name": "StringIO", "annotation": ""}, "snippet": " sio = StringIO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L69_C8", "label": "new_saying = getvalue()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [14, 2, 0.2565, 0.0037, 2, 0.57, 0.4444, 845, 3, 0, 0, 0, 626, 10, 1], "semantic": {"name": "new_saying", "arg_names": [], "import_names": [], "rhs_call_name": "getvalue", "annotation": ""}, "snippet": " new_saying = sio.getvalue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L70_C8", "label": "if", "type": "if", "loc": [70, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [4, 2, 0.2639, 0.0112, 2, 0.57, 0.5556, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_saying != self.last_said:\n say(new_saying)\n self.last_said = new_saying"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L71_C12", "label": "say()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L70_C8", "vector": [8, 3, 0.2639, 0.0037, 3, 0.77, 0.0, 890, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "say", "arg_names": [], "import_names": [], "rhs_call_name": "say", "annotation": ""}, "snippet": " say(new_saying)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L72_C12", "label": "self.last_said =", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L70_C8", "vector": [14, 3, 0.2677, 0.0037, 3, 0.77, 1.0, 359, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.last_said", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.last_said = new_saying"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L75_C8", "label": "goal2d =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [14, 2, 0.2788, 0.0037, 2, 0.57, 0.6667, 650, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal2d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal2d = new_point[0:2, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L76_C8", "label": "print()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [8, 2, 0.2825, 0.0037, 2, 0.57, 0.7778, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('FollowBehavior.cursor_moved: 2d goal', goal2d.T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L77_C8", "label": "remember()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [8, 2, 0.2862, 0.0037, 2, 0.57, 0.8889, 160, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "remember", "arg_names": [], "import_names": [], "rhs_call_name": "remember", "annotation": ""}, "snippet": " self.local_pos.remember(n.ConstNode(goal2d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L78_C8", "label": "self.has_stopped =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "vector": [14, 2, 0.29, 0.0037, 2, 0.57, 1.0, 685, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_stopped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L80_C4", "label": "robot_moved", "type": "function", "loc": [80, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "vector": [2, 1, 0.3067, 0.0223, 1, 0.37, 0.75, 942, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "robot_moved", "arg_names": ["self", "update"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def robot_moved(self, update):\n if self.not_inited:\n self.init_pose(n.Pose2D(update.pos.x, update.pos.y, update.pos.th))\n self.not_inited = False\n else:\n self.robot_pose.const = n.Pose2D(update.pos.x, update.pos.y, update.pos.th)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "label": "if", "type": "if", "loc": [81, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L80_C4", "vector": [4, 2, 0.3086, 0.0186, 2, 0.57, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.not_inited:\n self.init_pose(n.Pose2D(update.pos.x, update.pos.y, update.pos.th))\n self.not_inited = False\n else:\n self.robot_pose.const = n.Pose2D(update.pos.x, update.pos.y, update.pos.th)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L82_C12", "label": "init_pose()", "type": "expression", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "vector": [8, 3, 0.3048, 0.0037, 3, 0.71, 0.0, 87, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "init_pose", "arg_names": [], "import_names": [], "rhs_call_name": "init_pose", "annotation": ""}, "snippet": " self.init_pose(n.Pose2D(update.pos.x, update.pos.y, update.pos.th))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L83_C12", "label": "self.not_inited =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "vector": [14, 3, 0.3086, 0.0037, 3, 0.71, 0.5, 542, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.not_inited", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.not_inited = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L85_C12", "label": "self.robot_pose.const = Pose2D()", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "vector": [14, 3, 0.316, 0.0037, 3, 0.71, 1.0, 249, 3, 3, 0, 0, 810, 10, 1], "semantic": {"name": "self.robot_pose.const", "arg_names": [], "import_names": [], "rhs_call_name": "Pose2D", "annotation": ""}, "snippet": " self.robot_pose.const = n.Pose2D(update.pos.x, update.pos.y, update.pos.th)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "label": "run", "type": "function", "loc": [87, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "vector": [2, 1, 0.3532, 0.0632, 1, 0.37, 1.0, 679, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self):\n if self.not_inited:\n return\n #base_command = self.cmd.val(self.count)\n #print 'publishing', base_command.forward_vel, base_command.rot_vel\n if self.should_stop.val(self.count) and not self.has_stopped:\n self.velocity_topic.publish(BaseVel(0,0))\n #print 'stoppping'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L88_C8", "label": "if", "type": "if", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "vector": [4, 2, 0.329, 0.0074, 2, 0.08, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.not_inited:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Return_L89_C12", "label": "return", "type": "return", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L88_C8", "vector": [13, 3, 0.3309, 0.0037, 3, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "label": "if", "type": "if", "loc": [92, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "vector": [4, 2, 0.3606, 0.0409, 2, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.should_stop.val(self.count) and not self.has_stopped:\n self.velocity_topic.publish(BaseVel(0,0))\n #print 'stoppping'\n self.has_stopped = True \n say('done')\n elif not self.has_stopped:\n #print 'HAS STOPPED'\n base_command = self.cmd.val(self.count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L93_C12", "label": "publish()", "type": "expression", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "vector": [8, 3, 0.3457, 0.0037, 3, 0.07, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.velocity_topic.publish(BaseVel(0,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L95_C12", "label": "self.has_stopped =", "type": "assigned_variable", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "vector": [14, 3, 0.3532, 0.0037, 3, 0.07, 0.3333, 685, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.has_stopped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_stopped = True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L96_C12", "label": "say()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "vector": [8, 3, 0.3569, 0.0037, 3, 0.07, 0.6667, 890, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "say", "arg_names": [], "import_names": [], "rhs_call_name": "say", "annotation": ""}, "snippet": " say('done')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "label": "if", "type": "if", "loc": [97, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "vector": [4, 3, 0.3699, 0.0223, 3, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not self.has_stopped:\n #print 'HAS STOPPED'\n base_command = self.cmd.val(self.count)\n msg = BaseVel(base_command.forward_vel, base_command.rot_vel)\n #print 'publishing', base_command.forward_vel, base_command.rot_vel\n self.velocity_topic.publish(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L99_C12", "label": "base_command = val()", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "vector": [14, 4, 0.368, 0.0037, 4, 0.1, 0.0, 15, 3, 1, 0, 0, 618, 10, 1], "semantic": {"name": "base_command", "arg_names": [], "import_names": [], "rhs_call_name": "val", "annotation": ""}, "snippet": " base_command = self.cmd.val(self.count)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L100_C12", "label": "msg = BaseVel()", "type": "assigned_variable", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "vector": [14, 4, 0.3717, 0.0037, 4, 0.1, 0.5, 712, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "BaseVel", "annotation": ""}, "snippet": " msg = BaseVel(base_command.forward_vel, base_command.rot_vel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L102_C12", "label": "publish()", "type": "expression", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "vector": [8, 4, 0.3792, 0.0037, 4, 0.1, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.velocity_topic.publish(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L103_C8", "label": "self.count =", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "vector": [14, 2, 0.3829, 0.0037, 2, 0.08, 1.0, 340, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.count = self.count + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L105_C0", "label": "FakeTopic", "type": "class", "loc": [105, 107], "level": 0, "parent": null, "vector": [3, 0, 0.3941, 0.0112, 0, 0.66, 0.8571, 210, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "FakeTopic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FakeTopic:\n def publish(self, something):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L106_C4", "label": "publish", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L105_C0", "vector": [2, 1, 0.3959, 0.0074, 1, 0.36, 0.0, 102, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "publish", "arg_names": ["self", "something"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish(self, something):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L109_C0", "label": "FakePoint", "type": "class", "loc": [109, 113], "level": 0, "parent": null, "vector": [3, 0, 0.4126, 0.0186, 0, 0.66, 0.9286, 5, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "FakePoint", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FakePoint:\n def __init__(self, x, y, z):\n self.x = x\n self.y = y\n self.z = z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "label": "__init__", "type": "function", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L109_C0", "vector": [2, 1, 0.4145, 0.0149, 1, 0.4, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "x", "y", "z"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, x, y, z):\n self.x = x\n self.y = y\n self.z = z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L111_C8", "label": "self.x =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "vector": [14, 2, 0.4126, 0.0037, 2, 0.47, 0.0, 236, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L112_C8", "label": "self.y =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "vector": [14, 2, 0.4164, 0.0037, 2, 0.47, 0.5, 276, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.y = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L113_C8", "label": "self.z =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "vector": [14, 2, 0.4201, 0.0037, 2, 0.47, 1.0, 306, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.z = z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "label": "if", "type": "if", "loc": [116, 126], "level": 0, "parent": null, "vector": [4, 0, 0.4498, 0.0409, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import time\n pub = rospy.TopicPub('cmd_vel', BaseVel)\n follow_behavior = FollowBehavior(pub)\n rospy.TopicSub('odom', RobotBase2DOdom, follow_behavior.robot_moved)\n rospy.TopicSub(CURSOR_TOPIC, Position, follow_behavior.cursor_moved)\n rospy.ready(sys.argv[0])\n #follow_behavior.cursor_moved(FakePoint(0.0,0.0,1.0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L117_C4", "label": "time import time", "type": "import", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [1, 1, 0.4349, 0.0037, 1, 0.4, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": " import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L118_C4", "label": "pub = TopicPub()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [14, 1, 0.4387, 0.0037, 1, 0.4, 0.1667, 41, 3, 2, 0, 0, 871, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "TopicPub", "annotation": ""}, "snippet": " pub = rospy.TopicPub('cmd_vel', BaseVel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L119_C4", "label": "follow_behavior = FollowBehavior()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [14, 1, 0.4424, 0.0037, 1, 0.4, 0.3333, 412, 3, 1, 0, 0, 405, 10, 1], "semantic": {"name": "follow_behavior", "arg_names": [], "import_names": [], "rhs_call_name": "FollowBehavior", "annotation": ""}, "snippet": " follow_behavior = FollowBehavior(pub)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L120_C4", "label": "TopicSub()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [8, 1, 0.4461, 0.0037, 1, 0.4, 0.5, 701, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "TopicSub", "arg_names": [], "import_names": [], "rhs_call_name": "TopicSub", "annotation": ""}, "snippet": " rospy.TopicSub('odom', RobotBase2DOdom, follow_behavior.robot_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L121_C4", "label": "TopicSub()", "type": "expression", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [8, 1, 0.4498, 0.0037, 1, 0.4, 0.6667, 701, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "TopicSub", "arg_names": [], "import_names": [], "rhs_call_name": "TopicSub", "annotation": ""}, "snippet": " rospy.TopicSub(CURSOR_TOPIC, Position, follow_behavior.cursor_moved)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L122_C4", "label": "ready()", "type": "expression", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [8, 1, 0.4535, 0.0037, 1, 0.4, 0.8333, 605, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ready", "arg_names": [], "import_names": [], "rhs_call_name": "ready", "annotation": ""}, "snippet": " rospy.ready(sys.argv[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:While_L124_C4", "label": "while", "type": "while", "loc": [124, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "vector": [5, 1, 0.4647, 0.0112, 1, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.isShutdown():\n follow_behavior.run()\n time.sleep(0.016)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L125_C8", "label": "run()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:While_L124_C4", "vector": [8, 2, 0.4647, 0.0037, 2, 0.94, 0.0, 679, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " follow_behavior.run()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L126_C8", "label": "sleep()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99234:While_L124_C4", "vector": [8, 2, 0.4684, 0.0037, 2, 0.94, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(0.016)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Return_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L105_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:ClassDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Import_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:If_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:While_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:While_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99234:While_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99234:Expr_L126_C8"}] |
import roslib
roslib.load_manifest('laser_interface')
import laser_interface.camera as cam
from laser_interface.laser_detector import *
import rospy
import cv
stereo_camera = '/wide_stereo'
image_type = 'image_rect_color'
coi = 1
stereo = cam.ROSStereoListener([stereo_camera + '/left/' + image_type, stereo_camera + '/right/' + image_type])
sample_frame, r = stereo.next()
threshold = [100, 240]
splitter = SplitColors(sample_frame)
intensity_filter = BrightnessThreshold(sample_frame, thres_low=threshold[0], thres_high=threshold[1], tune=True)
#intensity_filtered = intensity_filter.threshold(coi)
cv.NamedWindow('low', 1)
cv.NamedWindow('high', 1)
cv.NamedWindow('combined', 1)
cv.NamedWindow('original', 1)
def low_thresh_func(val):
threshold[0] = val
intensity_filter.set_thresholds(threshold)
print 'low', val
def high_thresh_func(val):
threshold[1] = val
intensity_filter.set_thresholds(threshold)
print 'high', val
cv.CreateTrackbar('low_threshold', 'low', threshold[0], 255, low_thresh_func)
cv.CreateTrackbar('high_threshold', 'high', threshold[1], 255, high_thresh_func)
#for image, _ in stereo:
while not rospy.is_shutdown():
image, _ = stereo.next()
r, g, b = splitter.split(image)
filtered_image = intensity_filter.threshold(g)
cv.ShowImage('low', intensity_filter.thresholded_low)
cv.ShowImage('high', intensity_filter.thresholded_high)
#cv.ShowImage('original', g)
cv.ShowImage('combined', filtered_image)
cv.WaitKey(33)
| ajibawa-2023/Python-Code-Large/train/row_99235 | 36 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.02, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.04, 0.02, 0, 0.66, 0.0455, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('laser_interface')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Import_L3_C0", "label": "laser_interface.camera import cam", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.06, 0.02, 0, 0.66, 0.0909, 875, 0, 1, 0, 0, 875, 0, 0], "semantic": {"name": "laser_interface.camera", "arg_names": [], "import_names": ["cam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import laser_interface.camera as cam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:ImportFrom_L4_C0", "label": "from laser_interface.laser_detector import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.08, 0.02, 0, 0.66, 0.1364, 566, 0, 1, 0, 0, 566, 0, 0], "semantic": {"name": "laser_interface.laser_detector", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from laser_interface.laser_detector import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.02, 0, 0.66, 0.1818, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.12, 0.02, 0, 0.66, 0.2273, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L8_C0", "label": "stereo_camera =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.16, 0.02, 0, 0.66, 0.2727, 967, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "stereo_camera", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "stereo_camera = '/wide_stereo'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L9_C0", "label": "image_type =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.18, 0.02, 0, 0.66, 0.3182, 706, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "image_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "image_type = 'image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L10_C0", "label": "coi =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.02, 0, 0.66, 0.3636, 749, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "coi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "coi = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L12_C0", "label": "stereo = ROSStereoListener()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.24, 0.02, 0, 0.66, 0.4091, 208, 3, 1, 0, 0, 383, 10, 1], "semantic": {"name": "stereo", "arg_names": [], "import_names": [], "rhs_call_name": "ROSStereoListener", "annotation": ""}, "snippet": "stereo = cam.ROSStereoListener([stereo_camera + '/left/' + image_type, stereo_camera + '/right/' + image_type])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L13_C0", "label": "sample_frame, r = next()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.26, 0.02, 0, 0.66, 0.4545, 725, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "sample_frame, r", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": "sample_frame, r = stereo.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L14_C0", "label": "threshold =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.28, 0.02, 0, 0.66, 0.5, 635, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "threshold = [100, 240]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L16_C0", "label": "splitter = SplitColors()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.32, 0.02, 0, 0.66, 0.5455, 720, 3, 1, 0, 0, 70, 10, 1], "semantic": {"name": "splitter", "arg_names": [], "import_names": [], "rhs_call_name": "SplitColors", "annotation": ""}, "snippet": "splitter = SplitColors(sample_frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L17_C0", "label": "intensity_filter = BrightnessThreshold()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.34, 0.02, 0, 0.66, 0.5909, 446, 3, 4, 0, 0, 650, 10, 1], "semantic": {"name": "intensity_filter", "arg_names": [], "import_names": [], "rhs_call_name": "BrightnessThreshold", "annotation": ""}, "snippet": "intensity_filter = BrightnessThreshold(sample_frame, thres_low=threshold[0], thres_high=threshold[1], tune=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L20_C0", "label": "NamedWindow()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.4, 0.02, 0, 0.66, 0.6364, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('low', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L21_C0", "label": "NamedWindow()", "type": "expression", "loc": [21, 21], "level": 0, "parent": null, "vector": [8, 0, 0.42, 0.02, 0, 0.66, 0.6818, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('high', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L22_C0", "label": "NamedWindow()", "type": "expression", "loc": [22, 22], "level": 0, "parent": null, "vector": [8, 0, 0.44, 0.02, 0, 0.66, 0.7273, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('combined', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L23_C0", "label": "NamedWindow()", "type": "expression", "loc": [23, 23], "level": 0, "parent": null, "vector": [8, 0, 0.46, 0.02, 0, 0.66, 0.7727, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": "cv.NamedWindow('original', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "label": "low_thresh_func", "type": "function", "loc": [25, 28], "level": 0, "parent": null, "vector": [2, 0, 0.53, 0.08, 0, 0.66, 0.8182, 207, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "low_thresh_func", "arg_names": ["val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def low_thresh_func(val):\n threshold[0] = val\n intensity_filter.set_thresholds(threshold)\n print('low', val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L26_C4", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "vector": [14, 1, 0.52, 0.02, 1, 0.54, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " threshold[0] = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L27_C4", "label": "set_thresholds()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "vector": [8, 1, 0.54, 0.02, 1, 0.54, 0.5, 854, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_thresholds", "arg_names": [], "import_names": [], "rhs_call_name": "set_thresholds", "annotation": ""}, "snippet": " intensity_filter.set_thresholds(threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "vector": [8, 1, 0.56, 0.02, 1, 0.54, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('low', val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "label": "high_thresh_func", "type": "function", "loc": [30, 33], "level": 0, "parent": null, "vector": [2, 0, 0.63, 0.08, 0, 0.66, 0.8636, 242, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "high_thresh_func", "arg_names": ["val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def high_thresh_func(val):\n threshold[1] = val\n intensity_filter.set_thresholds(threshold)\n print('high', val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L31_C4", "label": "assign", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "vector": [14, 1, 0.62, 0.02, 1, 0.1, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " threshold[1] = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L32_C4", "label": "set_thresholds()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "vector": [8, 1, 0.64, 0.02, 1, 0.1, 0.5, 854, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_thresholds", "arg_names": [], "import_names": [], "rhs_call_name": "set_thresholds", "annotation": ""}, "snippet": " intensity_filter.set_thresholds(threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L33_C4", "label": "print()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "vector": [8, 1, 0.66, 0.02, 1, 0.1, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('high', val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L35_C0", "label": "CreateTrackbar()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.7, 0.02, 0, 0.66, 0.9091, 516, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "CreateTrackbar", "arg_names": [], "import_names": [], "rhs_call_name": "CreateTrackbar", "annotation": ""}, "snippet": "cv.CreateTrackbar('low_threshold', 'low', threshold[0], 255, low_thresh_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L36_C0", "label": "CreateTrackbar()", "type": "expression", "loc": [36, 36], "level": 0, "parent": null, "vector": [8, 0, 0.72, 0.02, 0, 0.66, 0.9545, 516, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "CreateTrackbar", "arg_names": [], "import_names": [], "rhs_call_name": "CreateTrackbar", "annotation": ""}, "snippet": "cv.CreateTrackbar('high_threshold', 'high', threshold[1], 255, high_thresh_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "label": "while", "type": "while", "loc": [39, 47], "level": 0, "parent": null, "vector": [5, 0, 0.86, 0.18, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n image, _ = stereo.next()\n r, g, b = splitter.split(image)\n filtered_image = intensity_filter.threshold(g)\n cv.ShowImage('low', intensity_filter.thresholded_low)\n cv.ShowImage('high', intensity_filter.thresholded_high)\n #cv.ShowImage('original', g)\n cv.ShowImage('combined', filtered_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L40_C4", "label": "image, _ = next()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [14, 1, 0.8, 0.02, 1, 0.45, 0.0, 616, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "image, _", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " image, _ = stereo.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L41_C4", "label": "r, g, b = split()", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [14, 1, 0.82, 0.02, 1, 0.45, 0.1667, 236, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "r, g, b", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " r, g, b = splitter.split(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L42_C4", "label": "filtered_image = threshold()", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [14, 1, 0.84, 0.02, 1, 0.45, 0.3333, 566, 3, 1, 0, 0, 635, 10, 1], "semantic": {"name": "filtered_image", "arg_names": [], "import_names": [], "rhs_call_name": "threshold", "annotation": ""}, "snippet": " filtered_image = intensity_filter.threshold(g)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L43_C4", "label": "ShowImage()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [8, 1, 0.86, 0.02, 1, 0.45, 0.5, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('low', intensity_filter.thresholded_low)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L44_C4", "label": "ShowImage()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [8, 1, 0.88, 0.02, 1, 0.45, 0.6667, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('high', intensity_filter.thresholded_high)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L46_C4", "label": "ShowImage()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [8, 1, 0.92, 0.02, 1, 0.45, 0.8333, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('combined', filtered_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L47_C4", "label": "WaitKey()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "vector": [8, 1, 0.94, 0.02, 1, 0.45, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey(33)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99235:While_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99235:Expr_L47_C4"}] |
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import roslib
roslib.load_manifest('laser_interface')
import rospy
CURSOR_TOPIC = 'cursor3d'
VIZ_TOPIC = 'viz_cursor_3d'
MOUSE_CLICK_TOPIC = 'mouse_click'
MOUSE_R_CLICK_TOPIC = 'mouse_r_click'
MOUSE_DOUBLE_CLICK_TOPIC = 'mouse_left_double_click'
MOUSE_R_DOUBLE_CLICK_TOPIC = 'mouse_right_double_click'
LASER_MODE_TOPIC = 'laser_mode'
| ajibawa-2023/Python-Code-Large/train/row_99236 | 10 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Import_L27_C0", "label": "roslib import roslib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.7297, 0.027, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Expr_L28_C0", "label": "load_manifest()", "type": "expression", "loc": [28, 28], "level": 0, "parent": null, "vector": [8, 0, 0.7568, 0.027, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('laser_interface')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Import_L29_C0", "label": "rospy import rospy", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.7838, 0.027, 0, 0.66, 0.2222, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L31_C0", "label": "CURSOR_TOPIC =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.8378, 0.027, 0, 0.66, 0.3333, 687, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CURSOR_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CURSOR_TOPIC = 'cursor3d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L32_C0", "label": "VIZ_TOPIC =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.8649, 0.027, 0, 0.66, 0.4444, 529, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VIZ_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VIZ_TOPIC = 'viz_cursor_3d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L33_C0", "label": "MOUSE_CLICK_TOPIC =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.8919, 0.027, 0, 0.66, 0.5556, 652, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_CLICK_TOPIC = 'mouse_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L34_C0", "label": "MOUSE_R_CLICK_TOPIC =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9189, 0.027, 0, 0.66, 0.6667, 595, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_R_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_R_CLICK_TOPIC = 'mouse_r_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L35_C0", "label": "MOUSE_DOUBLE_CLICK_TOPIC =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9459, 0.027, 0, 0.66, 0.7778, 984, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_DOUBLE_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_DOUBLE_CLICK_TOPIC = 'mouse_left_double_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L36_C0", "label": "MOUSE_R_DOUBLE_CLICK_TOPIC =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.973, 0.027, 0, 0.66, 0.8889, 792, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOUSE_R_DOUBLE_CLICK_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MOUSE_R_DOUBLE_CLICK_TOPIC = 'mouse_right_double_click'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99236:Assign_L37_C0", "label": "LASER_MODE_TOPIC =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.027, 0, 0.66, 1.0, 123, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LASER_MODE_TOPIC", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LASER_MODE_TOPIC = 'laser_mode'"}] | [] |
#!/usr/bin/env python
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Willow Garage, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
## @author Hai Nguyen/hai@gatech.edu
from pkg import *
from std_msgs.msg import String
import wx, time, sys
def key_to_command(key):
ret = None
if key == u'g':
ret = 'debug'
if key == u'd':
ret = 'display'
if key == u'v':
ret = 'verbose'
if key == u' ':
ret = 'rebuild'
if key == u'p':
ret = 'positive'
if key == u'c':
ret = 'clear'
return ret
class KeyHandler(wx.Window):
def __init__(self, parent):
wx.Window.__init__(self, parent, -1, style=wx.WANTS_CHARS, name="sink")
self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)
self.Bind(wx.EVT_LEFT_DOWN, self.on_left_down)
self.Bind(wx.EVT_LEFT_UP, self.on_left_up)
self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_double_click)
self.Bind(wx.EVT_RIGHT_DOWN, self.on_right_down)
self.Bind(wx.EVT_RIGHT_UP, self.on_right_up)
self.Bind(wx.EVT_RIGHT_DCLICK, self.on_right_double_click)
self.Bind(wx.EVT_PAINT, self.on_paint)
self.Bind(wx.EVT_SET_FOCUS, self.on_set_focus)
self.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus)
self.Bind(wx.EVT_SIZE, self.on_size)
self.Bind(wx.EVT_UPDATE_UI, self.on_size)
wx.UpdateUIEvent.SetUpdateInterval(500)
self.mouse_click_pub = rospy.Publisher(MOUSE_CLICK_TOPIC, String).publish
self.mouse_r_click_pub = rospy.Publisher(MOUSE_R_CLICK_TOPIC, String).publish
self.laser_mode_pub = rospy.Publisher(LASER_MODE_TOPIC, String).publish
self.mouse_double_click_pub = rospy.Publisher(MOUSE_DOUBLE_CLICK_TOPIC, String).publish
self.mouse_r_double_click_pub = rospy.Publisher(MOUSE_R_DOUBLE_CLICK_TOPIC, String).publish
rospy.init_node('user_interface_node')
self.SetBackgroundColour(wx.BLACK)
self.focus = False
self.text = ''
self.time = time.time()
self.interval = 1.0
def set_text(self, text):
self.text = text
self.time = time.time()
def on_size(self, evt):
self.Refresh()
def on_set_focus(self, evt):
self.focus = True
self.Refresh()
def on_kill_focus(self, evt):
self.focus = False
self.Refresh()
def on_left_double_click(self, evt):
self.mouse_double_click_pub('True')
self.set_text('DOUBLE CLICKED')
def on_left_down(self, evt):
self.mouse_click_pub('True')
self.set_text('cli....')
self.Refresh()
def on_left_up(self, evt):
self.mouse_click_pub('False')
self.set_text('...cked')
self.Refresh()
def on_right_double_click(self, evt):
self.mouse_r_double_click_pub('True')
self.set_text('R DOUBLE CLICKED')
def on_right_down(self, evt):
self.mouse_r_click_pub('True')
self.set_text('right cli....')
self.Refresh()
def on_right_up(self, evt):
self.mouse_r_click_pub('False')
self.set_text('...cked')
self.Refresh()
def on_key_down(self, evt):
c = unichr(evt.GetRawKeyCode())
command = key_to_command(c)
if command is not None:
#print 'publishing', command
self.laser_mode_pub(command)
self.set_text(command)
else:
self.set_text(unichr(evt.GetRawKeyCode()))
self.Refresh()
def on_paint(self, evt):
dc = wx.PaintDC(self)
font = dc.GetFont()
font.SetPointSize(20)
dc.SetFont(font)
rect = self.GetClientRect()
if self.focus:
dc.SetTextForeground(wx.GREEN)
dc.DrawLabel("Focused.", rect, wx.ALIGN_CENTER)
else:
dc.SetTextForeground(wx.RED)
dc.DrawLabel("Got no focus.", rect, wx.ALIGN_CENTER)
dc.SetTextForeground(wx.WHITE)
dc.DrawLabel('g - debug\nd - display\nv - verbose\np - positive\nc - clear\nspace - rebuild', rect, wx.ALIGN_LEFT | wx.ALIGN_TOP)
if (time.time() - self.time) < self.interval:
dc.SetFont(wx.Font(20, wx.MODERN, wx.NORMAL, wx.NORMAL))
dc.SetTextForeground(wx.WHITE)
dc.DrawLabel(self.text, rect, wx.ALIGN_BOTTOM | wx.ALIGN_CENTER)
app = wx.PySimpleApp()
frame = wx.Frame(None, wx.ID_ANY, name='Clickable World GUI', size=(800,600))
win = KeyHandler(frame)
frame.Show(True)
win.SetFocus()
#rospy.ready(sys.argv[0])
app.MainLoop()
| ajibawa-2023/Python-Code-Large/train/row_99238 | 109 | 173 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99238:ImportFrom_L30_C0", "label": "from pkg import *", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.1734, 0.0058, 0, 0.66, 0.0, 489, 0, 1, 0, 0, 489, 0, 0], "semantic": {"name": "pkg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pkg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:ImportFrom_L31_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.1792, 0.0058, 0, 0.66, 0.1, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["String"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import String"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Import_L32_C0", "label": "wx import wx, time, sys", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.185, 0.0058, 0, 0.66, 0.2, 666, 0, 3, 0, 0, 666, 0, 0], "semantic": {"name": "wx", "arg_names": [], "import_names": ["wx", "time", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import wx, time, sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "label": "key_to_command", "type": "function", "loc": [34, 55], "level": 0, "parent": null, "vector": [2, 0, 0.2572, 0.1272, 0, 0.66, 0.3, 677, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "key_to_command", "arg_names": ["key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def key_to_command(key):\n ret = None\n\n if key == u'g':\n ret = 'debug'\n\n if key == u'd':\n ret = 'display'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L35_C4", "label": "ret =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [14, 1, 0.2023, 0.0058, 1, 0.63, 0.0, 501, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L37_C4", "label": "if", "type": "if", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [4, 1, 0.2168, 0.0116, 1, 0.63, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == u'g':\n ret = 'debug'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L38_C8", "label": "ret =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L37_C4", "vector": [14, 2, 0.2197, 0.0058, 2, 0.08, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = 'debug'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L40_C4", "label": "if", "type": "if", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [4, 1, 0.2341, 0.0116, 1, 0.63, 0.2857, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == u'd':\n ret = 'display'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L41_C8", "label": "ret =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L40_C4", "vector": [14, 2, 0.237, 0.0058, 2, 0.22, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = 'display'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L43_C4", "label": "if", "type": "if", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [4, 1, 0.2514, 0.0116, 1, 0.63, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == u'v':\n ret = 'verbose'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L44_C8", "label": "ret =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L43_C4", "vector": [14, 2, 0.2543, 0.0058, 2, 0.34, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = 'verbose'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L46_C4", "label": "if", "type": "if", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [4, 1, 0.2688, 0.0116, 1, 0.63, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == u' ':\n ret = 'rebuild'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L47_C8", "label": "ret =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L46_C4", "vector": [14, 2, 0.2717, 0.0058, 2, 0.48, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = 'rebuild'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [4, 1, 0.2861, 0.0116, 1, 0.63, 0.7143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == u'p':\n ret = 'positive'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L50_C8", "label": "ret =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L49_C4", "vector": [14, 2, 0.289, 0.0058, 2, 0.43, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = 'positive'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L52_C4", "label": "if", "type": "if", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [4, 1, 0.3035, 0.0116, 1, 0.63, 0.8571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == u'c':\n ret = 'clear'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L53_C8", "label": "ret =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L52_C4", "vector": [14, 2, 0.3064, 0.0058, 2, 0.66, 0.0, 501, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = 'clear'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Return_L55_C4", "label": "return", "type": "return", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "vector": [13, 1, 0.3179, 0.0058, 1, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "label": "KeyHandler", "type": "class", "loc": [57, 163], "level": 0, "parent": null, "vector": [3, 0, 0.6358, 0.6185, 0, 0.66, 0.4, 817, 0, 13, 0, 0, 335, 0, 67], "semantic": {"name": "KeyHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class KeyHandler(wx.Window):\n def __init__(self, parent):\n wx.Window.__init__(self, parent, -1, style=wx.WANTS_CHARS, name=\"sink\")\n self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)\n\n self.Bind(wx.EVT_LEFT_DOWN, self.on_left_down)\n self.Bind(wx.EVT_LEFT_UP, self.on_left_up)\n self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_double_click)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "label": "__init__", "type": "function", "loc": [58, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.4191, 0.1734, 1, 0.02, 0.0, 555, 0, 2, 0, 0, 0, 0, 22], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent):\n wx.Window.__init__(self, parent, -1, style=wx.WANTS_CHARS, name=\"sink\")\n self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)\n\n self.Bind(wx.EVT_LEFT_DOWN, self.on_left_down)\n self.Bind(wx.EVT_LEFT_UP, self.on_left_up)\n self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_double_click)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L59_C8", "label": "__init__()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.341, 0.0058, 2, 0.62, 0.0, 555, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " wx.Window.__init__(self, parent, -1, style=wx.WANTS_CHARS, name=\"sink\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L60_C8", "label": "Bind()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3468, 0.0058, 2, 0.62, 0.0417, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L62_C8", "label": "Bind()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3584, 0.0058, 2, 0.62, 0.0833, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_LEFT_DOWN, self.on_left_down)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L63_C8", "label": "Bind()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3642, 0.0058, 2, 0.62, 0.125, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_LEFT_UP, self.on_left_up)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L64_C8", "label": "Bind()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3699, 0.0058, 2, 0.62, 0.1667, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_LEFT_DCLICK, self.on_left_double_click)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L66_C8", "label": "Bind()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3815, 0.0058, 2, 0.62, 0.2083, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_RIGHT_DOWN, self.on_right_down)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L67_C8", "label": "Bind()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3873, 0.0058, 2, 0.62, 0.25, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_RIGHT_UP, self.on_right_up)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L68_C8", "label": "Bind()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.3931, 0.0058, 2, 0.62, 0.2917, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_RIGHT_DCLICK, self.on_right_double_click)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L70_C8", "label": "Bind()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.4046, 0.0058, 2, 0.62, 0.3333, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_PAINT, self.on_paint)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L71_C8", "label": "Bind()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.4104, 0.0058, 2, 0.62, 0.375, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_SET_FOCUS, self.on_set_focus)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L72_C8", "label": "Bind()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.4162, 0.0058, 2, 0.62, 0.4167, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_KILL_FOCUS, self.on_kill_focus)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L73_C8", "label": "Bind()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.422, 0.0058, 2, 0.62, 0.4583, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_SIZE, self.on_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L74_C8", "label": "Bind()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.4277, 0.0058, 2, 0.62, 0.5, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_UPDATE_UI, self.on_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L75_C8", "label": "SetUpdateInterval()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.4335, 0.0058, 2, 0.62, 0.5417, 353, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetUpdateInterval", "arg_names": [], "import_names": [], "rhs_call_name": "SetUpdateInterval", "annotation": ""}, "snippet": " wx.UpdateUIEvent.SetUpdateInterval(500)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L77_C8", "label": "self.mouse_click_pub =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4451, 0.0058, 2, 0.62, 0.5833, 371, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.mouse_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mouse_click_pub = rospy.Publisher(MOUSE_CLICK_TOPIC, String).publish"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L78_C8", "label": "self.mouse_r_click_pub =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4509, 0.0058, 2, 0.62, 0.625, 846, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.mouse_r_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mouse_r_click_pub = rospy.Publisher(MOUSE_R_CLICK_TOPIC, String).publish"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L79_C8", "label": "self.laser_mode_pub =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4566, 0.0058, 2, 0.62, 0.6667, 846, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.laser_mode_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.laser_mode_pub = rospy.Publisher(LASER_MODE_TOPIC, String).publish"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L80_C8", "label": "self.mouse_double_click_pub =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4624, 0.0058, 2, 0.62, 0.7083, 419, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.mouse_double_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mouse_double_click_pub = rospy.Publisher(MOUSE_DOUBLE_CLICK_TOPIC, String).publish"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L81_C8", "label": "self.mouse_r_double_click_pub =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4682, 0.0058, 2, 0.62, 0.75, 419, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.mouse_r_double_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mouse_r_double_click_pub = rospy.Publisher(MOUSE_R_DOUBLE_CLICK_TOPIC, String).publish"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L82_C8", "label": "init_node()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.474, 0.0058, 2, 0.62, 0.7917, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('user_interface_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L83_C8", "label": "SetBackgroundColour()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [8, 2, 0.4798, 0.0058, 2, 0.62, 0.8333, 501, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetBackgroundColour", "arg_names": [], "import_names": [], "rhs_call_name": "SetBackgroundColour", "annotation": ""}, "snippet": " self.SetBackgroundColour(wx.BLACK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L84_C8", "label": "self.focus =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4855, 0.0058, 2, 0.62, 0.875, 883, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.focus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.focus = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L85_C8", "label": "self.text =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4913, 0.0058, 2, 0.62, 0.9167, 320, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.text = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L86_C8", "label": "self.time = time()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.4971, 0.0058, 2, 0.62, 0.9583, 960, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L87_C8", "label": "self.interval =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "vector": [14, 2, 0.5029, 0.0058, 2, 0.62, 1.0, 732, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.interval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.interval = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L89_C4", "label": "set_text", "type": "function", "loc": [89, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.5202, 0.0173, 1, 0.02, 0.0833, 592, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_text(self, text):\n self.text = text\n self.time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L90_C8", "label": "self.text =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L89_C4", "vector": [14, 2, 0.5202, 0.0058, 2, 0.72, 0.0, 320, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.text = text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L91_C8", "label": "self.time = time()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L89_C4", "vector": [14, 2, 0.526, 0.0058, 2, 0.72, 1.0, 960, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "self.time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " self.time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L93_C4", "label": "on_size", "type": "function", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.5405, 0.0116, 1, 0.02, 0.1667, 228, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "on_size", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_size(self, evt):\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L94_C8", "label": "Refresh()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L93_C4", "vector": [8, 2, 0.5434, 0.0058, 2, 0.04, 0.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L96_C4", "label": "on_set_focus", "type": "function", "loc": [96, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.5607, 0.0173, 1, 0.02, 0.25, 930, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "on_set_focus", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_set_focus(self, evt):\n self.focus = True\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L97_C8", "label": "self.focus =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L96_C4", "vector": [14, 2, 0.5607, 0.0058, 2, 0.87, 0.0, 883, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.focus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.focus = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L98_C8", "label": "Refresh()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L96_C4", "vector": [8, 2, 0.5665, 0.0058, 2, 0.87, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L100_C4", "label": "on_kill_focus", "type": "function", "loc": [100, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.5838, 0.0173, 1, 0.02, 0.3333, 682, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "on_kill_focus", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_kill_focus(self, evt):\n self.focus = False\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L101_C8", "label": "self.focus =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L100_C4", "vector": [14, 2, 0.5838, 0.0058, 2, 0.37, 0.0, 883, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.focus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.focus = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L102_C8", "label": "Refresh()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L100_C4", "vector": [8, 2, 0.5896, 0.0058, 2, 0.37, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L104_C4", "label": "on_left_double_click", "type": "function", "loc": [104, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.6069, 0.0173, 1, 0.02, 0.4167, 775, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "on_left_double_click", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_left_double_click(self, evt):\n self.mouse_double_click_pub('True')\n self.set_text('DOUBLE CLICKED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L105_C8", "label": "mouse_double_click_pub()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L104_C4", "vector": [8, 2, 0.6069, 0.0058, 2, 0.15, 0.0, 542, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mouse_double_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "mouse_double_click_pub", "annotation": ""}, "snippet": " self.mouse_double_click_pub('True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L106_C8", "label": "set_text()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L104_C4", "vector": [8, 2, 0.6127, 0.0058, 2, 0.15, 1.0, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text('DOUBLE CLICKED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "label": "on_left_down", "type": "function", "loc": [108, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.6329, 0.0231, 1, 0.02, 0.5, 323, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "on_left_down", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_left_down(self, evt):\n self.mouse_click_pub('True')\n self.set_text('cli....')\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L109_C8", "label": "mouse_click_pub()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "vector": [8, 2, 0.6301, 0.0058, 2, 0.51, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mouse_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "mouse_click_pub", "annotation": ""}, "snippet": " self.mouse_click_pub('True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L110_C8", "label": "set_text()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "vector": [8, 2, 0.6358, 0.0058, 2, 0.51, 0.5, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text('cli....')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L111_C8", "label": "Refresh()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "vector": [8, 2, 0.6416, 0.0058, 2, 0.51, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "label": "on_left_up", "type": "function", "loc": [113, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.6618, 0.0231, 1, 0.02, 0.5833, 624, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "on_left_up", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_left_up(self, evt):\n self.mouse_click_pub('False')\n self.set_text('...cked')\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L114_C8", "label": "mouse_click_pub()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "vector": [8, 2, 0.659, 0.0058, 2, 0.1, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mouse_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "mouse_click_pub", "annotation": ""}, "snippet": " self.mouse_click_pub('False')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L115_C8", "label": "set_text()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "vector": [8, 2, 0.6647, 0.0058, 2, 0.1, 0.5, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text('...cked')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L116_C8", "label": "Refresh()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "vector": [8, 2, 0.6705, 0.0058, 2, 0.1, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L118_C4", "label": "on_right_double_click", "type": "function", "loc": [118, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.6879, 0.0173, 1, 0.02, 0.6667, 917, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "on_right_double_click", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_right_double_click(self, evt):\n self.mouse_r_double_click_pub('True')\n self.set_text('R DOUBLE CLICKED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L119_C8", "label": "mouse_r_double_click_pub()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L118_C4", "vector": [8, 2, 0.6879, 0.0058, 2, 0.89, 0.0, 586, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mouse_r_double_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "mouse_r_double_click_pub", "annotation": ""}, "snippet": " self.mouse_r_double_click_pub('True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L120_C8", "label": "set_text()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L118_C4", "vector": [8, 2, 0.6936, 0.0058, 2, 0.89, 1.0, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text('R DOUBLE CLICKED')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "label": "on_right_down", "type": "function", "loc": [122, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.7139, 0.0231, 1, 0.02, 0.75, 908, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "on_right_down", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_right_down(self, evt):\n self.mouse_r_click_pub('True')\n self.set_text('right cli....')\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L123_C8", "label": "mouse_r_click_pub()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "vector": [8, 2, 0.711, 0.0058, 2, 0.98, 0.0, 812, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mouse_r_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "mouse_r_click_pub", "annotation": ""}, "snippet": " self.mouse_r_click_pub('True')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L124_C8", "label": "set_text()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "vector": [8, 2, 0.7168, 0.0058, 2, 0.98, 0.5, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text('right cli....')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L125_C8", "label": "Refresh()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "vector": [8, 2, 0.7225, 0.0058, 2, 0.98, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "label": "on_right_up", "type": "function", "loc": [127, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.7428, 0.0231, 1, 0.02, 0.8333, 114, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "on_right_up", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_right_up(self, evt):\n self.mouse_r_click_pub('False')\n self.set_text('...cked')\n self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L128_C8", "label": "mouse_r_click_pub()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "vector": [8, 2, 0.7399, 0.0058, 2, 0.14, 0.0, 812, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mouse_r_click_pub", "arg_names": [], "import_names": [], "rhs_call_name": "mouse_r_click_pub", "annotation": ""}, "snippet": " self.mouse_r_click_pub('False')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L129_C8", "label": "set_text()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "vector": [8, 2, 0.7457, 0.0058, 2, 0.14, 0.5, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text('...cked')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L130_C8", "label": "Refresh()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "vector": [8, 2, 0.7514, 0.0058, 2, 0.14, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "label": "on_key_down", "type": "function", "loc": [132, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.789, 0.0578, 1, 0.02, 0.9167, 883, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "on_key_down", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_key_down(self, evt):\n c = unichr(evt.GetRawKeyCode())\n command = key_to_command(c)\n if command is not None:\n #print 'publishing', command\n self.laser_mode_pub(command)\n self.set_text(command)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L133_C8", "label": "c = unichr()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "vector": [14, 2, 0.7688, 0.0058, 2, 0.55, 0.0, 411, 3, 1, 0, 0, 842, 10, 2], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "unichr", "annotation": ""}, "snippet": " c = unichr(evt.GetRawKeyCode())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L134_C8", "label": "command = key_to_command()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "vector": [14, 2, 0.7746, 0.0058, 2, 0.55, 0.3333, 842, 3, 1, 0, 0, 677, 10, 1], "semantic": {"name": "command", "arg_names": [], "import_names": [], "rhs_call_name": "key_to_command", "annotation": ""}, "snippet": " command = key_to_command(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "label": "if", "type": "if", "loc": [135, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "vector": [4, 2, 0.7948, 0.0347, 2, 0.55, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if command is not None:\n #print 'publishing', command\n self.laser_mode_pub(command)\n self.set_text(command)\n else:\n self.set_text(unichr(evt.GetRawKeyCode()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L137_C12", "label": "laser_mode_pub()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "vector": [8, 3, 0.7919, 0.0058, 3, 0.48, 0.0, 710, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "laser_mode_pub", "arg_names": [], "import_names": [], "rhs_call_name": "laser_mode_pub", "annotation": ""}, "snippet": " self.laser_mode_pub(command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L138_C12", "label": "set_text()", "type": "expression", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "vector": [8, 3, 0.7977, 0.0058, 3, 0.48, 0.5, 592, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text(command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L140_C12", "label": "set_text()", "type": "expression", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "vector": [8, 3, 0.8092, 0.0058, 3, 0.48, 1.0, 592, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "set_text", "arg_names": [], "import_names": [], "rhs_call_name": "set_text", "annotation": ""}, "snippet": " self.set_text(unichr(evt.GetRawKeyCode()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L141_C8", "label": "Refresh()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "vector": [8, 2, 0.815, 0.0058, 2, 0.55, 1.0, 799, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Refresh", "arg_names": [], "import_names": [], "rhs_call_name": "Refresh", "annotation": ""}, "snippet": " self.Refresh()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "label": "on_paint", "type": "function", "loc": [143, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "vector": [2, 1, 0.8844, 0.1214, 1, 0.02, 1.0, 839, 0, 2, 0, 0, 0, 0, 16], "semantic": {"name": "on_paint", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def on_paint(self, evt):\n dc = wx.PaintDC(self)\n font = dc.GetFont()\n font.SetPointSize(20)\n dc.SetFont(font)\n rect = self.GetClientRect()\n\n if self.focus:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L144_C8", "label": "dc = PaintDC()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [14, 2, 0.8324, 0.0058, 2, 0.0, 0.0, 108, 3, 1, 0, 0, 15, 10, 1], "semantic": {"name": "dc", "arg_names": [], "import_names": [], "rhs_call_name": "PaintDC", "annotation": ""}, "snippet": " dc = wx.PaintDC(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L145_C8", "label": "font = GetFont()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [14, 2, 0.8382, 0.0058, 2, 0.0, 0.125, 768, 3, 0, 0, 0, 802, 10, 1], "semantic": {"name": "font", "arg_names": [], "import_names": [], "rhs_call_name": "GetFont", "annotation": ""}, "snippet": " font = dc.GetFont()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L146_C8", "label": "SetPointSize()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [8, 2, 0.8439, 0.0058, 2, 0.0, 0.25, 824, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetPointSize", "arg_names": [], "import_names": [], "rhs_call_name": "SetPointSize", "annotation": ""}, "snippet": " font.SetPointSize(20)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L147_C8", "label": "SetFont()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [8, 2, 0.8497, 0.0058, 2, 0.0, 0.375, 434, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetFont", "arg_names": [], "import_names": [], "rhs_call_name": "SetFont", "annotation": ""}, "snippet": " dc.SetFont(font)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L148_C8", "label": "rect = GetClientRect()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [14, 2, 0.8555, 0.0058, 2, 0.0, 0.5, 902, 3, 0, 0, 0, 788, 10, 1], "semantic": {"name": "rect", "arg_names": [], "import_names": [], "rhs_call_name": "GetClientRect", "annotation": ""}, "snippet": " rect = self.GetClientRect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "label": "if", "type": "if", "loc": [150, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [4, 2, 0.8815, 0.0347, 2, 0.0, 0.625, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.focus:\n dc.SetTextForeground(wx.GREEN)\n dc.DrawLabel(\"Focused.\", rect, wx.ALIGN_CENTER)\n else:\n dc.SetTextForeground(wx.RED)\n dc.DrawLabel(\"Got no focus.\", rect, wx.ALIGN_CENTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L151_C12", "label": "SetTextForeground()", "type": "expression", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "vector": [8, 3, 0.8728, 0.0058, 3, 0.72, 0.0, 109, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetTextForeground", "arg_names": [], "import_names": [], "rhs_call_name": "SetTextForeground", "annotation": ""}, "snippet": " dc.SetTextForeground(wx.GREEN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L152_C12", "label": "DrawLabel()", "type": "expression", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "vector": [8, 3, 0.8786, 0.0058, 3, 0.72, 0.3333, 993, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "DrawLabel", "arg_names": [], "import_names": [], "rhs_call_name": "DrawLabel", "annotation": ""}, "snippet": " dc.DrawLabel(\"Focused.\", rect, wx.ALIGN_CENTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L154_C12", "label": "SetTextForeground()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "vector": [8, 3, 0.8902, 0.0058, 3, 0.72, 0.6667, 109, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetTextForeground", "arg_names": [], "import_names": [], "rhs_call_name": "SetTextForeground", "annotation": ""}, "snippet": " dc.SetTextForeground(wx.RED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L155_C12", "label": "DrawLabel()", "type": "expression", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "vector": [8, 3, 0.896, 0.0058, 3, 0.72, 1.0, 993, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "DrawLabel", "arg_names": [], "import_names": [], "rhs_call_name": "DrawLabel", "annotation": ""}, "snippet": " dc.DrawLabel(\"Got no focus.\", rect, wx.ALIGN_CENTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L157_C8", "label": "SetTextForeground()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [8, 2, 0.9075, 0.0058, 2, 0.0, 0.75, 109, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetTextForeground", "arg_names": [], "import_names": [], "rhs_call_name": "SetTextForeground", "annotation": ""}, "snippet": " dc.SetTextForeground(wx.WHITE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L158_C8", "label": "DrawLabel()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [8, 2, 0.9133, 0.0058, 2, 0.0, 0.875, 993, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "DrawLabel", "arg_names": [], "import_names": [], "rhs_call_name": "DrawLabel", "annotation": ""}, "snippet": " dc.DrawLabel('g - debug\\nd - display\\nv - verbose\\np - positive\\nc - clear\\nspace - rebuild', rect, wx.ALIGN_LEFT | wx.ALIGN_TOP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "label": "if", "type": "if", "loc": [160, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "vector": [4, 2, 0.9335, 0.0231, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (time.time() - self.time) < self.interval:\n dc.SetFont(wx.Font(20, wx.MODERN, wx.NORMAL, wx.NORMAL))\n dc.SetTextForeground(wx.WHITE)\n dc.DrawLabel(self.text, rect, wx.ALIGN_BOTTOM | wx.ALIGN_CENTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L161_C12", "label": "SetFont()", "type": "expression", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "vector": [8, 3, 0.9306, 0.0058, 3, 0.59, 0.0, 434, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "SetFont", "arg_names": [], "import_names": [], "rhs_call_name": "SetFont", "annotation": ""}, "snippet": " dc.SetFont(wx.Font(20, wx.MODERN, wx.NORMAL, wx.NORMAL))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L162_C12", "label": "SetTextForeground()", "type": "expression", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "vector": [8, 3, 0.9364, 0.0058, 3, 0.59, 0.5, 109, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetTextForeground", "arg_names": [], "import_names": [], "rhs_call_name": "SetTextForeground", "annotation": ""}, "snippet": " dc.SetTextForeground(wx.WHITE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L163_C12", "label": "DrawLabel()", "type": "expression", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "vector": [8, 3, 0.9422, 0.0058, 3, 0.59, 1.0, 993, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "DrawLabel", "arg_names": [], "import_names": [], "rhs_call_name": "DrawLabel", "annotation": ""}, "snippet": " dc.DrawLabel(self.text, rect, wx.ALIGN_BOTTOM | wx.ALIGN_CENTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L165_C0", "label": "app = PySimpleApp()", "type": "assigned_variable", "loc": [165, 165], "level": 0, "parent": null, "vector": [14, 0, 0.9538, 0.0058, 0, 0.66, 0.5, 494, 3, 0, 0, 0, 909, 10, 1], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "PySimpleApp", "annotation": ""}, "snippet": "app = wx.PySimpleApp()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L166_C0", "label": "frame = Frame()", "type": "assigned_variable", "loc": [166, 166], "level": 0, "parent": null, "vector": [14, 0, 0.9595, 0.0058, 0, 0.66, 0.6, 313, 3, 4, 0, 0, 342, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": "frame = wx.Frame(None, wx.ID_ANY, name='Clickable World GUI', size=(800,600))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L167_C0", "label": "win = KeyHandler()", "type": "assigned_variable", "loc": [167, 167], "level": 0, "parent": null, "vector": [14, 0, 0.9653, 0.0058, 0, 0.66, 0.7, 419, 3, 1, 0, 0, 817, 10, 1], "semantic": {"name": "win", "arg_names": [], "import_names": [], "rhs_call_name": "KeyHandler", "annotation": ""}, "snippet": "win = KeyHandler(frame) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L168_C0", "label": "Show()", "type": "expression", "loc": [168, 168], "level": 0, "parent": null, "vector": [8, 0, 0.9711, 0.0058, 0, 0.66, 0.8, 408, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "Show", "arg_names": [], "import_names": [], "rhs_call_name": "Show", "annotation": ""}, "snippet": "frame.Show(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L169_C0", "label": "SetFocus()", "type": "expression", "loc": [169, 169], "level": 0, "parent": null, "vector": [8, 0, 0.9769, 0.0058, 0, 0.66, 0.9, 989, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetFocus", "arg_names": [], "import_names": [], "rhs_call_name": "SetFocus", "annotation": ""}, "snippet": "win.SetFocus()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L171_C0", "label": "MainLoop()", "type": "expression", "loc": [171, 171], "level": 0, "parent": null, "vector": [8, 0, 0.9884, 0.0058, 0, 0.66, 1.0, 856, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "MainLoop", "arg_names": [], "import_names": [], "rhs_call_name": "MainLoop", "annotation": ""}, "snippet": "app.MainLoop()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Return_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99238:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99238:Expr_L163_C12"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
import roslib; roslib.load_manifest('pr2_clutter_helper')
#depnds on sensor_msgs, opencv2, cv_bridge
import rospy
from sensor_msgs.msg import PointCloud
import cv #version 2.1 expected
from cv_bridge import CvBridge
#may need image_transport?
import time #sleep
from random import * #randint
TOPIC_NAME = "tilt_laser_cloud"
global_ros_data = None
'''
Comments:
Traps exactly one message from the topic specified. This is
To run 'main', this assumes the launch of "pr2_laser_snapshotter" with mapping to "tilt_laser_cloud"
Basic use is to import and call "subscribe_once" method.
'''
def init():
rospy.init_node('my_listener', anonymous=True)
def myCallback(data):
print 'callback called'
global global_ros_data
global_ros_data = data
##def listener():
## rospy.init_node('my_listener', anonymous=True)
## rospy.Subscriber("tilt_laser_cloud", PointCloud, cloudCallback)
## rospy.spin()
def subscribe_once(topic_name=TOPIC_NAME, msg_type=PointCloud):
init()
#if not something, init.
s = rospy.Subscriber(topic_name, msg_type, myCallback)
#spin until 1 message is received.
print 'sleeping now: waitin for topic', topic_name
while (not global_ros_image):
time.sleep(.1)
print 'waking and exiting now'
s.unregister()
global global_ros_data
return global_ros_data #value will be returned as 'global_ros_data'
if __name__ == 'main':
data = subscribe_once(TOPIC_NAME, PointCloud)
#assume global_ros_data is defined.
#do something with the pointcloud
for i in range(10):
pt = data.points[i]
print "(%f, %f, %f)" %(pt.x, pt.y, pt.z)
| ajibawa-2023/Python-Code-Large/train/row_99239 | 30 | 90 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.3444, 0.0111, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L31_C15", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.3444, 0.0111, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3667, 0.0111, 0, 0.66, 0.1429, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:ImportFrom_L34_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.3778, 0.0111, 0, 0.66, 0.2143, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Import_L35_C0", "label": "cv import cv", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3889, 0.0111, 0, 0.66, 0.2857, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv #version 2.1 expected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:ImportFrom_L36_C0", "label": "from cv_bridge import CvBridge", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.4, 0.0111, 0, 0.66, 0.3571, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge import CvBridge"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Import_L39_C0", "label": "time import time", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4333, 0.0111, 0, 0.66, 0.4286, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time #sleep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:ImportFrom_L40_C0", "label": "from random import *", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.4444, 0.0111, 0, 0.66, 0.5, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import * #randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L42_C0", "label": "TOPIC_NAME =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.4667, 0.0111, 0, 0.66, 0.5714, 355, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TOPIC_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TOPIC_NAME = \"tilt_laser_cloud\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L43_C0", "label": "global_ros_data =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.4778, 0.0111, 0, 0.66, 0.6429, 296, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "global_ros_data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L44_C0", "label": "expression", "type": "expression", "loc": [44, 49], "level": 0, "parent": null, "vector": [8, 0, 0.5167, 0.0667, 0, 0.66, 0.7143, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n Comments:\n Traps exactly one message from the topic specified. This is \n To run 'main', this assumes the launch of \"pr2_laser_snapshotter\" with mapping to \"tilt_laser_cloud\"\n Basic use is to import and call \"subscribe_once\" method.\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L51_C0", "label": "init", "type": "function", "loc": [51, 52], "level": 0, "parent": null, "vector": [2, 0, 0.5722, 0.0222, 0, 0.66, 0.7857, 319, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init():\n rospy.init_node('my_listener', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L52_C4", "label": "init_node()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L51_C0", "vector": [8, 1, 0.5778, 0.0111, 1, 0.14, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('my_listener', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L54_C0", "label": "myCallback", "type": "function", "loc": [54, 57], "level": 0, "parent": null, "vector": [2, 0, 0.6167, 0.0444, 0, 0.66, 0.8571, 380, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "myCallback", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def myCallback(data):\n print('callback called')\n global global_ros_data\n global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L55_C4", "label": "print()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L54_C0", "vector": [8, 1, 0.6111, 0.0111, 1, 0.31, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('callback called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L57_C4", "label": "global_ros_data =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L54_C0", "vector": [14, 1, 0.6333, 0.0111, 1, 0.31, 1.0, 296, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "label": "subscribe_once", "type": "function", "loc": [64, 75], "level": 0, "parent": null, "vector": [2, 0, 0.7722, 0.1333, 0, 0.66, 0.9286, 902, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "subscribe_once", "arg_names": ["topic_name", "msg_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subscribe_once(topic_name=TOPIC_NAME, msg_type=PointCloud):\n init()\n #if not something, init.\n s = rospy.Subscriber(topic_name, msg_type, myCallback)\n #spin until 1 message is received.\n print('sleeping now: waitin for topic', topic_name)\n while (not global_ros_image):\n time.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L65_C4", "label": "init()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [8, 1, 0.7222, 0.0111, 1, 0.51, 0.0, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": [], "import_names": [], "rhs_call_name": "init", "annotation": ""}, "snippet": " init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L67_C4", "label": "s = Subscriber()", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [14, 1, 0.7444, 0.0111, 1, 0.51, 0.1667, 553, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " s = rospy.Subscriber(topic_name, msg_type, myCallback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L69_C4", "label": "print()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [8, 1, 0.7667, 0.0111, 1, 0.51, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('sleeping now: waitin for topic', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:While_L70_C4", "label": "while", "type": "while", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [5, 1, 0.7833, 0.0222, 1, 0.51, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (not global_ros_image):\n time.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L71_C8", "label": "sleep()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:While_L70_C4", "vector": [8, 2, 0.7889, 0.0111, 2, 0.36, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L72_C4", "label": "print()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [8, 1, 0.8, 0.0111, 1, 0.51, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waking and exiting now')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L73_C4", "label": "unregister()", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [8, 1, 0.8111, 0.0111, 1, 0.51, 0.8333, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " s.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Return_L75_C4", "label": "return", "type": "return", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "vector": [13, 1, 0.8333, 0.0111, 1, 0.51, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return global_ros_data #value will be returned as 'global_ros_data'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:If_L77_C0", "label": "if", "type": "if", "loc": [77, 84], "level": 0, "parent": null, "vector": [4, 0, 0.8944, 0.0889, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == 'main':\n data = subscribe_once(TOPIC_NAME, PointCloud)\n \n #assume global_ros_data is defined.\n #do something with the pointcloud\n for i in range(10):\n pt = data.points[i]\n print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L78_C4", "label": "data = subscribe_once()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:If_L77_C0", "vector": [14, 1, 0.8667, 0.0111, 1, 0.88, 0.0, 929, 3, 2, 0, 0, 902, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_once", "annotation": ""}, "snippet": " data = subscribe_once(TOPIC_NAME, PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:For_L82_C4", "label": "for i", "type": "for", "loc": [82, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:If_L77_C0", "vector": [6, 1, 0.9222, 0.0333, 1, 0.88, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n pt = data.points[i]\n print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L83_C8", "label": "pt =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:For_L82_C4", "vector": [14, 2, 0.9222, 0.0111, 2, 0.85, 0.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = data.points[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L84_C8", "label": "print()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99239:For_L82_C4", "vector": [8, 2, 0.9333, 0.0111, 2, 0.85, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:While_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:While_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Return_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:If_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:If_L77_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:For_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:For_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99239:For_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99239:Expr_L84_C8"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
"""
Grab data from topic <given> of generic <type>.
"""
import roslib; roslib.load_manifest('pr2_clutter_helper')
#depnds on sensor_msgs, opencv2, cv_bridge
import rospy
from sensor_msgs.msg import PointCloud
import cv #version 2.1 expected
from cv_bridge import CvBridge
#may need image_transport?
import time #sleep
from random import * #randint
TOPIC_NAME = "tilt_laser_cloud"
global_ros_data = None
NODE_NAME = 'my_listener'
'''
Comments:
Traps exactly one message from the topic specified. This is
To run 'main', this assumes the launch of "pr2_laser_snapshotter" with mapping to "tilt_laser_cloud"
Basic use is to import and call "subscribe_once" method.
'''
def init(node_name = NODE_NAME):
rospy.init_node(node_name, anonymous=True)
def myCallback(data):
print 'callback called'
global global_ros_data
global_ros_data = data
##def listener():
## rospy.init_node('my_listener', anonymous=True)
## rospy.Subscriber("tilt_laser_cloud", PointCloud, cloudCallback)
## rospy.spin()
def subscribe_once(topic_name=TOPIC_NAME, msg_type=PointCloud):
init()
#if not something, init.
s = rospy.Subscriber(topic_name, msg_type, myCallback)
#spin until 1 message is received.
print 'sleeping now: waitin for topic', topic_name
while (not global_ros_data):
rospy.sleep(.1)
if rospy.is_shutdown(): #catch a CTRL-C
print '\n Forcing exit'
return False; #check for 'false' on output to catch error results.
print 'waking and exiting now'
s.unregister()
global global_ros_data
return global_ros_data #value will be returned as 'global_ros_data'
if __name__ == 'main':
data = subscribe_once(TOPIC_NAME, PointCloud)
#assume global_ros_data is defined.
#do something with the pointcloud
for i in range(10):
pt = data.points[i]
print "(%f, %f, %f)" %(pt.x, pt.y, pt.z)
| ajibawa-2023/Python-Code-Large/train/row_99240 | 35 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L32_C0", "label": "expression", "type": "expression", "loc": [32, 34], "level": 0, "parent": null, "vector": [8, 0, 0.3367, 0.0306, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nGrab data from topic <given> of generic <type>.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Import_L35_C0", "label": "roslib import roslib", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3571, 0.0102, 0, 0.66, 0.0625, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L35_C15", "label": "load_manifest()", "type": "expression", "loc": [35, 35], "level": 0, "parent": null, "vector": [8, 0, 0.3571, 0.0102, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Import_L37_C0", "label": "rospy import rospy", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.3776, 0.0102, 0, 0.66, 0.1875, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:ImportFrom_L38_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.3878, 0.0102, 0, 0.66, 0.25, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Import_L39_C0", "label": "cv import cv", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.398, 0.0102, 0, 0.66, 0.3125, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv #version 2.1 expected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:ImportFrom_L40_C0", "label": "from cv_bridge import CvBridge", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.4082, 0.0102, 0, 0.66, 0.375, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge import CvBridge"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Import_L43_C0", "label": "time import time", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.4388, 0.0102, 0, 0.66, 0.4375, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time #sleep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:ImportFrom_L44_C0", "label": "from random import *", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.449, 0.0102, 0, 0.66, 0.5, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import * #randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L46_C0", "label": "TOPIC_NAME =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.4694, 0.0102, 0, 0.66, 0.5625, 355, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TOPIC_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TOPIC_NAME = \"tilt_laser_cloud\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L47_C0", "label": "global_ros_data =", "type": "assigned_variable", "loc": [47, 47], "level": 0, "parent": null, "vector": [14, 0, 0.4796, 0.0102, 0, 0.66, 0.625, 296, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "global_ros_data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L48_C0", "label": "NODE_NAME =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.4898, 0.0102, 0, 0.66, 0.6875, 738, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "NODE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NODE_NAME = 'my_listener'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L49_C0", "label": "expression", "type": "expression", "loc": [49, 54], "level": 0, "parent": null, "vector": [8, 0, 0.5255, 0.0612, 0, 0.66, 0.75, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n Comments:\n Traps exactly one message from the topic specified. This is \n To run 'main', this assumes the launch of \"pr2_laser_snapshotter\" with mapping to \"tilt_laser_cloud\"\n Basic use is to import and call \"subscribe_once\" method.\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L56_C0", "label": "init", "type": "function", "loc": [56, 57], "level": 0, "parent": null, "vector": [2, 0, 0.5765, 0.0204, 0, 0.66, 0.8125, 319, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": ["node_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init(node_name = NODE_NAME):\n rospy.init_node(node_name, anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L57_C4", "label": "init_node()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L56_C0", "vector": [8, 1, 0.5816, 0.0102, 1, 0.62, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(node_name, anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L59_C0", "label": "myCallback", "type": "function", "loc": [59, 62], "level": 0, "parent": null, "vector": [2, 0, 0.6173, 0.0408, 0, 0.66, 0.875, 380, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "myCallback", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def myCallback(data):\n print('callback called')\n global global_ros_data\n global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L60_C4", "label": "print()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L59_C0", "vector": [8, 1, 0.6122, 0.0102, 1, 0.43, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('callback called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L62_C4", "label": "global_ros_data =", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L59_C0", "vector": [14, 1, 0.6327, 0.0102, 1, 0.43, 1.0, 296, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "label": "subscribe_once", "type": "function", "loc": [69, 83], "level": 0, "parent": null, "vector": [2, 0, 0.7755, 0.1531, 0, 0.66, 0.9375, 902, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "subscribe_once", "arg_names": ["topic_name", "msg_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subscribe_once(topic_name=TOPIC_NAME, msg_type=PointCloud):\n init()\n #if not something, init.\n s = rospy.Subscriber(topic_name, msg_type, myCallback)\n #spin until 1 message is received.\n print('sleeping now: waitin for topic', topic_name)\n while (not global_ros_data):\n rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L70_C4", "label": "init()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [8, 1, 0.7143, 0.0102, 1, 0.31, 0.0, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init", "arg_names": [], "import_names": [], "rhs_call_name": "init", "annotation": ""}, "snippet": " init()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L72_C4", "label": "s = Subscriber()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [14, 1, 0.7347, 0.0102, 1, 0.31, 0.1667, 553, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " s = rospy.Subscriber(topic_name, msg_type, myCallback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L74_C4", "label": "print()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [8, 1, 0.7551, 0.0102, 1, 0.31, 0.3333, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('sleeping now: waitin for topic', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:While_L75_C4", "label": "while", "type": "while", "loc": [75, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [5, 1, 0.7857, 0.051, 1, 0.31, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (not global_ros_data):\n rospy.sleep(.1)\n if rospy.is_shutdown(): #catch a CTRL-C\n print('\\n Forcing exit')\n return False; #check for 'false' on output to catch error results."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L76_C8", "label": "sleep()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:While_L75_C4", "vector": [8, 2, 0.7755, 0.0102, 2, 0.69, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L77_C8", "label": "if", "type": "if", "loc": [77, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:While_L75_C4", "vector": [4, 2, 0.7959, 0.0306, 2, 0.69, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown(): #catch a CTRL-C\n print('\\n Forcing exit')\n return False; #check for 'false' on output to catch error results."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L78_C12", "label": "print()", "type": "expression", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L77_C8", "vector": [8, 3, 0.7959, 0.0102, 3, 0.63, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('\\n Forcing exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Return_L79_C12", "label": "return", "type": "return", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L77_C8", "vector": [13, 3, 0.8061, 0.0102, 3, 0.63, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False; #check for 'false' on output to catch error results."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L80_C4", "label": "print()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [8, 1, 0.8163, 0.0102, 1, 0.31, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waking and exiting now')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L81_C4", "label": "unregister()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [8, 1, 0.8265, 0.0102, 1, 0.31, 0.8333, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " s.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "vector": [13, 1, 0.8469, 0.0102, 1, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return global_ros_data #value will be returned as 'global_ros_data'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L85_C0", "label": "if", "type": "if", "loc": [85, 92], "level": 0, "parent": null, "vector": [4, 0, 0.9031, 0.0816, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == 'main':\n data = subscribe_once(TOPIC_NAME, PointCloud)\n \n #assume global_ros_data is defined.\n #do something with the pointcloud\n for i in range(10):\n pt = data.points[i]\n print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L86_C4", "label": "data = subscribe_once()", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L85_C0", "vector": [14, 1, 0.8776, 0.0102, 1, 0.29, 0.0, 929, 3, 2, 0, 0, 902, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_once", "annotation": ""}, "snippet": " data = subscribe_once(TOPIC_NAME, PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:For_L90_C4", "label": "for i", "type": "for", "loc": [90, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L85_C0", "vector": [6, 1, 0.9286, 0.0306, 1, 0.29, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n pt = data.points[i]\n print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L91_C8", "label": "pt =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:For_L90_C4", "vector": [14, 2, 0.9286, 0.0102, 2, 0.64, 0.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = data.points[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L92_C8", "label": "print()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99240:For_L90_C4", "vector": [8, 2, 0.9388, 0.0102, 2, 0.64, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:While_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:While_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:While_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Return_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:For_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99240:For_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99240:Expr_L92_C8"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
import roslib; roslib.load_manifest('pr2_clutter_helper')
from sensor_msgs.msg import CameraInfo
import sys
import rospy
from pr2_lcs_helper.srv import * #Get four .srv definitions
''' Usage: topic_name = None for default topic (listed in launch file), or
a string refering to ROS topic; msg_type is string refering to
returned msg type; and srv_type is a srv object (not string) generally
named 'Get'+msg_type
This client should be run to demonstrate success of the get_msg_server.py service.
'''
def get_single_msg(topic_name, msg_type, srv_type):
service_name = 'get_'+msg_type
rospy.wait_for_service(service_name)
try:
get_one_msg = rospy.ServiceProxy(service_name, srv_type)
return get_one_msg(topic_name, msg_type)
except:
print 'Failed to acquire message from topic', topic_name
return None
def create_cam_model( info_msg):
from image_geometry import PinholeCameraModel
import numpy as np
cam_model = PinholeCameraModel()
# <have an info message >
cam_model.fromCameraInfo(info_msg)
print 'cam_model = ', np.array( cam_model.intrinsicMatrix() )
print 'cam tf = ', cam_model.tfFrame()
return cam_model
def grab_tf(child_id = '/wide_stereo_optical_frame', frame_id = '/base_footprint'):
#hopefully unused
topic = 'tf'
tf_msg = None
#tf publishes tfMessage which is a container holding a TransformStamped
n=0
# < grab tf messages until correct one is fetched >
while not tf_msg:
print 'try #', n; n+=1
resp = get_single_msg(topic, 'tfMessage', GettfMessage)
tf_msg = resp.transform
if tf_msg.header.frame_id == frame_id and tf_msg.child_frame_id==child_id:
break;
else: tf_msg = None
print 'Got a tf', tf_msg, tf_msg.child_frame_id
return tf_msg
def usage():
return "%s [x y]"%sys.argv[0]
if __name__ == "__main__":
topic = '/wide_stereo/right/camera_info'
resp = get_single_msg(topic, 'CameraInfo', GetCameraInfo)
info_msg = resp.info
topic = '/wide_stereo/right/image_rect_color'
resp = get_single_msg(topic, 'Image', GetImage)
image_msg = resp.image
print 'got image with h=', image_msg.height
topic = '/wide_stereo/right/image_rect_color'
resp = get_single_msg(topic, 'Image', GetImage)
image_msg = resp.image
print "creating_cam_model"
cam_model = create_cam_model(info_msg)
print "Done ; next is to write transform"
#---------------------------------------------
'''
frame_id = 'base_footprint'
acquisition_time = info_msg.header.stamp #type is ros.Time
timeout = rospy.Duration(10) #at most wait 5 seconds
do_some_tf():
cam_frame = '/wide_stereo_optical_frame' #cam_model.tfFrame()
other_frame = '/base_footprint'
print "cam model frame :", cam_model.tfFrame()
import tf
# <frame1 to frame2, time, timeout >
try:
rospy.init_node('client_calling_tf')
print 'make listener'
tf_listener = tf.TransformListener()
print 'wait'
latest = rospy.Time(0) #hack -- actually want time synchronized.
#tf_listener.waitForTransform(cam_frame, other_frame, acquisition_time, timeout);
#(trans,rot)
print 'get tf now'
print 'skipping transform'
#transform = tf_listener.lookupTransform(cam_frame, other_frame);
except:
print "[get] TF exception: "
return
print "the transform is ", transform
return transform
do_some_tf()
print "tf done"
'''
| ajibawa-2023/Python-Code-Large/train/row_99241 | 51 | 147 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.2041, 0.0068, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.2041, 0.0068, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:ImportFrom_L31_C0", "label": "from sensor_msgs.msg import CameraInfo", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2109, 0.0068, 0, 0.66, 0.1667, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Import_L33_C0", "label": "sys import sys", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.2245, 0.0068, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Import_L35_C0", "label": "rospy import rospy", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2381, 0.0068, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:ImportFrom_L36_C0", "label": "from pr2_lcs_helper.srv import *", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2449, 0.0068, 0, 0.66, 0.4167, 364, 0, 1, 0, 0, 364, 0, 0], "semantic": {"name": "pr2_lcs_helper.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_lcs_helper.srv import * #Get four .srv definitions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L38_C0", "label": "expression", "type": "expression", "loc": [38, 44], "level": 0, "parent": null, "vector": [8, 0, 0.2789, 0.0476, 0, 0.66, 0.5, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "''' Usage: topic_name = None for default topic (listed in launch file), or \n a string refering to ROS topic; msg_type is string refering to \n returned msg type; and srv_type is a srv object (not string) generally\n named 'Get'+msg_type\n This client should be run to demonstrate success of the get_msg_server.py service.\n \n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "label": "get_single_msg", "type": "function", "loc": [45, 53], "level": 0, "parent": null, "vector": [2, 0, 0.3333, 0.0612, 0, 0.66, 0.5833, 145, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "get_single_msg", "arg_names": ["topic_name", "msg_type", "srv_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_single_msg(topic_name, msg_type, srv_type):\n service_name = 'get_'+msg_type\n rospy.wait_for_service(service_name)\n try:\n get_one_msg = rospy.ServiceProxy(service_name, srv_type)\n return get_one_msg(topic_name, msg_type)\n except:\n print('Failed to acquire message from topic', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L46_C4", "label": "service_name =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "vector": [14, 1, 0.3129, 0.0068, 1, 0.99, 0.0, 649, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "service_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_name = 'get_'+msg_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L47_C4", "label": "wait_for_service()", "type": "expression", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "vector": [8, 1, 0.3197, 0.0068, 1, 0.99, 0.5, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service(service_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "label": "try", "type": "try", "loc": [48, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "vector": [7, 1, 0.3435, 0.0408, 1, 0.99, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n get_one_msg = rospy.ServiceProxy(service_name, srv_type)\n return get_one_msg(topic_name, msg_type)\n except:\n print('Failed to acquire message from topic', topic_name)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L49_C8", "label": "get_one_msg = ServiceProxy()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "vector": [14, 2, 0.3333, 0.0068, 2, 0.12, 0.0, 709, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "get_one_msg", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " get_one_msg = rospy.ServiceProxy(service_name, srv_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "vector": [13, 2, 0.3401, 0.0068, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_one_msg(topic_name, msg_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L52_C8", "label": "print()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "vector": [8, 2, 0.3537, 0.0068, 2, 0.12, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Failed to acquire message from topic', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "vector": [13, 2, 0.3605, 0.0068, 2, 0.12, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "label": "create_cam_model", "type": "function", "loc": [55, 64], "level": 0, "parent": null, "vector": [2, 0, 0.4048, 0.068, 0, 0.66, 0.6667, 454, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "create_cam_model", "arg_names": ["info_msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_cam_model( info_msg):\n from image_geometry import PinholeCameraModel\n import numpy as np\n cam_model = PinholeCameraModel()\n \n # <have an info message > \n cam_model.fromCameraInfo(info_msg)\n print('cam_model = ', np.array( cam_model.intrinsicMatrix() ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:ImportFrom_L56_C4", "label": "from image_geometry import PinholeCameraModel", "type": "import", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [1, 1, 0.381, 0.0068, 1, 0.18, 0.0, 313, 0, 1, 0, 0, 313, 0, 0], "semantic": {"name": "image_geometry", "arg_names": [], "import_names": ["PinholeCameraModel"], "rhs_call_name": "", "annotation": ""}, "snippet": " from image_geometry import PinholeCameraModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Import_L57_C4", "label": "numpy import np", "type": "import", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [1, 1, 0.3878, 0.0068, 1, 0.18, 0.1667, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": " import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L58_C4", "label": "cam_model = PinholeCameraModel()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [14, 1, 0.3946, 0.0068, 1, 0.18, 0.3333, 669, 3, 0, 0, 0, 625, 10, 1], "semantic": {"name": "cam_model", "arg_names": [], "import_names": [], "rhs_call_name": "PinholeCameraModel", "annotation": ""}, "snippet": " cam_model = PinholeCameraModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L61_C4", "label": "fromCameraInfo()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [8, 1, 0.415, 0.0068, 1, 0.18, 0.5, 849, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fromCameraInfo", "arg_names": [], "import_names": [], "rhs_call_name": "fromCameraInfo", "annotation": ""}, "snippet": " cam_model.fromCameraInfo(info_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L62_C4", "label": "print()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [8, 1, 0.4218, 0.0068, 1, 0.18, 0.6667, 535, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cam_model = ', np.array( cam_model.intrinsicMatrix() ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L63_C4", "label": "print()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [8, 1, 0.4286, 0.0068, 1, 0.18, 0.8333, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('cam tf = ', cam_model.tfFrame())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L64_C4", "label": "return", "type": "return", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "vector": [13, 1, 0.4354, 0.0068, 1, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cam_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "label": "grab_tf", "type": "function", "loc": [66, 80], "level": 0, "parent": null, "vector": [2, 0, 0.4966, 0.102, 0, 0.66, 0.75, 557, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "grab_tf", "arg_names": ["child_id", "frame_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def grab_tf(child_id = '/wide_stereo_optical_frame', frame_id = '/base_footprint'):\n #hopefully unused \n topic = 'tf'\n tf_msg = None\n #tf publishes tfMessage which is a container holding a TransformStamped\n n=0\n # < grab tf messages until correct one is fetched >\n while not tf_msg:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L68_C4", "label": "topic =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "vector": [14, 1, 0.4626, 0.0068, 1, 0.75, 0.0, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = 'tf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L69_C4", "label": "tf_msg =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "vector": [14, 1, 0.4694, 0.0068, 1, 0.75, 0.2, 302, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "tf_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tf_msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L71_C4", "label": "n =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "vector": [14, 1, 0.483, 0.0068, 1, 0.75, 0.4, 773, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "n", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n=0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "label": "while", "type": "while", "loc": [73, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "vector": [5, 1, 0.5136, 0.0408, 1, 0.75, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not tf_msg:\n resp = get_single_msg(topic, 'tfMessage', GettfMessage) \n tf_msg = resp.transform\n if tf_msg.header.frame_id == frame_id and tf_msg.child_frame_id==child_id:\n break;\n else: tf_msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L74_C8", "label": "resp = get_single_msg()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "vector": [14, 2, 0.5034, 0.0068, 2, 0.09, 0.0, 48, 3, 3, 0, 0, 145, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "get_single_msg", "annotation": ""}, "snippet": " resp = get_single_msg(topic, 'tfMessage', GettfMessage) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L75_C8", "label": "tf_msg =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "vector": [14, 2, 0.5102, 0.0068, 2, 0.09, 0.5, 302, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tf_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tf_msg = resp.transform"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L76_C8", "label": "if", "type": "if", "loc": [76, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "vector": [4, 2, 0.5238, 0.0204, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tf_msg.header.frame_id == frame_id and tf_msg.child_frame_id==child_id:\n break;\n else: tf_msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L78_C14", "label": "tf_msg =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L76_C8", "vector": [14, 3, 0.5306, 0.0068, 3, 0.09, 0.0, 302, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "tf_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " else: tf_msg = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L79_C4", "label": "print()", "type": "expression", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "vector": [8, 1, 0.5374, 0.0068, 1, 0.75, 0.8, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Got a tf', tf_msg, tf_msg.child_frame_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "vector": [13, 1, 0.5442, 0.0068, 1, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tf_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L82_C0", "label": "usage", "type": "function", "loc": [82, 83], "level": 0, "parent": null, "vector": [2, 0, 0.5612, 0.0136, 0, 0.66, 0.8333, 129, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "usage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def usage():\n return \"%s [x y]\"%sys.argv[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L82_C0", "vector": [13, 1, 0.5646, 0.0068, 1, 0.66, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"%s [x y]\"%sys.argv[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "label": "if", "type": "if", "loc": [85, 102], "level": 0, "parent": null, "vector": [4, 0, 0.6361, 0.1224, 0, 0.66, 0.9167, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n topic = '/wide_stereo/right/camera_info'\n resp = get_single_msg(topic, 'CameraInfo', GetCameraInfo) \n info_msg = resp.info\n \n topic = '/wide_stereo/right/image_rect_color'\n resp = get_single_msg(topic, 'Image', GetImage) \n image_msg = resp.image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L86_C4", "label": "topic =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.585, 0.0068, 1, 0.19, 0.0, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = '/wide_stereo/right/camera_info'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L87_C4", "label": "resp = get_single_msg()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.5918, 0.0068, 1, 0.19, 0.0833, 48, 3, 3, 0, 0, 145, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "get_single_msg", "annotation": ""}, "snippet": " resp = get_single_msg(topic, 'CameraInfo', GetCameraInfo) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L88_C4", "label": "info_msg =", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.5986, 0.0068, 1, 0.19, 0.1667, 77, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "info_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " info_msg = resp.info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L90_C4", "label": "topic =", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.6122, 0.0068, 1, 0.19, 0.25, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = '/wide_stereo/right/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L91_C4", "label": "resp = get_single_msg()", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.619, 0.0068, 1, 0.19, 0.3333, 48, 3, 3, 0, 0, 145, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "get_single_msg", "annotation": ""}, "snippet": " resp = get_single_msg(topic, 'Image', GetImage) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L92_C4", "label": "image_msg =", "type": "assigned_variable", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.6259, 0.0068, 1, 0.19, 0.4167, 135, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "image_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " image_msg = resp.image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L93_C4", "label": "print()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [8, 1, 0.6327, 0.0068, 1, 0.19, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('got image with h=', image_msg.height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L95_C4", "label": "topic =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.6463, 0.0068, 1, 0.19, 0.5833, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic = '/wide_stereo/right/image_rect_color'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L96_C4", "label": "resp = get_single_msg()", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.6531, 0.0068, 1, 0.19, 0.6667, 48, 3, 3, 0, 0, 145, 10, 1], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "get_single_msg", "annotation": ""}, "snippet": " resp = get_single_msg(topic, 'Image', GetImage) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L97_C4", "label": "image_msg =", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.6599, 0.0068, 1, 0.19, 0.75, 135, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "image_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " image_msg = resp.image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L99_C4", "label": "print()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [8, 1, 0.6735, 0.0068, 1, 0.19, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"creating_cam_model\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L100_C4", "label": "cam_model = create_cam_model()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [14, 1, 0.6803, 0.0068, 1, 0.19, 0.9167, 669, 3, 1, 0, 0, 454, 10, 1], "semantic": {"name": "cam_model", "arg_names": [], "import_names": [], "rhs_call_name": "create_cam_model", "annotation": ""}, "snippet": " cam_model = create_cam_model(info_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L102_C4", "label": "print()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "vector": [8, 1, 0.6939, 0.0068, 1, 0.19, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Done ; next is to write transform\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L110_C0", "label": "expression", "type": "expression", "loc": [110, 140], "level": 0, "parent": null, "vector": [8, 0, 0.8503, 0.2109, 0, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n frame_id = 'base_footprint'\n acquisition_time = info_msg.header.stamp #type is ros.Time\n timeout = rospy.Duration(10) #at most wait 5 seconds\n\n do_some_tf():\n cam_frame = '/wide_stereo_optical_frame' #cam_model.tfFrame()\n other_frame = '/base_footprint'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:Try_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:ImportFrom_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Import_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:While_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L78_C14"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99241:If_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99241:Expr_L102_C4"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
import roslib; roslib.load_manifest('pr2_clutter_helper')
#depnds on sensor_msgs, opencv2, cv_bridge
import rospy
from sensor_msgs.msg import PointCloud
import cv #version 2.1 expected
from cv_bridge import CvBridge
#may need image_transport?
import time #sleep
from random import * #randint
TOPIC_NAME = "tilt_laser_cloud"
global_ros_data = None
'''
Comments:
traps exactly one message from the topic specified. This is
assumes the launch of "pr2_laser_snapshotter" with mapping to "tilt_laser_cloud"
'''
def myCallback(data):
print 'callback called'
global global_ros_data
global_ros_data = data
##def listener():
## rospy.init_node('my_listener', anonymous=True)
## rospy.Subscriber("tilt_laser_cloud", PointCloud, cloudCallback)
## rospy.spin()
def subscribe_once(topic_name=TOPIC_NAME, msg_type=PointCloud):
rospy.init_node('my_listener', anonymous=True)
s = rospy.Subscriber(topic_name, msg_type, myCallback)
#spin until 1 message is received.
print 'sleeping now'
while (not global_ros_image):
rospy.sleep(.1)
print 'waking and exiting now'
s.unregister()
return #value will be returned as 'global_ros_data'
if __name__ == 'main':
subscribe_once(TOPIC_NAME, PointCloud)
#assume global_ros_data is defined.
#do something with the pointcloud
for i in range(10):
pt = global_ros.points[i]
print "(%f, %f, %f)" %(pt.x, pt.y, pt.z)
| ajibawa-2023/Python-Code-Large/train/row_99242 | 28 | 83 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.3614, 0.012, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.3614, 0.012, 0, 0.66, 0.0769, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Import_L32_C0", "label": "rospy import rospy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3855, 0.012, 0, 0.66, 0.1538, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:ImportFrom_L33_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.3976, 0.012, 0, 0.66, 0.2308, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Import_L34_C0", "label": "cv import cv", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.4096, 0.012, 0, 0.66, 0.3077, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv #version 2.1 expected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:ImportFrom_L35_C0", "label": "from cv_bridge import CvBridge", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.4217, 0.012, 0, 0.66, 0.3846, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge import CvBridge"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Import_L38_C0", "label": "time import time", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.4578, 0.012, 0, 0.66, 0.4615, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time #sleep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:ImportFrom_L39_C0", "label": "from random import *", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4699, 0.012, 0, 0.66, 0.5385, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import * #randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L41_C0", "label": "TOPIC_NAME =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.494, 0.012, 0, 0.66, 0.6154, 355, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TOPIC_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TOPIC_NAME = \"tilt_laser_cloud\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L42_C0", "label": "global_ros_data =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.506, 0.012, 0, 0.66, 0.6923, 296, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "global_ros_data = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L43_C0", "label": "expression", "type": "expression", "loc": [43, 47], "level": 0, "parent": null, "vector": [8, 0, 0.5422, 0.0602, 0, 0.66, 0.7692, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n Comments:\n traps exactly one message from the topic specified. This is \n assumes the launch of \"pr2_laser_snapshotter\" with mapping to \"tilt_laser_cloud\"\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L49_C0", "label": "myCallback", "type": "function", "loc": [49, 52], "level": 0, "parent": null, "vector": [2, 0, 0.6084, 0.0482, 0, 0.66, 0.8462, 380, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "myCallback", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def myCallback(data):\n print('callback called')\n global global_ros_data\n global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L50_C4", "label": "print()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L49_C0", "vector": [8, 1, 0.6024, 0.012, 1, 0.66, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('callback called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L52_C4", "label": "global_ros_data =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L49_C0", "vector": [14, 1, 0.6265, 0.012, 1, 0.66, 1.0, 296, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "label": "subscribe_once", "type": "function", "loc": [59, 68], "level": 0, "parent": null, "vector": [2, 0, 0.7651, 0.1205, 0, 0.66, 0.9231, 902, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "subscribe_once", "arg_names": ["topic_name", "msg_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subscribe_once(topic_name=TOPIC_NAME, msg_type=PointCloud):\n rospy.init_node('my_listener', anonymous=True)\n s = rospy.Subscriber(topic_name, msg_type, myCallback)\n #spin until 1 message is received.\n print('sleeping now')\n while (not global_ros_image):\n rospy.sleep(.1)\n print('waking and exiting now')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L60_C4", "label": "init_node()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [8, 1, 0.7229, 0.012, 1, 0.67, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('my_listener', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L61_C4", "label": "s = Subscriber()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [14, 1, 0.7349, 0.012, 1, 0.67, 0.1667, 553, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " s = rospy.Subscriber(topic_name, msg_type, myCallback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L63_C4", "label": "print()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [8, 1, 0.759, 0.012, 1, 0.67, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('sleeping now')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:While_L64_C4", "label": "while", "type": "while", "loc": [64, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [5, 1, 0.7771, 0.0241, 1, 0.67, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (not global_ros_image):\n rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L65_C8", "label": "sleep()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:While_L64_C4", "vector": [8, 2, 0.7831, 0.012, 2, 0.91, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L66_C4", "label": "print()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [8, 1, 0.7952, 0.012, 1, 0.67, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waking and exiting now')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L67_C4", "label": "unregister()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [8, 1, 0.8072, 0.012, 1, 0.67, 0.8333, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " s.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Return_L68_C4", "label": "return", "type": "return", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "vector": [13, 1, 0.8193, 0.012, 1, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return #value will be returned as 'global_ros_data'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:If_L70_C0", "label": "if", "type": "if", "loc": [70, 77], "level": 0, "parent": null, "vector": [4, 0, 0.8855, 0.0964, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == 'main':\n subscribe_once(TOPIC_NAME, PointCloud)\n \n #assume global_ros_data is defined.\n #do something with the pointcloud\n for i in range(10):\n pt = global_ros.points[i]\n print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L71_C4", "label": "subscribe_once()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:If_L70_C0", "vector": [8, 1, 0.8554, 0.012, 1, 0.59, 0.0, 902, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "subscribe_once", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_once", "annotation": ""}, "snippet": " subscribe_once(TOPIC_NAME, PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:For_L75_C4", "label": "for i", "type": "for", "loc": [75, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:If_L70_C0", "vector": [6, 1, 0.9157, 0.0361, 1, 0.59, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n pt = global_ros.points[i]\n print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L76_C8", "label": "pt =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:For_L75_C4", "vector": [14, 2, 0.9157, 0.012, 2, 0.04, 0.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = global_ros.points[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L77_C8", "label": "print()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99242:For_L75_C4", "vector": [8, 2, 0.9277, 0.012, 2, 0.04, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"(%f, %f, %f)\" %(pt.x, pt.y, pt.z))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:While_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:While_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Return_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:If_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:For_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:For_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99242:For_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99242:Expr_L77_C8"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
import roslib; roslib.load_manifest('pr2_clutter_helper')
from pr2_lcs_helper.srv import *
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import PointCloud
from sensor_msgs.msg import ChannelFloat32
from geometry_msgs.msg import Point32
'''
This function publishes a sensor_msgs.msg.PointCloud object for rviz
It doesn't import anything but generates points in a rectangular region and
lets this region move accross the screen over time.
The frame is '/my_frame', so rviz view frame must be changed accordingly.
NOT FINISHED YET, have not tested -- hope to soon!
'''
pub=''
def handle_service_request(req):
#<generate data to send in this function>
cloud = req.cloud
try:
#cloud = local_rand_cloud()
#cloud.header.frame_id = '/my_frame'
#cloud.header.stamp = rospy.Time.now()
print 'sending cloud at time', cloud.header.stamp, '&', rospy.Time.now()
global pub
pub.publish(cloud)
return True
except:
return False
def start_server():
rospy.init_node('cloud_broadcaster_node')
s = rospy.Service('pub_cloud_service', CloudPub, handle_service_request)
print "Ready to publish cloud"
global pub
pub = start_publisher()
rospy.spin()
#rospy.sleep(.5) #possibly publish periodically
def start_publisher():
#global pub
pub = rospy.Publisher('my_cloud_chatter', PointCloud)
#rospy.init_node('point_cloud_broadcaster')
## while not rospy.is_shutdown():
#cloud = local_rand_cloud()
#cloud.header.frame_id = '/my_frame'
#cloud.header.stamp = rospy.Time.now()
#print 'NOT YET sending cloud at time', cloud.header.stamp
#pub.publish(cloud)
## rospy.sleep(1) #one second
return pub
if __name__ == '__main__':
try:
# talker()
start_server()
except rospy.ROSInterruptException: pass
'''
def local_rand_cloud()
### Create a new cloud object and stuff it
from random import *
ROS_pointcloud = PointCloud() #sensor_msgs.msg.PointCloud()
x = 0 #const offset easy to change.
#stuff point cloud with random points in a rectangle which drifts over time.
#Add an extra intensity channel as well.
intensity_channel = ChannelFloat32()
intensity_channel.name = 'intensities'
for i in range(3000):
intensity_channel.values += [random()]
for i in range(3000):
ROS_pointcloud.points += [Point32(random()*5-x,random(), intensity_channel.values[i])]
#rgb color has maximum value of 0xFFFFFF
rgb_channel = ChannelFloat32()
rgb_channel.name = 'rgb'
rgb_channel.values = normList(intensity_channel.values, 0xFF)
#Separate r,g,b channels range betweeon 0 and 1.0.
r, g, b = [], [], []
for pt in ROS_pointcloud.points:
b += [pt.y];
r += [pt.z];
g += [0];
r_channel = ChannelFloat32(name='r', values = normList(r) )
g_channel = ChannelFloat32(name='g', values = normList(g) )
b_channel = ChannelFloat32(name='b', values = b)
ROS_pointcloud.channels = (intensity_channel, rgb_channel, r_channel, g_channel, b_channel)
return ROS_pointcloud
def normList(L, normalizeTo=1):
### normalize values of a list to make its max = normalizeTo
vMax = max(L)
if vMax == 0: vMax = 1; #avoid divide by zero
return [ x/(vMax*1.0)*normalizeTo for x in L]
'''
| ajibawa-2023/Python-Code-Large/train/row_99243 | 30 | 146 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Import_L31_C0", "label": "roslib import roslib", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.2123, 0.0068, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L31_C15", "label": "load_manifest()", "type": "expression", "loc": [31, 31], "level": 0, "parent": null, "vector": [8, 0, 0.2123, 0.0068, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:ImportFrom_L32_C0", "label": "from pr2_lcs_helper.srv import *", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.2192, 0.0068, 0, 0.66, 0.1429, 364, 0, 1, 0, 0, 364, 0, 0], "semantic": {"name": "pr2_lcs_helper.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_lcs_helper.srv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Import_L33_C0", "label": "rospy import rospy", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.226, 0.0068, 0, 0.66, 0.2143, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:ImportFrom_L34_C0", "label": "from std_msgs.msg import String", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2329, 0.0068, 0, 0.66, 0.2857, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["String"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import String"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:ImportFrom_L35_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2397, 0.0068, 0, 0.66, 0.3571, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:ImportFrom_L36_C0", "label": "from sensor_msgs.msg import ChannelFloat32", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2466, 0.0068, 0, 0.66, 0.4286, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["ChannelFloat32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import ChannelFloat32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:ImportFrom_L37_C0", "label": "from geometry_msgs.msg import Point32", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.2534, 0.0068, 0, 0.66, 0.5, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point32"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point32"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L39_C0", "label": "expression", "type": "expression", "loc": [39, 48], "level": 0, "parent": null, "vector": [8, 0, 0.2979, 0.0685, 0, 0.66, 0.5714, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n This function publishes a sensor_msgs.msg.PointCloud object for rviz\n It doesn't import anything but generates points in a rectangular region and \n lets this region move accross the screen over time. \n\n The frame is '/my_frame', so rviz view frame must be changed accordingly.\n \n NOT FINISHED YET, have not tested -- hope to soon!"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L50_C0", "label": "pub =", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.3425, 0.0068, 0, 0.66, 0.6429, 41, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pub=''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L52_C0", "label": "handle_service_request", "type": "function", "loc": [52, 64], "level": 0, "parent": null, "vector": [2, 0, 0.3973, 0.089, 0, 0.66, 0.7143, 787, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "handle_service_request", "arg_names": ["req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def handle_service_request(req):\n #<generate data to send in this function> \n cloud = req.cloud\n try:\n #cloud = local_rand_cloud()\n #cloud.header.frame_id = '/my_frame'\n #cloud.header.stamp = rospy.Time.now()\n print('sending cloud at time', cloud.header.stamp, '&', rospy.Time.now())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L54_C4", "label": "cloud =", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L52_C0", "vector": [14, 1, 0.3699, 0.0068, 1, 0.26, 0.0, 824, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cloud", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cloud = req.cloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "label": "try", "type": "try", "loc": [55, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L52_C0", "vector": [7, 1, 0.4075, 0.0685, 1, 0.26, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n #cloud = local_rand_cloud()\n #cloud.header.frame_id = '/my_frame'\n #cloud.header.stamp = rospy.Time.now()\n print('sending cloud at time', cloud.header.stamp, '&', rospy.Time.now())\n global pub\n pub.publish(cloud)\n return True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L59_C8", "label": "print()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "vector": [8, 2, 0.4041, 0.0068, 2, 0.23, 0.0, 535, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('sending cloud at time', cloud.header.stamp, '&', rospy.Time.now())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L61_C8", "label": "publish()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "vector": [8, 2, 0.4178, 0.0068, 2, 0.23, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish(cloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Return_L62_C8", "label": "return", "type": "return", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "vector": [13, 2, 0.4247, 0.0068, 2, 0.23, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "vector": [13, 2, 0.4384, 0.0068, 2, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "label": "start_server", "type": "function", "loc": [67, 75], "level": 0, "parent": null, "vector": [2, 0, 0.4863, 0.0616, 0, 0.66, 0.7857, 397, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "start_server", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_server():\n rospy.init_node('cloud_broadcaster_node')\n s = rospy.Service('pub_cloud_service', CloudPub, handle_service_request)\n print(\"Ready to publish cloud\")\n \n global pub\n pub = start_publisher()\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L68_C4", "label": "init_node()", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "vector": [8, 1, 0.4658, 0.0068, 1, 0.7, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('cloud_broadcaster_node')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L69_C4", "label": "s = Service()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "vector": [14, 1, 0.4726, 0.0068, 1, 0.7, 0.25, 553, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " s = rospy.Service('pub_cloud_service', CloudPub, handle_service_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L70_C4", "label": "print()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "vector": [8, 1, 0.4795, 0.0068, 1, 0.7, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Ready to publish cloud\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L73_C4", "label": "pub = start_publisher()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "vector": [14, 1, 0.5, 0.0068, 1, 0.7, 0.75, 41, 3, 0, 0, 0, 377, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "start_publisher", "annotation": ""}, "snippet": " pub = start_publisher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L75_C4", "label": "spin()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "vector": [8, 1, 0.5137, 0.0068, 1, 0.7, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L79_C0", "label": "start_publisher", "type": "function", "loc": [79, 92], "level": 0, "parent": null, "vector": [2, 0, 0.5856, 0.0959, 0, 0.66, 0.8571, 377, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "start_publisher", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def start_publisher():\n #global pub\n pub = rospy.Publisher('my_cloud_chatter', PointCloud)\n #rospy.init_node('point_cloud_broadcaster')\n ## while not rospy.is_shutdown():\n \n #cloud = local_rand_cloud()\n #cloud.header.frame_id = '/my_frame'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L81_C4", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L79_C0", "vector": [14, 1, 0.5548, 0.0068, 1, 0.91, 0.0, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " pub = rospy.Publisher('my_cloud_chatter', PointCloud)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Return_L92_C4", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L79_C0", "vector": [13, 1, 0.6301, 0.0068, 1, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pub"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:If_L95_C0", "label": "if", "type": "if", "loc": [95, 100], "level": 0, "parent": null, "vector": [4, 0, 0.6678, 0.0411, 0, 0.66, 0.9286, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n # talker()\n start_server()\n \n except rospy.ROSInterruptException: pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L96_C4", "label": "try", "type": "try", "loc": [96, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:If_L95_C0", "vector": [7, 1, 0.6712, 0.0342, 1, 0.49, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # talker()\n start_server()\n \n except rospy.ROSInterruptException: pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L98_C8", "label": "start_server()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L96_C4", "vector": [8, 2, 0.6712, 0.0068, 2, 0.48, 0.0, 397, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_server", "arg_names": [], "import_names": [], "rhs_call_name": "start_server", "annotation": ""}, "snippet": " start_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L102_C0", "label": "expression", "type": "expression", "loc": [102, 143], "level": 0, "parent": null, "vector": [8, 0, 0.839, 0.2877, 0, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\ndef local_rand_cloud()\n ### Create a new cloud object and stuff it\n from random import *\n\n ROS_pointcloud = PointCloud() #sensor_msgs.msg.PointCloud()\n x = 0 #const offset easy to change.\n "}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Return_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Assign_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Return_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:If_L95_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99243:Try_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99243:Expr_L98_C8"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
import roslib; roslib.load_manifest('pr2_clutter_helper')
from pr2_lcs_helper.srv import * #specifically, get CameraInfo.srv"
from sensor_msgs.msg import CameraInfo, PointCloud, Image
#from geometry_msgs.msg import TransformStamped
from tf.msg import tfMessage
import sys
#depnds on sensor_msgs, opencv2, cv_bridge
import rospy
NODE_NAME = 'get_camera_info_server'
TOPIC_NAME = "wide_stereo/right/camera_info"
# Defaults for global values
global msg_type, srv_type, response_type
msg_type = CameraInfo
srv_type = GetCameraInfo
resp_type = GetCameraInfoResponse
global_ros_data = None
'''
Comments:
Traps exactly one message from the topic specified.
Subscribes to the topic, but returns as a service request.
'''
def sub_callback(data):
print '[get] callback called'
global global_ros_data
global_ros_data = data
def subscribe_once(topic_name=TOPIC_NAME, once_msg_type=msg_type):
s = rospy.Subscriber(topic_name, once_msg_type, sub_callback)
#spin until 1 message is received.
print 'sleeping now: waiting for topic', topic_name
global global_ros_data
while (not global_ros_data):
rospy.sleep(.1)
if rospy.is_shutdown(): #catch a CTRL-C
print '\n Forcing exit'
return False; #check for 'false' on output to catch error results.
print 'Returning received message from:', topic_name
s.unregister()
return global_ros_data #value will be returned as 'global_ros_data'
def handle_service_request(req):
topic_name = req.topic_name
#<ignore message type, must be set earlier. Subscribe to topic.>
data = subscribe_once(topic_name, msg_type)
#<generate data to send in this function>
return resp_type( data )
''' Ex: node_name = my_node, service_name = 'get_camera_info'
'''
def get_one_server(node_name, service_name):
rospy.init_node(node_name)
s = rospy.Service(service_name, srv_type, handle_service_request)
print "Ready to get", request
rospy.spin()
#for arg in sys.argv:
# print arg
if __name__ == '__main__':
print 'starting get_server.py'
#request = rospy.resolve_name('request') #wrong syntax
for arg in sys.argv: print '[arg] ', arg
try:
request = sys.argv[1]
print '[get] using msg type of', request
except:
print '[get] using defaults of CameraInfo'
request = 'CameraInfo'
try: default_topic_name = sys.argv[2]
except: print '[get] ignoring default topic name'
try: default_reference_frame = sys.argv[3]
except: print '[get] ignoring default reference frame'
unique_node_name = request + '_server'
unique_service_name = 'get_'+ request
print 'starting service with name: "%s" ' %unique_service_name
msg = {'CameraInfo':CameraInfo, 'Image':Image,
'PointCloud':PointCloud,
'tfMessage': tfMessage}
srv = {'CameraInfo':GetCameraInfo, 'Image':GetImage,
'PointCloud':GetPointCloud,
'tfMessage': GettfMessage}
resp = {'CameraInfo':GetCameraInfoResponse,
'Image':GetImageResponse,
'PointCloud':GetPointCloudResponse,
'tfMessage': GettfMessageResponse}
try:
#global msg_type, srv_type, response_type
msg_type = msg[request]
srv_type = srv[request]
resp_type = resp[request]
except:
print '[get service] unable to handle requested service of type: ', request
sys.exit()
get_one_server(unique_node_name, unique_service_name)
| ajibawa-2023/Python-Code-Large/train/row_99245 | 30 | 43 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0233, 0.0233, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0233, 0.0233, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:ImportFrom_L2_C0", "label": "from pr2_lcs_helper.srv import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0465, 0.0233, 0, 0.66, 0.2, 364, 0, 1, 0, 0, 364, 0, 0], "semantic": {"name": "pr2_lcs_helper.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_lcs_helper.srv import * #specifically, get CameraInfo.srv\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:ImportFrom_L3_C0", "label": "from sensor_msgs.msg import CameraInfo, PointCloud, Image", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0698, 0.0233, 0, 0.66, 0.3, 531, 0, 3, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["CameraInfo", "PointCloud", "Image"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import CameraInfo, PointCloud, Image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:ImportFrom_L4_C0", "label": "from tf.msg import tfMessage", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.093, 0.0233, 0, 0.66, 0.4, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "tf.msg", "arg_names": [], "import_names": ["tfMessage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from tf.msg import tfMessage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1395, 0.0233, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.186, 0.0233, 0, 0.66, 0.6, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L10_C0", "label": "sub_callback", "type": "function", "loc": [10, 13], "level": 0, "parent": null, "vector": [2, 0, 0.2674, 0.093, 0, 0.66, 0.7, 209, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sub_callback", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sub_callback(data):\n print('[get] callback called')\n global global_ros_data\n global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L11_C4", "label": "print()", "type": "expression", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L10_C0", "vector": [8, 1, 0.2558, 0.0233, 1, 0.72, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('[get] callback called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L13_C4", "label": "global_ros_data =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L10_C0", "vector": [14, 1, 0.3023, 0.0233, 1, 0.72, 1.0, 296, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "global_ros_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " global_ros_data = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "label": "subscribe_once", "type": "function", "loc": [15, 28], "level": 0, "parent": null, "vector": [2, 0, 0.5, 0.3256, 0, 0.66, 0.8, 902, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "subscribe_once", "arg_names": ["topic_name", "once_msg_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def subscribe_once(topic_name=TOPIC_NAME, once_msg_type=msg_type):\n s = rospy.Subscriber(topic_name, once_msg_type, sub_callback)\n #spin until 1 message is received.\n print('sleeping now: waiting for topic', topic_name)\n global global_ros_data\n while (not global_ros_data):\n rospy.sleep(.1)\n if rospy.is_shutdown(): #catch a CTRL-C"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L16_C4", "label": "s = Subscriber()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "vector": [14, 1, 0.3721, 0.0233, 1, 0.85, 0.0, 553, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " s = rospy.Subscriber(topic_name, once_msg_type, sub_callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L18_C4", "label": "print()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "vector": [8, 1, 0.4186, 0.0233, 1, 0.85, 0.2, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('sleeping now: waiting for topic', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:While_L20_C4", "label": "while", "type": "while", "loc": [20, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "vector": [5, 1, 0.5116, 0.1163, 1, 0.85, 0.4, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (not global_ros_data):\n rospy.sleep(.1)\n if rospy.is_shutdown(): #catch a CTRL-C\n print('\\n Forcing exit')\n return False; #check for 'false' on output to catch error results."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L21_C8", "label": "sleep()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:While_L20_C4", "vector": [8, 2, 0.4884, 0.0233, 2, 0.42, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:If_L22_C8", "label": "if", "type": "if", "loc": [22, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:While_L20_C4", "vector": [4, 2, 0.5349, 0.0698, 2, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown(): #catch a CTRL-C\n print('\\n Forcing exit')\n return False; #check for 'false' on output to catch error results."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L23_C12", "label": "print()", "type": "expression", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:If_L22_C8", "vector": [8, 3, 0.5349, 0.0233, 3, 0.86, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('\\n Forcing exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Return_L24_C12", "label": "return", "type": "return", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:If_L22_C8", "vector": [13, 3, 0.5581, 0.0233, 3, 0.86, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False; #check for 'false' on output to catch error results."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L25_C4", "label": "print()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "vector": [8, 1, 0.5814, 0.0233, 1, 0.85, 0.6, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Returning received message from:', topic_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L26_C4", "label": "unregister()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "vector": [8, 1, 0.6047, 0.0233, 1, 0.85, 0.8, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " s.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Return_L28_C4", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "vector": [13, 1, 0.6512, 0.0233, 1, 0.85, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return global_ros_data #value will be returned as 'global_ros_data'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "label": "handle_service_request", "type": "function", "loc": [30, 35], "level": 0, "parent": null, "vector": [2, 0, 0.7558, 0.1395, 0, 0.66, 0.9, 787, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "handle_service_request", "arg_names": ["req"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def handle_service_request(req):\n topic_name = req.topic_name \n #<ignore message type, must be set earlier. Subscribe to topic.>\n data = subscribe_once(topic_name, msg_type)\n #<generate data to send in this function> \n return resp_type( data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L31_C4", "label": "topic_name =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "vector": [14, 1, 0.7209, 0.0233, 1, 0.36, 0.0, 854, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "topic_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " topic_name = req.topic_name "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L33_C4", "label": "data = subscribe_once()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "vector": [14, 1, 0.7674, 0.0233, 1, 0.36, 0.5, 929, 3, 2, 0, 0, 902, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "subscribe_once", "annotation": ""}, "snippet": " data = subscribe_once(topic_name, msg_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "vector": [13, 1, 0.814, 0.0233, 1, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return resp_type( data )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "label": "get_one_server", "type": "function", "loc": [38, 42], "level": 0, "parent": null, "vector": [2, 0, 0.9302, 0.1163, 0, 0.66, 1.0, 411, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "get_one_server", "arg_names": ["node_name", "service_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_one_server(node_name, service_name):\n rospy.init_node(node_name)\n s = rospy.Service(service_name, srv_type, handle_service_request)\n print(\"Ready to get\", request)\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L39_C4", "label": "init_node()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "vector": [8, 1, 0.907, 0.0233, 1, 0.16, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(node_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L40_C4", "label": "s = Service()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "vector": [14, 1, 0.9302, 0.0233, 1, 0.16, 0.3333, 553, 3, 3, 0, 0, 451, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " s = rospy.Service(service_name, srv_type, handle_service_request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L41_C4", "label": "print()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "vector": [8, 1, 0.9535, 0.0233, 1, 0.16, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Ready to get\", request)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L42_C4", "label": "spin()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "vector": [8, 1, 0.9767, 0.0233, 1, 0.16, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:While_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:While_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:While_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:If_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:If_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:If_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Return_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99245:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99245:Expr_L42_C4"}] |
#!/usr/bin/python
#
# Copyright (c) 2010, Georgia Tech Research Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Georgia Tech Research Corporation nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# \author Jason Okerman (Healthcare Robotics Lab, Georgia Tech.)
import roslib; roslib.load_manifest('pr2_clutter_helper')
#depnds on sensor_msgs, opencv2, cv_bridge
import rospy
from sensor_msgs.msg import Image as msgImage
import cv #version 2.1 expected
from cv_bridge import CvBridge
#may need image_transport?
import time #sleep
from random import * #randint
global_ros_image = None
def imageCallback(data):
print 'callback called'
#Note: data should be of type sensor_msgs.msg.Image
#rospy.loginfo(rospy.get_name()+"I heard some data from camera")
global global_ros_image
global_ros_image = data
def listener():
rospy.init_node('my_image_listener', anonymous=True)
rospy.Subscriber("wide_stereo/right/image_rect_color", msgImage, imageCallback)
rospy.spin()
if __name__ == '__main__':
cv.NamedWindow('view')
cv.StartWindowThread()
rospy.init_node('my_image_listener', anonymous=True)
a = rospy.Subscriber("wide_stereo/right/image_rect_color", msgImage, imageCallback)
print 'sleeping now' #spin cycle. Similar to "spin_once" ?
while (not global_ros_image):
rospy.sleep(.1)
if rospy.is_shutdown():
print '\nforcing an exit'
break;
print 'waking and exiting now'
if not rospy.is_shutdown():
a.unregister()
br = CvBridge()
im = br.imgmsg_to_cv(global_ros_image)
cv.Erode(im, im, None, 5)
cv.Dilate(im, im, None, 5)
cv.ShowImage('view', im)
cv.WaitKey()
cv.SaveImage('~/Desktop/this_is_a_temporary_image.png', im)
#IDEA: -- 'sleep spin until callback received. then kill subscriber.
| ajibawa-2023/Python-Code-Large/train/row_99247 | 35 | 88 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Import_L30_C0", "label": "roslib import roslib", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.3409, 0.0114, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L30_C15", "label": "load_manifest()", "type": "expression", "loc": [30, 30], "level": 0, "parent": null, "vector": [8, 0, 0.3409, 0.0114, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('pr2_clutter_helper')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Import_L32_C0", "label": "rospy import rospy", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3636, 0.0114, 0, 0.66, 0.1818, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:ImportFrom_L33_C0", "label": "from sensor_msgs.msg import msgImage", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.375, 0.0114, 0, 0.66, 0.2727, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["msgImage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import Image as msgImage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Import_L34_C0", "label": "cv import cv", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.3864, 0.0114, 0, 0.66, 0.3636, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv #version 2.1 expected"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:ImportFrom_L35_C0", "label": "from cv_bridge import CvBridge", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.3977, 0.0114, 0, 0.66, 0.4545, 851, 0, 1, 0, 0, 851, 0, 0], "semantic": {"name": "cv_bridge", "arg_names": [], "import_names": ["CvBridge"], "rhs_call_name": "", "annotation": ""}, "snippet": "from cv_bridge import CvBridge"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Import_L38_C0", "label": "time import time", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.4318, 0.0114, 0, 0.66, 0.5455, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time #sleep"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:ImportFrom_L39_C0", "label": "from random import *", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.4432, 0.0114, 0, 0.66, 0.6364, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import * #randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L41_C0", "label": "global_ros_image =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.4659, 0.0114, 0, 0.66, 0.7273, 51, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "global_ros_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "global_ros_image = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L43_C0", "label": "imageCallback", "type": "function", "loc": [43, 48], "level": 0, "parent": null, "vector": [2, 0, 0.517, 0.0682, 0, 0.66, 0.8182, 66, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "imageCallback", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def imageCallback(data):\n print('callback called')\n #Note: data should be of type sensor_msgs.msg.Image\n #rospy.loginfo(rospy.get_name()+\"I heard some data from camera\")\n global global_ros_image\n global_ros_image = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L44_C4", "label": "print()", "type": "expression", "loc": [44, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L43_C0", "vector": [8, 1, 0.5, 0.0114, 1, 0.57, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('callback called')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L48_C4", "label": "global_ros_image =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L43_C0", "vector": [14, 1, 0.5455, 0.0114, 1, 0.57, 1.0, 51, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "global_ros_image", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " global_ros_image = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "label": "listener", "type": "function", "loc": [50, 53], "level": 0, "parent": null, "vector": [2, 0, 0.5852, 0.0455, 0, 0.66, 0.9091, 870, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def listener():\n rospy.init_node('my_image_listener', anonymous=True)\n rospy.Subscriber(\"wide_stereo/right/image_rect_color\", msgImage, imageCallback)\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L51_C4", "label": "init_node()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "vector": [8, 1, 0.5795, 0.0114, 1, 0.6, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('my_image_listener', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L52_C4", "label": "Subscriber()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "vector": [8, 1, 0.5909, 0.0114, 1, 0.6, 0.5, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(\"wide_stereo/right/image_rect_color\", msgImage, imageCallback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L53_C4", "label": "spin()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "vector": [8, 1, 0.6023, 0.0114, 1, 0.6, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "label": "if", "type": "if", "loc": [55, 77], "level": 0, "parent": null, "vector": [4, 0, 0.75, 0.2614, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n cv.NamedWindow('view')\n cv.StartWindowThread()\n rospy.init_node('my_image_listener', anonymous=True)\n a = rospy.Subscriber(\"wide_stereo/right/image_rect_color\", msgImage, imageCallback)\n \n while (not global_ros_image):\n rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L56_C4", "label": "NamedWindow()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [8, 1, 0.6364, 0.0114, 1, 0.33, 0.0, 60, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow('view')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L57_C4", "label": "StartWindowThread()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [8, 1, 0.6477, 0.0114, 1, 0.33, 0.1667, 670, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "StartWindowThread", "arg_names": [], "import_names": [], "rhs_call_name": "StartWindowThread", "annotation": ""}, "snippet": " cv.StartWindowThread()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L58_C4", "label": "init_node()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [8, 1, 0.6591, 0.0114, 1, 0.33, 0.3333, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('my_image_listener', anonymous=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L59_C4", "label": "a = Subscriber()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [14, 1, 0.6705, 0.0114, 1, 0.33, 0.5, 475, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " a = rospy.Subscriber(\"wide_stereo/right/image_rect_color\", msgImage, imageCallback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:While_L61_C4", "label": "while", "type": "while", "loc": [61, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [5, 1, 0.7159, 0.0568, 1, 0.33, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while (not global_ros_image):\n rospy.sleep(.1)\n if rospy.is_shutdown():\n print('\\nforcing an exit')\n break;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L62_C8", "label": "sleep()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:While_L61_C4", "vector": [8, 2, 0.7045, 0.0114, 2, 0.06, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L63_C8", "label": "if", "type": "if", "loc": [63, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:While_L61_C4", "vector": [4, 2, 0.7273, 0.0341, 2, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n print('\\nforcing an exit')\n break;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L64_C11", "label": "print()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L63_C8", "vector": [8, 3, 0.7273, 0.0114, 3, 0.24, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('\\nforcing an exit')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L66_C4", "label": "print()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [8, 1, 0.75, 0.0114, 1, 0.33, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('waking and exiting now')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "label": "if", "type": "if", "loc": [68, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "vector": [4, 1, 0.8239, 0.1136, 1, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rospy.is_shutdown():\n a.unregister()\n \n br = CvBridge()\n im = br.imgmsg_to_cv(global_ros_image)\n cv.Erode(im, im, None, 5)\n cv.Dilate(im, im, None, 5)\n cv.ShowImage('view', im) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L69_C8", "label": "unregister()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [8, 2, 0.7841, 0.0114, 2, 0.75, 0.0, 614, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unregister", "arg_names": [], "import_names": [], "rhs_call_name": "unregister", "annotation": ""}, "snippet": " a.unregister()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L71_C8", "label": "br = CvBridge()", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [14, 2, 0.8068, 0.0114, 2, 0.75, 0.1429, 199, 3, 0, 0, 0, 439, 10, 1], "semantic": {"name": "br", "arg_names": [], "import_names": [], "rhs_call_name": "CvBridge", "annotation": ""}, "snippet": " br = CvBridge()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L72_C8", "label": "im = imgmsg_to_cv()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [14, 2, 0.8182, 0.0114, 2, 0.75, 0.2857, 940, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "im", "arg_names": [], "import_names": [], "rhs_call_name": "imgmsg_to_cv", "annotation": ""}, "snippet": " im = br.imgmsg_to_cv(global_ros_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L73_C8", "label": "Erode()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [8, 2, 0.8295, 0.0114, 2, 0.75, 0.4286, 95, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Erode", "arg_names": [], "import_names": [], "rhs_call_name": "Erode", "annotation": ""}, "snippet": " cv.Erode(im, im, None, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L74_C8", "label": "Dilate()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [8, 2, 0.8409, 0.0114, 2, 0.75, 0.5714, 207, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Dilate", "arg_names": [], "import_names": [], "rhs_call_name": "Dilate", "annotation": ""}, "snippet": " cv.Dilate(im, im, None, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L75_C8", "label": "ShowImage()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [8, 2, 0.8523, 0.0114, 2, 0.75, 0.7143, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage('view', im) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L76_C8", "label": "WaitKey()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [8, 2, 0.8636, 0.0114, 2, 0.75, 0.8571, 885, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "WaitKey", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " cv.WaitKey()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L77_C8", "label": "SaveImage()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "vector": [8, 2, 0.875, 0.0114, 2, 0.75, 1.0, 91, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "SaveImage", "annotation": ""}, "snippet": " cv.SaveImage('~/Desktop/this_is_a_temporary_image.png', im)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:FunctionDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:While_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:While_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:While_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L64_C11"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99247:If_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99247:Expr_L77_C8"}] |
import roslib; roslib.load_manifest('face_reinterpret')
from sensor_msgs.msg import PointCloud
from visualization_msgs.msg import Marker
import rospy
class FaceBox:
def __init__(self):
rospy.Subscriber('/face_detector/faces_cloud', PointCloud, self.callback)
self.box_pub = rospy.Publisher('/face_detector/faces_boxes', Marker)
def callback(self, msg):
if len(msg.points) <= 0:
return
m = Marker()
m.header = msg.header
m.id = 0
m.type = Marker.CUBE
m.action = Marker.ADD
m.pose.position.x = msg.points[0].x
m.pose.position.y = msg.points[0].y
m.pose.position.z = msg.points[0].z
m.scale.x = 0.2
m.scale.y = 0.2
m.scale.z = 0.2
m.color.r = 1.0
m.color.g = 0.0
m.color.b = 0.0
m.color.a = 0.5
m.lifetime = rospy.Duration(10.0)
print m
self.box_pub.publish(m)
if __name__ == '__main__':
rospy.init_node('face_box')
f = FaceBox()
while not rospy.is_shutdown():
rospy.sleep(1.0)
| ajibawa-2023/Python-Code-Large/train/row_99248 | 35 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('face_reinterpret')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L1_C15", "label": "load_manifest()", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0263, 0.0263, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('face_reinterpret')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:ImportFrom_L2_C0", "label": "from sensor_msgs.msg import PointCloud", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0263, 0, 0.66, 0.3333, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:ImportFrom_L3_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.5, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0263, 0, 0.66, 0.6667, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:ClassDef_L6_C0", "label": "FaceBox", "type": "class", "loc": [6, 31], "level": 0, "parent": null, "vector": [3, 0, 0.4868, 0.6842, 0, 0.66, 0.8333, 623, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "FaceBox", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FaceBox:\n def __init__(self):\n rospy.Subscriber('/face_detector/faces_cloud', PointCloud, self.callback)\n self.box_pub = rospy.Publisher('/face_detector/faces_boxes', Marker)\n\n def callback(self, msg):\n if len(msg.points) <= 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L7_C4", "label": "__init__", "type": "function", "loc": [7, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:ClassDef_L6_C0", "vector": [2, 1, 0.2105, 0.0789, 1, 0.83, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rospy.Subscriber('/face_detector/faces_cloud', PointCloud, self.callback)\n self.box_pub = rospy.Publisher('/face_detector/faces_boxes', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L8_C8", "label": "Subscriber()", "type": "expression", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L7_C4", "vector": [8, 2, 0.2105, 0.0263, 2, 0.39, 0.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/face_detector/faces_cloud', PointCloud, self.callback)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L9_C8", "label": "self.box_pub = Publisher()", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L7_C4", "vector": [14, 2, 0.2368, 0.0263, 2, 0.39, 1.0, 128, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.box_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.box_pub = rospy.Publisher('/face_detector/faces_boxes', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "label": "callback", "type": "function", "loc": [11, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:ClassDef_L6_C0", "vector": [2, 1, 0.5526, 0.5526, 1, 0.83, 1.0, 342, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def callback(self, msg):\n if len(msg.points) <= 0:\n return\n m = Marker()\n m.header = msg.header\n m.id = 0\n m.type = Marker.CUBE\n m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L12_C8", "label": "if", "type": "if", "loc": [12, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [4, 2, 0.3289, 0.0526, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(msg.points) <= 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Return_L13_C12", "label": "return", "type": "return", "loc": [13, 13], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L12_C8", "vector": [13, 3, 0.3421, 0.0263, 3, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L14_C8", "label": "m = Marker()", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.3684, 0.0263, 2, 0.78, 0.0556, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L15_C8", "label": "m.header =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.3947, 0.0263, 2, 0.78, 0.1111, 268, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.header", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header = msg.header"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L16_C8", "label": "m.id =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.4211, 0.0263, 2, 0.78, 0.1667, 46, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L17_C8", "label": "m.type =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.4474, 0.0263, 2, 0.78, 0.2222, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = Marker.CUBE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L18_C8", "label": "m.action =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.4737, 0.0263, 2, 0.78, 0.2778, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L19_C8", "label": "m.pose.position.x =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.5, 0.0263, 2, 0.78, 0.3333, 414, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.pose.position.x = msg.points[0].x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L20_C8", "label": "m.pose.position.y =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.5263, 0.0263, 2, 0.78, 0.3889, 993, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.pose.position.y = msg.points[0].y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L21_C8", "label": "m.pose.position.z =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.5526, 0.0263, 2, 0.78, 0.4444, 279, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.pose.position.z = msg.points[0].z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L22_C8", "label": "m.scale.x =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.5789, 0.0263, 2, 0.78, 0.5, 918, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.scale.x = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L23_C8", "label": "m.scale.y =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.6053, 0.0263, 2, 0.78, 0.5556, 433, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.scale.y = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L24_C8", "label": "m.scale.z =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.6316, 0.0263, 2, 0.78, 0.6111, 61, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.scale.z = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L25_C8", "label": "m.color.r =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.6579, 0.0263, 2, 0.78, 0.6667, 600, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.r = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L26_C8", "label": "m.color.g =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.6842, 0.0263, 2, 0.78, 0.7222, 934, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.g = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L27_C8", "label": "m.color.b =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.7105, 0.0263, 2, 0.78, 0.7778, 404, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.b = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L28_C8", "label": "m.color.a =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.7368, 0.0263, 2, 0.78, 0.8333, 410, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "m.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color.a = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L29_C8", "label": "m.lifetime = Duration()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [14, 2, 0.7632, 0.0263, 2, 0.78, 0.8889, 448, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "m.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " m.lifetime = rospy.Duration(10.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L30_C8", "label": "print()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [8, 2, 0.7895, 0.0263, 2, 0.78, 0.9444, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L31_C8", "label": "publish()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "vector": [8, 2, 0.8158, 0.0263, 2, 0.78, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.box_pub.publish(m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "label": "if", "type": "if", "loc": [34, 38], "level": 0, "parent": null, "vector": [4, 0, 0.9474, 0.1316, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node('face_box')\n f = FaceBox()\n while not rospy.is_shutdown():\n rospy.sleep(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L35_C4", "label": "init_node()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "vector": [8, 1, 0.9211, 0.0263, 1, 0.43, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('face_box')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L36_C4", "label": "f = FaceBox()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "vector": [14, 1, 0.9474, 0.0263, 1, 0.43, 0.5, 899, 3, 0, 0, 0, 623, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "FaceBox", "annotation": ""}, "snippet": " f = FaceBox()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:While_L37_C4", "label": "while", "type": "while", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "vector": [5, 1, 0.9868, 0.0526, 1, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n rospy.sleep(1.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L38_C8", "label": "sleep()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99248:While_L37_C4", "vector": [8, 2, 1.0, 0.0263, 2, 0.33, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.0)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99248:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L12_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Return_L13_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:If_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:While_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99248:While_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99248:Expr_L38_C8"}] |
#!/usr/bin/python
import roslib
roslib.load_manifest( 'robotis' )
import rospy
import robotis.lib_robotis as rs
import time
import math
if __name__ == '__main__':
rospy.logout( 'pr2_ears_stow_startup: Stowing RFID Ears Servos' )
rospy.logout( 'pr2_ears_stow_startup: Connecting to servos' )
dyn_left = rs.USB2Dynamixel_Device( '/dev/robot/servo1' )
pan_left = rs.Robotis_Servo( dyn_left, 29 )
tilt_left = rs.Robotis_Servo( dyn_left, 30 )
dyn_right = rs.USB2Dynamixel_Device( '/dev/robot/servo0' )
pan_right = rs.Robotis_Servo( dyn_right, 27 )
tilt_right = rs.Robotis_Servo( dyn_right, 28 )
# Hack to prevent the right servo from shaking.
pan_right.write_address( 27, [3] ) # change the right pan compliance region
pan_right.write_address( 26, [3] ) # change the right pan compliance region
rospy.logout( 'pr2_ears_stow_startup: Commanding stow positions' )
pan_left.move_angle( 1.370, math.radians( 10 ), False )
tilt_left.move_angle( 0.0, math.radians( 10 ), False )
pan_right.move_angle( -1.370, math.radians( 10 ), False )
tilt_right.move_angle( 0.0, math.radians( 10 ), False )
rospy.logout( 'pr2_ears_stow_startup: Done' )
time.sleep(1.0)
| ajibawa-2023/Python-Code-Large/train/row_99249 | 24 | 37 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0811, 0.027, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1081, 0.027, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'robotis' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1351, 0.027, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Import_L6_C0", "label": "robotis.lib_robotis import rs", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1622, 0.027, 0, 0.66, 0.5, 324, 0, 1, 0, 0, 324, 0, 0], "semantic": {"name": "robotis.lib_robotis", "arg_names": [], "import_names": ["rs"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robotis.lib_robotis as rs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Import_L8_C0", "label": "time import time", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2162, 0.027, 0, 0.66, 0.6667, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Import_L9_C0", "label": "math import math", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2432, 0.027, 0, 0.66, 0.8333, 526, 0, 1, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "label": "if", "type": "if", "loc": [11, 36], "level": 0, "parent": null, "vector": [4, 0, 0.6351, 0.7027, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.logout( 'pr2_ears_stow_startup: Stowing RFID Ears Servos' )\n \n rospy.logout( 'pr2_ears_stow_startup: Connecting to servos' )\n dyn_left = rs.USB2Dynamixel_Device( '/dev/robot/servo1' )\n pan_left = rs.Robotis_Servo( dyn_left, 29 )\n tilt_left = rs.Robotis_Servo( dyn_left, 30 )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L12_C4", "label": "logout()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.3243, 0.027, 1, 0.06, 0.0, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'pr2_ears_stow_startup: Stowing RFID Ears Servos' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L14_C4", "label": "logout()", "type": "expression", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.3784, 0.027, 1, 0.06, 0.0625, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'pr2_ears_stow_startup: Connecting to servos' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L15_C4", "label": "dyn_left = USB2Dynamixel_Device()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [14, 1, 0.4054, 0.027, 1, 0.06, 0.125, 21, 3, 1, 0, 0, 935, 10, 1], "semantic": {"name": "dyn_left", "arg_names": [], "import_names": [], "rhs_call_name": "USB2Dynamixel_Device", "annotation": ""}, "snippet": " dyn_left = rs.USB2Dynamixel_Device( '/dev/robot/servo1' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L16_C4", "label": "pan_left = Robotis_Servo()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [14, 1, 0.4324, 0.027, 1, 0.06, 0.1875, 251, 3, 2, 0, 0, 124, 10, 1], "semantic": {"name": "pan_left", "arg_names": [], "import_names": [], "rhs_call_name": "Robotis_Servo", "annotation": ""}, "snippet": " pan_left = rs.Robotis_Servo( dyn_left, 29 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L17_C4", "label": "tilt_left = Robotis_Servo()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [14, 1, 0.4595, 0.027, 1, 0.06, 0.25, 404, 3, 2, 0, 0, 124, 10, 1], "semantic": {"name": "tilt_left", "arg_names": [], "import_names": [], "rhs_call_name": "Robotis_Servo", "annotation": ""}, "snippet": " tilt_left = rs.Robotis_Servo( dyn_left, 30 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L19_C4", "label": "dyn_right = USB2Dynamixel_Device()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [14, 1, 0.5135, 0.027, 1, 0.06, 0.3125, 923, 3, 1, 0, 0, 935, 10, 1], "semantic": {"name": "dyn_right", "arg_names": [], "import_names": [], "rhs_call_name": "USB2Dynamixel_Device", "annotation": ""}, "snippet": " dyn_right = rs.USB2Dynamixel_Device( '/dev/robot/servo0' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L20_C4", "label": "pan_right = Robotis_Servo()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [14, 1, 0.5405, 0.027, 1, 0.06, 0.375, 970, 3, 2, 0, 0, 124, 10, 1], "semantic": {"name": "pan_right", "arg_names": [], "import_names": [], "rhs_call_name": "Robotis_Servo", "annotation": ""}, "snippet": " pan_right = rs.Robotis_Servo( dyn_right, 27 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L21_C4", "label": "tilt_right = Robotis_Servo()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [14, 1, 0.5676, 0.027, 1, 0.06, 0.4375, 63, 3, 2, 0, 0, 124, 10, 1], "semantic": {"name": "tilt_right", "arg_names": [], "import_names": [], "rhs_call_name": "Robotis_Servo", "annotation": ""}, "snippet": " tilt_right = rs.Robotis_Servo( dyn_right, 28 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L24_C4", "label": "write_address()", "type": "expression", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.6486, 0.027, 1, 0.06, 0.5, 504, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_address", "arg_names": [], "import_names": [], "rhs_call_name": "write_address", "annotation": ""}, "snippet": " pan_right.write_address( 27, [3] ) # change the right pan compliance region"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L25_C4", "label": "write_address()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.6757, 0.027, 1, 0.06, 0.5625, 504, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write_address", "arg_names": [], "import_names": [], "rhs_call_name": "write_address", "annotation": ""}, "snippet": " pan_right.write_address( 26, [3] ) # change the right pan compliance region"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L27_C4", "label": "logout()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.7297, 0.027, 1, 0.06, 0.625, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'pr2_ears_stow_startup: Commanding stow positions' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L28_C4", "label": "move_angle()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.7568, 0.027, 1, 0.06, 0.6875, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " pan_left.move_angle( 1.370, math.radians( 10 ), False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L29_C4", "label": "move_angle()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.7838, 0.027, 1, 0.06, 0.75, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " tilt_left.move_angle( 0.0, math.radians( 10 ), False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L31_C4", "label": "move_angle()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.8378, 0.027, 1, 0.06, 0.8125, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " pan_right.move_angle( -1.370, math.radians( 10 ), False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L32_C4", "label": "move_angle()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.8649, 0.027, 1, 0.06, 0.875, 293, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "move_angle", "arg_names": [], "import_names": [], "rhs_call_name": "move_angle", "annotation": ""}, "snippet": " tilt_right.move_angle( 0.0, math.radians( 10 ), False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L34_C4", "label": "logout()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.9189, 0.027, 1, 0.06, 0.9375, 525, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logout", "arg_names": [], "import_names": [], "rhs_call_name": "logout", "annotation": ""}, "snippet": " rospy.logout( 'pr2_ears_stow_startup: Done' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L36_C4", "label": "sleep()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "vector": [8, 1, 0.973, 0.027, 1, 0.06, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " time.sleep(1.0)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99249:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99249:Expr_L36_C4"}] |
##
# Representation of a dataset, operations that can be performed on it, and quantities that can be calculated from it
import numpy as np
import copy
class Dataset:
##
# inputs coded as numpy array, column vectors
# outputs also as numpy array, column vectors
def __init__(self, inputs, outputs):
self.inputs = inputs
self.outputs = outputs
self.metadata = []
assert(inputs.shape[1] == outputs.shape[1])
def num_examples(self):
return self.inputs.shape[1]
def num_attributes(self):
return self.inputs.shape[0]
def add_attribute_descriptor(self, descriptor):
self.metadata.append(descriptor)
#self.metadata[descriptor.name] = descriptor
def append(self, another_dataset):
if self.inputs != None:
self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)
else:
self.inputs = another_dataset.inputs
if self.outputs != None:
self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)
else:
self.outputs = another_dataset.outputs
class AttributeDescriptor:
def __init__(self, name, extent):
self.name = name
self.extent = extent
###############################################################################
# Operations on datasets
###############################################################################
##
# Good for leave one out cross validation loops.
# @param dataset
# @param index
def leave_one_out(dataset, index):
inputs = np.column_stack((dataset.inputs[:, :index], dataset.inputs[:, index+1:]))
outputs = np.column_stack((dataset.outputs[:, :index], dataset.outputs[:, index+1:]))
d = Dataset(inputs, outputs)
d.metadata = copy.copy(dataset.metadata)
return d, dataset.inputs[:, index], dataset.outputs[:,index]
##
# Splits up a dataset based on value in a particular attribute
# @param attribute attribute to split on
# @param split_point value in that attribute to split on
def split_continuous(dataset, attribute, split_point):
selected_attribute = dataset.inputs[attribute, :]
leq_bool = selected_attribute <= split_point
_, leq_col = np.where(leq_bool)
#print 'leq_col', leq_col
if leq_col.shape[1] > 0:
leq_dataset = Dataset(dataset.inputs[:, leq_col.A[0]], dataset.outputs[:, leq_col.A[0]])
else:
leq_dataset = Dataset(np.matrix([]), np.matrix([]))
_, gt_col = np.where(~leq_bool)
if gt_col.shape[1] > 0:
gt_dataset = Dataset(dataset.inputs[:, gt_col.A[0]], dataset.outputs[:, gt_col.A[0]])
else:
gt_dataset = Dataset(np.matrix([]), np.matrix([]))
ret_sets = []
if leq_dataset.num_examples() > 0:
ret_sets.append(leq_dataset)
if gt_dataset.num_examples() > 0:
ret_sets.append(gt_dataset)
return ret_sets
##
# Makes bootstrap samples
#
# @param dataset Dataset object
# @param number_samples number of bootstrap set to generate
# @param points_per_sample number of points in each sample
# @return an iterator over bootstrap samples
def bootstrap_samples(dataset, number_samples, points_per_sample):
in_bags, out_bags = [], []
for i in xrange(number_samples):
selected_pts = np.random.randint(0, dataset.inputs.shape[1], points_per_sample)
n_selected_pts = np.setdiff1d(range(dataset.inputs.shape[1]), selected_pts)
selected_inputs = dataset.inputs[:, selected_pts]
selected_outputs = dataset.outputs[:, selected_pts]
n_selected_inputs = dataset.inputs[:, n_selected_pts]
n_selected_outputs = dataset.outputs[:, n_selected_pts]
#print 'Dataset.bootstrap count', i
in_bags.append(Dataset(selected_inputs, selected_outputs))
out_bags.append(Dataset(n_selected_inputs, n_selected_outputs))
return in_bags, out_bags
###############################################################################
# Common quantities calculated from datasets
###############################################################################
##
# Returns unique values represented by an attribute
#
# ex. unique_values(np.matrix([1, 2, 3, 4, 4, 4, 5]), 0)
# returns [1,2,3,4,5]
#
# @param data nxm matrix where each column is a data vector
# @param attribute_number row to find unique values in
def unique_values(data, attribute_number=0):
values = dict()
for instance_idx in xrange(data.shape[1]):
values[data[attribute_number, instance_idx]] = True
k = values.keys()
k.sort()
return k
##
# Caculates the discrete entropy of a data vector
#
# @param data 1xn matrix of discrete values
def entropy_discrete(data):
values = unique_values(data)
#for each output class calculate
def calc_class_entropy(value):
number_in_class = np.sum(data == value)
num_examples = data.shape[1]
percentage_in_class = (number_in_class / float(num_examples))
return -percentage_in_class * np.log2(percentage_in_class)
return np.sum(map(calc_class_entropy, values))
##
# Calculates entropy in a dataset's output labels
#
# @param dataset
def dataset_entropy_discrete(dataset):
return entropy_discrete(dataset.outputs[0,:])
| ajibawa-2023/Python-Code-Large/train/row_99250 | 76 | 153 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0065, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Import_L4_C0", "label": "copy import copy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0065, 0, 0.66, 0.1111, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "label": "Dataset", "type": "class", "loc": [6, 36], "level": 0, "parent": null, "vector": [3, 0, 0.1373, 0.2026, 0, 0.66, 0.2222, 957, 0, 5, 0, 0, 0, 0, 3], "semantic": {"name": "Dataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Dataset:\n\n ## \n # inputs coded as numpy array, column vectors\n # outputs also as numpy array, column vectors\n def __init__(self, inputs, outputs):\n self.inputs = inputs\n self.outputs = outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "vector": [2, 1, 0.085, 0.0327, 1, 0.74, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "inputs", "outputs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, inputs, outputs):\n self.inputs = inputs\n self.outputs = outputs\n self.metadata = []\n assert(inputs.shape[1] == outputs.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L12_C8", "label": "self.inputs =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "vector": [14, 2, 0.0784, 0.0065, 2, 0.97, 0.0, 646, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.inputs = inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L13_C8", "label": "self.outputs =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "vector": [14, 2, 0.085, 0.0065, 2, 0.97, 0.5, 88, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.outputs = outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L14_C8", "label": "self.metadata =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "vector": [14, 2, 0.0915, 0.0065, 2, 0.97, 1.0, 83, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.metadata", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.metadata = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L17_C4", "label": "num_examples", "type": "function", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "vector": [2, 1, 0.1144, 0.0131, 1, 0.74, 0.25, 12, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "num_examples", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def num_examples(self):\n return self.inputs.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L17_C4", "vector": [13, 2, 0.1176, 0.0065, 2, 0.37, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.inputs.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L20_C4", "label": "num_attributes", "type": "function", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "vector": [2, 1, 0.134, 0.0131, 1, 0.74, 0.5, 271, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "num_attributes", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def num_attributes(self):\n return self.inputs.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L21_C8", "label": "return", "type": "return", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L20_C4", "vector": [13, 2, 0.1373, 0.0065, 2, 0.15, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.inputs.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L23_C4", "label": "add_attribute_descriptor", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "vector": [2, 1, 0.1536, 0.0131, 1, 0.74, 0.75, 440, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_attribute_descriptor", "arg_names": ["self", "descriptor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_attribute_descriptor(self, descriptor):\n self.metadata.append(descriptor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L24_C8", "label": "append()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L23_C4", "vector": [8, 2, 0.1569, 0.0065, 2, 0.1, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.metadata.append(descriptor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L27_C4", "label": "append", "type": "function", "loc": [27, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "vector": [2, 1, 0.2059, 0.0654, 1, 0.74, 1.0, 243, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": ["self", "another_dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def append(self, another_dataset):\n if self.inputs != None:\n self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)\n else:\n self.inputs = another_dataset.inputs\n\n if self.outputs != None:\n self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L28_C8", "label": "if", "type": "if", "loc": [28, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L27_C4", "vector": [4, 2, 0.1928, 0.0261, 2, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.inputs != None:\n self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)\n else:\n self.inputs = another_dataset.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L29_C12", "label": "self.inputs = concatenate()", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L28_C8", "vector": [14, 3, 0.1895, 0.0065, 3, 0.94, 0.0, 646, 3, 2, 0, 0, 63, 10, 1], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " self.inputs = np.concatenate((self.inputs, another_dataset.inputs), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L31_C12", "label": "self.inputs =", "type": "assigned_variable", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L28_C8", "vector": [14, 3, 0.2026, 0.0065, 3, 0.94, 1.0, 646, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.inputs = another_dataset.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L33_C8", "label": "if", "type": "if", "loc": [33, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L27_C4", "vector": [4, 2, 0.2255, 0.0261, 2, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.outputs != None:\n self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)\n else:\n self.outputs = another_dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L34_C12", "label": "self.outputs = concatenate()", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L33_C8", "vector": [14, 3, 0.2222, 0.0065, 3, 0.2, 0.0, 88, 3, 2, 0, 0, 63, 10, 1], "semantic": {"name": "self.outputs", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " self.outputs = np.concatenate((self.outputs, another_dataset.outputs), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L36_C12", "label": "self.outputs =", "type": "assigned_variable", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L33_C8", "vector": [14, 3, 0.2353, 0.0065, 3, 0.2, 1.0, 88, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.outputs = another_dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L38_C0", "label": "AttributeDescriptor", "type": "class", "loc": [38, 41], "level": 0, "parent": null, "vector": [3, 0, 0.2582, 0.0261, 0, 0.66, 0.3333, 604, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "AttributeDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AttributeDescriptor:\n def __init__(self, name, extent):\n self.name = name\n self.extent = extent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L39_C4", "label": "__init__", "type": "function", "loc": [39, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L38_C0", "vector": [2, 1, 0.2614, 0.0196, 1, 0.55, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "extent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, extent):\n self.name = name\n self.extent = extent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L40_C8", "label": "self.name =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L39_C4", "vector": [14, 2, 0.2614, 0.0065, 2, 0.24, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L41_C8", "label": "self.extent =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L39_C4", "vector": [14, 2, 0.268, 0.0065, 2, 0.24, 1.0, 728, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.extent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.extent = extent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "label": "leave_one_out", "type": "function", "loc": [52, 57], "level": 0, "parent": null, "vector": [2, 0, 0.3562, 0.0392, 0, 0.66, 0.4444, 294, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "leave_one_out", "arg_names": ["dataset", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def leave_one_out(dataset, index):\n inputs = np.column_stack((dataset.inputs[:, :index], dataset.inputs[:, index+1:]))\n outputs = np.column_stack((dataset.outputs[:, :index], dataset.outputs[:, index+1:]))\n d = Dataset(inputs, outputs)\n d.metadata = copy.copy(dataset.metadata)\n return d, dataset.inputs[:, index], dataset.outputs[:,index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L53_C4", "label": "inputs = column_stack()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "vector": [14, 1, 0.3464, 0.0065, 1, 0.67, 0.0, 226, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "inputs", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " inputs = np.column_stack((dataset.inputs[:, :index], dataset.inputs[:, index+1:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L54_C4", "label": "outputs = column_stack()", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "vector": [14, 1, 0.3529, 0.0065, 1, 0.67, 0.25, 451, 3, 1, 0, 0, 724, 10, 1], "semantic": {"name": "outputs", "arg_names": [], "import_names": [], "rhs_call_name": "column_stack", "annotation": ""}, "snippet": " outputs = np.column_stack((dataset.outputs[:, :index], dataset.outputs[:, index+1:]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L55_C4", "label": "d = Dataset()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "vector": [14, 1, 0.3595, 0.0065, 1, 0.67, 0.5, 355, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " d = Dataset(inputs, outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L56_C4", "label": "d.metadata = copy()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "vector": [14, 1, 0.366, 0.0065, 1, 0.67, 0.75, 971, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "d.metadata", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " d.metadata = copy.copy(dataset.metadata)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L57_C4", "label": "return", "type": "return", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "vector": [13, 1, 0.3725, 0.0065, 1, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return d, dataset.inputs[:, index], dataset.outputs[:,index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "label": "split_continuous", "type": "function", "loc": [63, 85], "level": 0, "parent": null, "vector": [2, 0, 0.4837, 0.1503, 0, 0.66, 0.5556, 193, 0, 3, 1, 0, 0, 0, 14], "semantic": {"name": "split_continuous", "arg_names": ["dataset", "attribute", "split_point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_continuous(dataset, attribute, split_point):\n selected_attribute = dataset.inputs[attribute, :]\n leq_bool = selected_attribute <= split_point\n _, leq_col = np.where(leq_bool)\n\n #print 'leq_col', leq_col\n if leq_col.shape[1] > 0:\n leq_dataset = Dataset(dataset.inputs[:, leq_col.A[0]], dataset.outputs[:, leq_col.A[0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L64_C4", "label": "selected_attribute =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [14, 1, 0.4183, 0.0065, 1, 0.04, 0.0, 828, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_attribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_attribute = dataset.inputs[attribute, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L65_C4", "label": "leq_bool =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [14, 1, 0.4248, 0.0065, 1, 0.04, 0.1111, 734, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "leq_bool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " leq_bool = selected_attribute <= split_point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L66_C4", "label": "_, leq_col = where()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [14, 1, 0.4314, 0.0065, 1, 0.04, 0.2222, 314, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "_, leq_col", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " _, leq_col = np.where(leq_bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L69_C4", "label": "if", "type": "if", "loc": [69, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [4, 1, 0.4608, 0.0261, 1, 0.04, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if leq_col.shape[1] > 0:\n leq_dataset = Dataset(dataset.inputs[:, leq_col.A[0]], dataset.outputs[:, leq_col.A[0]])\n else:\n leq_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L70_C8", "label": "leq_dataset = Dataset()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L69_C4", "vector": [14, 2, 0.4575, 0.0065, 2, 0.31, 0.0, 687, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "leq_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " leq_dataset = Dataset(dataset.inputs[:, leq_col.A[0]], dataset.outputs[:, leq_col.A[0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L72_C8", "label": "leq_dataset = Dataset()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L69_C4", "vector": [14, 2, 0.4706, 0.0065, 2, 0.31, 1.0, 687, 3, 2, 0, 0, 957, 10, 3], "semantic": {"name": "leq_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " leq_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L74_C4", "label": "_, gt_col = where()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [14, 1, 0.4837, 0.0065, 1, 0.04, 0.4444, 23, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "_, gt_col", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " _, gt_col = np.where(~leq_bool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L75_C4", "label": "if", "type": "if", "loc": [75, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [4, 1, 0.5, 0.0261, 1, 0.04, 0.5556, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if gt_col.shape[1] > 0:\n gt_dataset = Dataset(dataset.inputs[:, gt_col.A[0]], dataset.outputs[:, gt_col.A[0]])\n else:\n gt_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L76_C8", "label": "gt_dataset = Dataset()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L75_C4", "vector": [14, 2, 0.4967, 0.0065, 2, 0.92, 0.0, 829, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "gt_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " gt_dataset = Dataset(dataset.inputs[:, gt_col.A[0]], dataset.outputs[:, gt_col.A[0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L78_C8", "label": "gt_dataset = Dataset()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L75_C4", "vector": [14, 2, 0.5098, 0.0065, 2, 0.92, 1.0, 829, 3, 2, 0, 0, 957, 10, 3], "semantic": {"name": "gt_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " gt_dataset = Dataset(np.matrix([]), np.matrix([]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L80_C4", "label": "ret_sets =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [14, 1, 0.5229, 0.0065, 1, 0.04, 0.6667, 219, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ret_sets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret_sets = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L81_C4", "label": "if", "type": "if", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [4, 1, 0.5327, 0.0131, 1, 0.04, 0.7778, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if leq_dataset.num_examples() > 0:\n ret_sets.append(leq_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L82_C8", "label": "append()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L81_C4", "vector": [8, 2, 0.5359, 0.0065, 2, 0.24, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret_sets.append(leq_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L83_C4", "label": "if", "type": "if", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [4, 1, 0.5458, 0.0131, 1, 0.04, 0.8889, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if gt_dataset.num_examples() > 0:\n ret_sets.append(gt_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L84_C8", "label": "append()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L83_C4", "vector": [8, 2, 0.549, 0.0065, 2, 0.1, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ret_sets.append(gt_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L85_C4", "label": "return", "type": "return", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "vector": [13, 1, 0.5556, 0.0065, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret_sets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "label": "bootstrap_samples", "type": "function", "loc": [94, 106], "level": 0, "parent": null, "vector": [2, 0, 0.6536, 0.085, 0, 0.66, 0.6667, 629, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "bootstrap_samples", "arg_names": ["dataset", "number_samples", "points_per_sample"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def bootstrap_samples(dataset, number_samples, points_per_sample):\n in_bags, out_bags = [], []\n for i in xrange(number_samples):\n selected_pts = np.random.randint(0, dataset.inputs.shape[1], points_per_sample)\n n_selected_pts = np.setdiff1d(range(dataset.inputs.shape[1]), selected_pts)\n selected_inputs = dataset.inputs[:, selected_pts]\n selected_outputs = dataset.outputs[:, selected_pts]\n n_selected_inputs = dataset.inputs[:, n_selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L95_C4", "label": "in_bags, out_bags =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "vector": [14, 1, 0.6209, 0.0065, 1, 0.89, 0.0, 530, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "in_bags, out_bags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " in_bags, out_bags = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "label": "for i", "type": "for", "loc": [96, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "vector": [6, 1, 0.6569, 0.0654, 1, 0.89, 0.5, 826, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(number_samples):\n selected_pts = np.random.randint(0, dataset.inputs.shape[1], points_per_sample)\n n_selected_pts = np.setdiff1d(range(dataset.inputs.shape[1]), selected_pts)\n selected_inputs = dataset.inputs[:, selected_pts]\n selected_outputs = dataset.outputs[:, selected_pts]\n n_selected_inputs = dataset.inputs[:, n_selected_pts]\n n_selected_outputs = dataset.outputs[:, n_selected_pts]\n #print 'Dataset.bootstrap count', i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L97_C8", "label": "selected_pts = randint()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [14, 2, 0.634, 0.0065, 2, 0.22, 0.0, 911, 3, 3, 0, 0, 449, 10, 1], "semantic": {"name": "selected_pts", "arg_names": [], "import_names": [], "rhs_call_name": "randint", "annotation": ""}, "snippet": " selected_pts = np.random.randint(0, dataset.inputs.shape[1], points_per_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L98_C8", "label": "n_selected_pts = setdiff1d()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [14, 2, 0.6405, 0.0065, 2, 0.22, 0.1429, 806, 3, 2, 0, 0, 708, 10, 2], "semantic": {"name": "n_selected_pts", "arg_names": [], "import_names": [], "rhs_call_name": "setdiff1d", "annotation": ""}, "snippet": " n_selected_pts = np.setdiff1d(range(dataset.inputs.shape[1]), selected_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L99_C8", "label": "selected_inputs =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [14, 2, 0.6471, 0.0065, 2, 0.22, 0.2857, 2, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_inputs = dataset.inputs[:, selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L100_C8", "label": "selected_outputs =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [14, 2, 0.6536, 0.0065, 2, 0.22, 0.4286, 776, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_outputs = dataset.outputs[:, selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L101_C8", "label": "n_selected_inputs =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [14, 2, 0.6601, 0.0065, 2, 0.22, 0.5714, 285, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_selected_inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_selected_inputs = dataset.inputs[:, n_selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L102_C8", "label": "n_selected_outputs =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [14, 2, 0.6667, 0.0065, 2, 0.22, 0.7143, 417, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "n_selected_outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " n_selected_outputs = dataset.outputs[:, n_selected_pts]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L104_C8", "label": "append()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [8, 2, 0.6797, 0.0065, 2, 0.22, 0.8571, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " in_bags.append(Dataset(selected_inputs, selected_outputs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L105_C8", "label": "append()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "vector": [8, 2, 0.6863, 0.0065, 2, 0.22, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " out_bags.append(Dataset(n_selected_inputs, n_selected_outputs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "vector": [13, 1, 0.6928, 0.0065, 1, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return in_bags, out_bags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "label": "unique_values", "type": "function", "loc": [120, 126], "level": 0, "parent": null, "vector": [2, 0, 0.8039, 0.0458, 0, 0.66, 0.7778, 921, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "unique_values", "arg_names": ["data", "attribute_number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def unique_values(data, attribute_number=0):\n values = dict()\n for instance_idx in xrange(data.shape[1]):\n values[data[attribute_number, instance_idx]] = True\n k = values.keys()\n k.sort()\n return k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L121_C4", "label": "values = dict()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "vector": [14, 1, 0.7908, 0.0065, 1, 0.2, 0.0, 721, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " values = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L122_C4", "label": "for instance_idx", "type": "for", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "vector": [6, 1, 0.8007, 0.0131, 1, 0.2, 0.25, 62, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "instance_idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for instance_idx in xrange(data.shape[1]):\n values[data[attribute_number, instance_idx]] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L123_C8", "label": "assign", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L122_C4", "vector": [14, 2, 0.8039, 0.0065, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values[data[attribute_number, instance_idx]] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L124_C4", "label": "k = keys()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "vector": [14, 1, 0.8105, 0.0065, 1, 0.2, 0.5, 954, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " k = values.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L125_C4", "label": "sort()", "type": "expression", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "vector": [8, 1, 0.817, 0.0065, 1, 0.2, 0.75, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " k.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L126_C4", "label": "return", "type": "return", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "vector": [13, 1, 0.8235, 0.0065, 1, 0.2, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "label": "entropy_discrete", "type": "function", "loc": [132, 140], "level": 0, "parent": null, "vector": [2, 0, 0.8889, 0.0588, 0, 0.66, 0.8889, 419, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "entropy_discrete", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def entropy_discrete(data):\n values = unique_values(data)\n #for each output class calculate\n def calc_class_entropy(value):\n number_in_class = np.sum(data == value)\n num_examples = data.shape[1]\n percentage_in_class = (number_in_class / float(num_examples))\n return -percentage_in_class * np.log2(percentage_in_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L133_C4", "label": "values = unique_values()", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "vector": [14, 1, 0.8693, 0.0065, 1, 0.26, 0.0, 721, 3, 1, 0, 0, 921, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "unique_values", "annotation": ""}, "snippet": " values = unique_values(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "label": "calc_class_entropy", "type": "function", "loc": [135, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "vector": [2, 1, 0.8954, 0.0327, 1, 0.26, 0.5, 727, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "calc_class_entropy", "arg_names": ["value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_class_entropy(value):\n number_in_class = np.sum(data == value)\n num_examples = data.shape[1]\n percentage_in_class = (number_in_class / float(num_examples))\n return -percentage_in_class * np.log2(percentage_in_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L136_C8", "label": "number_in_class = sum()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "vector": [14, 2, 0.8889, 0.0065, 2, 0.63, 0.0, 901, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "number_in_class", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " number_in_class = np.sum(data == value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L137_C8", "label": "num_examples =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "vector": [14, 2, 0.8954, 0.0065, 2, 0.63, 0.3333, 12, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "num_examples", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_examples = data.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L138_C8", "label": "percentage_in_class =", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "vector": [14, 2, 0.902, 0.0065, 2, 0.63, 0.6667, 664, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "percentage_in_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percentage_in_class = (number_in_class / float(num_examples))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L139_C8", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "vector": [13, 2, 0.9085, 0.0065, 2, 0.63, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -percentage_in_class * np.log2(percentage_in_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L140_C4", "label": "return", "type": "return", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "vector": [13, 1, 0.915, 0.0065, 1, 0.26, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.sum(map(calc_class_entropy, values))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L146_C0", "label": "dataset_entropy_discrete", "type": "function", "loc": [146, 147], "level": 0, "parent": null, "vector": [2, 0, 0.9575, 0.0131, 0, 0.66, 1.0, 894, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "dataset_entropy_discrete", "arg_names": ["dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dataset_entropy_discrete(dataset):\n return entropy_discrete(dataset.outputs[0,:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L147_C4", "label": "return", "type": "return", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L146_C0", "vector": [13, 1, 0.9608, 0.0065, 1, 0.72, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return entropy_discrete(dataset.outputs[0,:])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:ClassDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:For_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Expr_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99250:FunctionDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99250:Return_L147_C4"}] |
## @author Hai Nguyen/hai@gatech.edu
import roslib; roslib.load_manifest('ml_lib')
import numpy as np
import itertools as it
import functools as ft
import time
import dataset as ds
##
# Base class for random forest classifier
#
class RFBase:
##
# @param dataset Dataset object
# @param number_of_dimensions unclear which direction, but should be around 10-20% of original
# data dimension
# @param number_of_learners limited by processor performance, higher is better
def __init__(self, dataset=None, number_of_dimensions=None, number_of_learners=100):
self.number_of_learners = number_of_learners
self.number_of_dimensions = number_of_dimensions
if dataset != None:
self.train(dataset)
##
# @param data
# @param vote_combine_function function to combine votes, by default
# returns the label with the most votes
def predict(self, data, vote_combine_function=None):
def predict_(learner):
return learner.predict(learner.transform_input(data, learner))
predictions = map(predict_,self.learners)
if vote_combine_function is not None:
return vote_combine_function(predictions)
else:
return mode_exhaustive(predictions)
def train(self, dataset):
pass
def avg_tree_depth(self):
return np.average(map(DecisionTree.get_tree_depth, self.learners))
##
# Train a random forest using DecisionTrees on bootstrap samples using splits
# on random attributes and random values on those attributes.
#
class RFBreiman(RFBase):
def train(self, dataset):
def train_trees(examples_subset):
tree = DecisionTree()
#tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))
tree.train(examples_subset, splitting_func=totally_random_split)
#use identity function
tree.transform_input = identity
return tree
if self.number_of_dimensions == None:
self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)
points_per_sample = dataset.num_examples() * 1.0 / 3.0
self.learners = map(train_trees, ds.bootstrap_samples(dataset, self.number_of_learners, points_per_sample))
##
# Train a random forest using DecisionTrees on bootstrap samples where each
# sample has a random subset of dimensions but the split point is performed
# using a minimum entropy criteria.
#
class RFRandomInputSubset(RFBase):
def train(self, dataset):
def train_trees(examples_subset):
#select a subset of dimensions
dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())
subset_input = examples_subset.inputs[dims, :]
reduced_sample = Dataset(subset_input, examples_subset.outputs)
tree = DecisionTree(reduced_sample)
tree.dimensions_subset = dims
return tree
if self.number_of_dimensions == None:
self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)
points_per_sample = dataset.num_examples() * 1.0 / 3.0
in_bags, out_bags = ds.bootstrap_samples(dataset,
self.number_of_learners,
points_per_sample)
self.learners = map(train_trees, in_bags)
def transform_input(self, input, tree=None):
return input[tree.dimensions_subset, :]
def binary_less_than(attribute, threshold, input_vec):
return input_vec[attribute,0] <= threshold
def binary_greater_than(attribute, threshold, input_vec):
return input_vec[attribute,0] > threshold
def create_binary_tests(attribute, threshold):
return [('binary_less_than', attribute, threshold),
('binary_greater_than', attribute, threshold)]
###############################################################################
# Helper functions
###############################################################################
##
# Finds the mode of a given set
#
def mode_exhaustive(set):
#Count, store in dictionary
mdict = dict()
for s in set:
has_stored = False
keys = mdict.keys()
keys.sort() # sorting these keys gives determinism to the classifier
for k in keys:
if k == s:
mdict[k] = 1+mdict[k]
has_stored = True
if not has_stored:
mdict[s] = 1
#Find the key with maximum votes
max_key = None
max_count = -1
keys = mdict.keys()
keys.sort() # sorting these keys gives determinism to the classifier
for k in keys:
if mdict[k] > max_count:
max_key = k
max_count = mdict[k]
#print 'mode_exhaustive: ', mdict
return max_key, mdict
##
# Find the split that produces subsets with the minimum combined entropy
# return splitting attribute & splitting point for that attribute
#
# @param dataset
def min_entropy_split(dataset):
#print 'in min_entropy_split'
# Assume inputs are continuous, and are column vectors.
hypotheses = []
entropies = []
# For each attribute find the best split point.
for attribute in xrange(dataset.num_attributes()):
values = ds.unique_values(dataset.inputs, attribute)
#Iterate over the possible values of split & calculate entropy for each split.
for split_point in values:
def calc_entropy(data_set):
num_points = data_set.num_examples()
#return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()
return (num_points / float(dataset.num_examples())) * ds.dataset_entropy_discrete(dataset)
split_entropy = map(calc_entropy, ds.split_continuous(dataset, attribute, split_point))
hypotheses.append((attribute, split_point))
entropies.append(sum(split_entropy))
# Select the attribute split pair that has the lowest entropy.
entropies = np.matrix(entropies)
min_idx = np.argmin(entropies)
return hypotheses[min_idx]
def random_subset(subset_size, total_size):
#print 'in random_subset'
assert(subset_size <= total_size)
occupancy = np.matrix(np.zeros((1, total_size)))
while occupancy.sum() < subset_size:
occupancy[0, np.random.randint(0, total_size)] = 1
rows, columns = np.where(occupancy > 0)
return columns.A[0]
def split_random_subset(subset_size, total_size):
assert(subset_size <= total_size)
occupancy = np.matrix(np.zeros((1, total_size)))
while occupancy.sum() < subset_size:
occupancy[0, np.random.randint(0, total_size)] = 1
bool_sel = occupancy > 0
rows, columns_subset = np.where(bool_sel)
rows, columns_remaining = np.where(np.invert(bool_sel))
return columns_subset.A[0], columns_remaining.A[0]
##
# splitter in decision tree
def random_subset_split(num_subset, dataset):
#print 'in random_subset_split'
#print 'num_subset', num_subset, dataset, 'dataset.input.shape', dataset.inputs.shape
subset_indexes = random_subset(num_subset, dataset.num_attributes())
sub_dataset = Dataset(dataset.inputs[subset_indexes,:], dataset.outputs)
attribute, point = min_entropy_split(sub_dataset)
return subset_indexes[attribute], point
def totally_random_split(dataset):
#print 'totally random'
attr = np.random.randint(0, dataset.num_attributes())
split_pt = dataset.inputs[attr, np.random.randint(0, dataset.num_examples())]
return attr, split_pt
###############################################################################
# Basic DecisionTree that the random forest is based on
class DecisionTree:
def __init__(self, dataset=None, splitting_func=min_entropy_split):
self.children = None
self.prediction = None
if dataset is not None:
self.train(dataset, splitting_func=splitting_func)
def train(self, dataset, splitting_func=min_entropy_split):
if not self.make_leaf(dataset):
#print 'in train.splitting', dataset.num_examples()
self.split_attribute, self.split_point = splitting_func(dataset)
#print 'self.split_attribute, self.split_point', self.split_attribute, self.split_point
data_sets = ds.split_continuous(dataset, self.split_attribute, self.split_point)
if len(data_sets) < 2:
self.prediction = dataset.outputs
return
def tree_split(set):
#print 'tree', set.num_examples()
return DecisionTree(set, splitting_func=splitting_func)
# Create & train child decision nodes
tests = create_binary_tests(self.split_attribute, self.split_point)
self.children = zip(tests, map(tree_split, data_sets))
def make_leaf(self, dataset):
if np.all(dataset.outputs[:,0] == dataset.outputs):
self.prediction = dataset.outputs[:,0]
#print 'leaf'
return True
elif np.all(dataset.inputs[:,0] == dataset.inputs):
self.prediction = dataset.outputs
#print 'leaf'
return True
else:
return False
def predict(self, input):
if self.prediction is not None:
return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]
else:
for test, child in self.children:
test_func_name, attribute, threshold = test
if test_func_name == 'binary_less_than':
test_func = binary_less_than
elif test_func_name == 'binary_greater_than':
test_func = binary_greater_than
else:
rospy.logerr("DecisionTree bad function name : %s" %
test_func_name)
if test_func(attribute, threshold, input):
return child.predict(input)
raise RuntimeError("DecisionTree: splits not exhaustive, unable to split for input" + str(input.T))
##
# Identity function
def transform_input(self, input, tree=None):
return input
def get_tree_depth(self):
if self.prediction is not None:
return 1
depths = []
for test, child in self.children:
depths.append(child.get_tree_depth() + 1)
return max(depths)
##
# Evaluate classifier by dividing dataset into training and test set.
# @param building_func Function that will build classifier given data and args in extra_args.
# @param data Dataset to use for evaluation/training.
# @param times The number of bootstrap samples to take.
# @param percentage The percentage of data to use for training.
# @param extra_args Extra arguments to pass to building_func.
def evaluate_classifier(building_func, data, times=10.0, percentage=None, extra_args={}, test_pca=False):
print 'evaluate_classifier: extra_args', extra_args
total_pts = data.num_examples()
testing_errors = []
training_errors = []
build_times = []
classification_times = []
for i in range(times):
if percentage == None:
percentage = (i+1)/times
num_examples = int(round(total_pts*percentage))
print 'Evaluate classifier built with', percentage*100, '% data, num examples', num_examples
subset, unselected = split_random_subset(num_examples, total_pts)
i = data.inputs[:, subset]
o = data.outputs[:, subset]
print "Building classifier..."
if test_pca:
print ' TESTING PCA'
import dimreduce as dr
subseted_dataset = dr.LinearDimReduceDataset(i,o)
subseted_dataset.set_projection_vectors(dr.pca_vectors(subseted_dataset.inputs, percent_variance=.95))
subseted_dataset.reduce_input()
print 'subseted_dataset.num_attributes(), subseted_dataset.num_examples()', subseted_dataset.num_attributes(), subseted_dataset.num_examples()
else:
subseted_dataset = Dataset(i,o)
start_time = time.time()
classifier = building_func(subseted_dataset, **extra_args)
build_times.append(time.time() - start_time)
print "done building..."
##########################################
#Classify training set
##########################################
count_selected = []
for i, idx in enumerate(subset):
start_time = time.time()
if test_pca:
prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))
else:
prediction, _ = classifier.predict(data.inputs[:,idx])
classification_times.append(time.time() - start_time)
true_val = data.outputs[:,idx]
if prediction == true_val:
count_selected.append(1)
else:
count_selected.append(0)
if i%100 == 0:
print i
count_selected = np.matrix(count_selected)
##########################################
#Classify testing set
##########################################
confusion_matrix = dict()
count_unselected = []
print 'Total points', total_pts
for idx in unselected:
start_time = time.time()
if test_pca:
prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))
else:
prediction, _ = classifier.predict(data.inputs[:,idx])
classification_times.append(time.time() - start_time)
true_val = data.outputs[:,idx]
if prediction == true_val:
count_unselected.append(1)
else:
count_unselected.append(0)
if confusion_matrix.has_key(true_val[0,0]):
if confusion_matrix[true_val[0,0]].has_key(prediction[0,0]):
confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1
else:
confusion_matrix[true_val[0,0]][prediction[0,0]] = 1
else:
confusion_matrix[true_val[0,0]] = dict()
confusion_matrix[true_val[0,0]][prediction[0,0]] = 1
training_error = 100.0 * np.sum(count_selected) / float(len(subset))
testing_error = 100.0 * np.sum(count_unselected) / float(len(unselected))
testing_errors.append(testing_error)
training_errors.append(training_error)
print 'Correct on training set', training_error, '%'
print ' on testing set', testing_error, '%'
print 'Confusion'
for k in confusion_matrix.keys():
sum = 0.0
for k2 in confusion_matrix[k]:
sum = sum + confusion_matrix[k][k2]
for k2 in confusion_matrix[k]:
print 'true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time'
def print_stats(name, list_data):
m = np.matrix(list_data)
print '%s: average %f std %f' % (name, m.mean(), np.std(m))
print_stats('training error', training_errors)
print_stats('testing error', testing_errors)
print_stats('build time', build_times)
print_stats('classification time', classification_times)
if __name__ == '__main__':
test_iris = False
test_pickle = False
test_number_trees = False
test_pca = False
test_packing = False
test_new_design = True
import pickle as pk
def save_pickle(pickle, filename):
p = open(filename, 'w')
picklelicious = pk.dump(pickle, p)
p.close()
def load_pickle(filename):
p = open(filename, 'r')
picklelicious = pk.load(p)
p.close()
return picklelicious
if test_iris:
#Setup for repeated testing
iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))
inputs = np.float32(iris_array[:, 0:4]).T
outputs = iris_array[:, 4].T
dataset = Dataset(inputs, outputs)
print '================================'
print "Test DecisionTree"
evaluate_classifier(DecisionTree, dataset, 5, .9)
print '================================'
#print "Test random forest"
#for i in range(4):
# #print "Test RFRandomInputSubset"
# #evaluate_classifier(RFRandomInputSubset, dataset, 1, .7)
# print "Test RFBreiman"
# evaluate_classifier(RFEntropySplitRandomInputSubset, dataset, 1, .7)
if test_pickle:
def print_separator(times=2):
for i in xrange(times):
print '==============================================================='
dataset = load_pickle('PatchClassifier.dataset.pickle')
#if test_pca:
# print_separator(1)
# print_separator(1)
# dataset.reduce_input()
if test_number_trees:
tree_types = [RFBreiman, RFRandomInputSubset]
#tree_types = [RFBreiman]
for tree_type in tree_types:
print_separator()
print 'Testing', tree_type
for i in range(10):
print tree_type, 'using', (i+1)*10, 'trees'
evaluate_classifier(tree_type, dataset, 3, .95,
extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)
else:
tree_types = [RFBreiman, RFRandomInputSubset]
#tree_types = [RFRandomInputSubset]
for tree_type in tree_types:
print_separator()
print tree_type
evaluate_classifier(tree_type, dataset, 10, .95,
extra_args={'number_of_learners': 70}, test_pca=test_pca)
if test_packing:
train = np.mat(np.random.rand(4, 20))
resp = np.mat(np.round(np.random.rand(1, 20)))
data = ds.Dataset(train, resp)
dt = DecisionTree(data)
packed = dt.pack_tree()
print packed
new_dt = DecisionTree()
new_dt.unpack_tree(packed)
bad = False
for i in range(500):
np.random.seed(i)
test = np.mat(np.random.rand(4, 1))
np.random.seed(1)
pred_old = dt.predict(test)
np.random.seed(1)
pred_new = new_dt.predict(test)
if pred_old != pred_new:
print "Not same prediction:"
print pred_old, pred_new
bad = True
if not bad:
print "Prediction tests successful!"
dt = RFBreiman(data)
packed = dt.pack_rf()
new_dt = RFBreiman()
new_dt.unpack_rf(packed)
bad = False
for i in range(500):
np.random.seed(i)
test = np.mat(np.random.rand(4, 1))
np.random.seed(1)
pred_old, _ = dt.predict(test)
np.random.seed(1)
pred_new, _ = new_dt.predict(test)
if pred_old != pred_new:
print "RF Not same prediction:"
print pred_old, pred_new
bad = True
if not bad:
print "RF Prediction tests successful!"
if test_new_design:
np.random.seed(2)
train = np.mat(np.random.rand(4, 20))
resp = np.mat(np.round(np.random.rand(1, 20)))
data = ds.Dataset(train, resp)
dt = RFBreiman(data)
save_pickle(dt, "rfbreiman.pickle")
dt = load_pickle("rfbreiman.pickle")
preds = []
for i in range(500):
np.random.seed(i)
test = np.mat(np.random.rand(4, 1))
np.random.seed(1)
pred, pred_dict = dt.predict(test)
preds.append(pred[0,0])
print preds
| ajibawa-2023/Python-Code-Large/train/row_99251 | 343 | 508 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0039, 0.002, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('ml_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L2_C15", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0039, 0.002, 0, 0.66, 0.0476, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('ml_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0079, 0.002, 0, 0.66, 0.0952, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L5_C0", "label": "itertools import it", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0098, 0.002, 0, 0.66, 0.1429, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["it"], "rhs_call_name": "", "annotation": ""}, "snippet": "import itertools as it"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L6_C0", "label": "functools import ft", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.002, 0, 0.66, 0.1905, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["ft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import functools as ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L7_C0", "label": "time import time", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0138, 0.002, 0, 0.66, 0.2381, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L8_C0", "label": "dataset import ds", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0157, 0.002, 0, 0.66, 0.2857, 603, 0, 1, 0, 0, 603, 0, 0], "semantic": {"name": "dataset", "arg_names": [], "import_names": ["ds"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dataset as ds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "label": "RFBase", "type": "class", "loc": [13, 43], "level": 0, "parent": null, "vector": [3, 0, 0.0551, 0.061, 0, 0.66, 0.3333, 454, 0, 5, 0, 0, 0, 0, 8], "semantic": {"name": "RFBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFBase:\n\n ##\n # @param dataset Dataset object\n # @param number_of_dimensions unclear which direction, but should be around 10-20% of original \n # data dimension\n # @param number_of_learners limited by processor performance, higher is better\n def __init__(self, dataset=None, number_of_dimensions=None, number_of_learners=100):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "vector": [2, 1, 0.0433, 0.0098, 1, 0.46, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "dataset", "number_of_dimensions", "number_of_learners"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dataset=None, number_of_dimensions=None, number_of_learners=100):\n self.number_of_learners = number_of_learners\n self.number_of_dimensions = number_of_dimensions\n if dataset != None:\n self.train(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L21_C8", "label": "self.number_of_learners =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "vector": [14, 2, 0.0413, 0.002, 2, 0.09, 0.0, 98, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.number_of_learners", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.number_of_learners = number_of_learners"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L22_C8", "label": "self.number_of_dimensions =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "vector": [14, 2, 0.0433, 0.002, 2, 0.09, 0.5, 542, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.number_of_dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.number_of_dimensions = number_of_dimensions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L23_C8", "label": "if", "type": "if", "loc": [23, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "vector": [4, 2, 0.0463, 0.0039, 2, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dataset != None:\n self.train(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L24_C12", "label": "train()", "type": "expression", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L23_C8", "vector": [8, 3, 0.0472, 0.002, 3, 0.9, 0.0, 371, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": " self.train(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "label": "predict", "type": "function", "loc": [30, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "vector": [2, 1, 0.0659, 0.0157, 1, 0.46, 0.3333, 127, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "predict", "arg_names": ["self", "data", "vote_combine_function"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict(self, data, vote_combine_function=None):\n def predict_(learner):\n return learner.predict(learner.transform_input(data, learner))\n predictions = map(predict_,self.learners)\n if vote_combine_function is not None:\n return vote_combine_function(predictions)\n else:\n return mode_exhaustive(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L31_C8", "label": "predict_", "type": "function", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "vector": [2, 2, 0.062, 0.0039, 2, 0.18, 0.0, 780, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "predict_", "arg_names": ["learner"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict_(learner):\n return learner.predict(learner.transform_input(data, learner))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L32_C12", "label": "return", "type": "return", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L31_C8", "vector": [13, 3, 0.063, 0.002, 3, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return learner.predict(learner.transform_input(data, learner))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L33_C8", "label": "predictions = map()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "vector": [14, 2, 0.065, 0.002, 2, 0.18, 0.5, 493, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "predictions", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " predictions = map(predict_,self.learners)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L34_C8", "label": "if", "type": "if", "loc": [34, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "vector": [4, 2, 0.0699, 0.0079, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vote_combine_function is not None:\n return vote_combine_function(predictions)\n else:\n return mode_exhaustive(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L35_C12", "label": "return", "type": "return", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L34_C8", "vector": [13, 3, 0.0689, 0.002, 3, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vote_combine_function(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L37_C12", "label": "return", "type": "return", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L34_C8", "vector": [13, 3, 0.0728, 0.002, 3, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mode_exhaustive(predictions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L39_C4", "label": "train", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "vector": [2, 1, 0.0778, 0.0039, 1, 0.46, 0.6667, 371, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "train", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L42_C4", "label": "avg_tree_depth", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "vector": [2, 1, 0.0837, 0.0039, 1, 0.46, 1.0, 869, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "avg_tree_depth", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def avg_tree_depth(self):\n return np.average(map(DecisionTree.get_tree_depth, self.learners))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L42_C4", "vector": [13, 2, 0.0846, 0.002, 2, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.average(map(DecisionTree.get_tree_depth, self.learners))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L50_C0", "label": "RFBreiman", "type": "class", "loc": [50, 63], "level": 0, "parent": null, "vector": [3, 0, 0.1112, 0.0276, 0, 0.66, 0.381, 766, 0, 2, 0, 0, 454, 0, 8], "semantic": {"name": "RFBreiman", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFBreiman(RFBase):\n def train(self, dataset):\n def train_trees(examples_subset):\n tree = DecisionTree()\n #tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))\n tree.train(examples_subset, splitting_func=totally_random_split)\n #use identity function\n tree.transform_input = identity "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "label": "train", "type": "function", "loc": [51, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L50_C0", "vector": [2, 1, 0.1122, 0.0256, 1, 0.68, 0.0, 371, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "train", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset):\n def train_trees(examples_subset):\n tree = DecisionTree()\n #tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))\n tree.train(examples_subset, splitting_func=totally_random_split)\n #use identity function\n tree.transform_input = identity \n return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "label": "train_trees", "type": "function", "loc": [52, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "vector": [2, 2, 0.1083, 0.0138, 2, 0.68, 0.0, 642, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "train_trees", "arg_names": ["examples_subset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train_trees(examples_subset):\n tree = DecisionTree()\n #tree.train(examples_subset, splitting_func=ft.partial(random_subset_split, self.number_of_dimensions))\n tree.train(examples_subset, splitting_func=totally_random_split)\n #use identity function\n tree.transform_input = identity \n return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L53_C12", "label": "tree = DecisionTree()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "vector": [14, 3, 0.1043, 0.002, 3, 0.8, 0.0, 613, 3, 0, 0, 0, 890, 10, 1], "semantic": {"name": "tree", "arg_names": [], "import_names": [], "rhs_call_name": "DecisionTree", "annotation": ""}, "snippet": " tree = DecisionTree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L55_C12", "label": "train()", "type": "expression", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "vector": [8, 3, 0.1083, 0.002, 3, 0.8, 0.3333, 371, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": " tree.train(examples_subset, splitting_func=totally_random_split)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L57_C12", "label": "tree.transform_input =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "vector": [14, 3, 0.1122, 0.002, 3, 0.8, 0.6667, 794, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tree.transform_input", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree.transform_input = identity "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L58_C12", "label": "return", "type": "return", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "vector": [13, 3, 0.1142, 0.002, 3, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L60_C8", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "vector": [4, 2, 0.1191, 0.0039, 2, 0.68, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.number_of_dimensions == None:\n self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L61_C12", "label": "self.number_of_dimensions = min()", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L60_C8", "vector": [14, 3, 0.1201, 0.002, 3, 0.52, 0.0, 542, 3, 2, 0, 0, 867, 10, 3], "semantic": {"name": "self.number_of_dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L62_C8", "label": "points_per_sample =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "vector": [14, 2, 0.122, 0.002, 2, 0.68, 0.6667, 65, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "points_per_sample", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points_per_sample = dataset.num_examples() * 1.0 / 3.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L63_C8", "label": "self.learners = map()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "vector": [14, 2, 0.124, 0.002, 2, 0.68, 1.0, 991, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "self.learners", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.learners = map(train_trees, ds.bootstrap_samples(dataset, self.number_of_learners, points_per_sample))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L70_C0", "label": "RFRandomInputSubset", "type": "class", "loc": [70, 90], "level": 0, "parent": null, "vector": [3, 0, 0.1575, 0.0413, 0, 0.66, 0.4286, 170, 0, 3, 0, 0, 454, 0, 10], "semantic": {"name": "RFRandomInputSubset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RFRandomInputSubset(RFBase):\n def train(self, dataset):\n def train_trees(examples_subset):\n #select a subset of dimensions\n dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())\n subset_input = examples_subset.inputs[dims, :]\n reduced_sample = Dataset(subset_input, examples_subset.outputs)\n tree = DecisionTree(reduced_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "label": "train", "type": "function", "loc": [71, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L70_C0", "vector": [2, 1, 0.1555, 0.0335, 1, 0.91, 0.0, 371, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "train", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset):\n def train_trees(examples_subset):\n #select a subset of dimensions\n dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())\n subset_input = examples_subset.inputs[dims, :]\n reduced_sample = Dataset(subset_input, examples_subset.outputs)\n tree = DecisionTree(reduced_sample)\n tree.dimensions_subset = dims"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "label": "train_trees", "type": "function", "loc": [72, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "vector": [2, 2, 0.1486, 0.0157, 2, 0.47, 0.0, 642, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "train_trees", "arg_names": ["examples_subset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train_trees(examples_subset):\n #select a subset of dimensions\n dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())\n subset_input = examples_subset.inputs[dims, :]\n reduced_sample = Dataset(subset_input, examples_subset.outputs)\n tree = DecisionTree(reduced_sample)\n tree.dimensions_subset = dims\n return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L74_C12", "label": "dims = random_subset()", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "vector": [14, 3, 0.1457, 0.002, 3, 0.57, 0.0, 219, 3, 2, 0, 0, 299, 10, 2], "semantic": {"name": "dims", "arg_names": [], "import_names": [], "rhs_call_name": "random_subset", "annotation": ""}, "snippet": " dims = random_subset(self.number_of_dimensions, examples_subset.num_attributes())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L75_C12", "label": "subset_input =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "vector": [14, 3, 0.1476, 0.002, 3, 0.57, 0.2, 715, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subset_input", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subset_input = examples_subset.inputs[dims, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L76_C12", "label": "reduced_sample = Dataset()", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "vector": [14, 3, 0.1496, 0.002, 3, 0.57, 0.4, 224, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "reduced_sample", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " reduced_sample = Dataset(subset_input, examples_subset.outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L77_C12", "label": "tree = DecisionTree()", "type": "assigned_variable", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "vector": [14, 3, 0.1516, 0.002, 3, 0.57, 0.6, 613, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "tree", "arg_names": [], "import_names": [], "rhs_call_name": "DecisionTree", "annotation": ""}, "snippet": " tree = DecisionTree(reduced_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L78_C12", "label": "tree.dimensions_subset =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "vector": [14, 3, 0.1535, 0.002, 3, 0.57, 0.8, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tree.dimensions_subset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree.dimensions_subset = dims"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L79_C12", "label": "return", "type": "return", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "vector": [13, 3, 0.1555, 0.002, 3, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L81_C8", "label": "if", "type": "if", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "vector": [4, 2, 0.1604, 0.0039, 2, 0.47, 0.25, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.number_of_dimensions == None:\n self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L82_C12", "label": "self.number_of_dimensions = min()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L81_C8", "vector": [14, 3, 0.1614, 0.002, 3, 0.93, 0.0, 542, 3, 2, 0, 0, 867, 10, 3], "semantic": {"name": "self.number_of_dimensions", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " self.number_of_dimensions = min(np.log2(dataset.num_attributes()) + 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L83_C8", "label": "points_per_sample =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "vector": [14, 2, 0.1634, 0.002, 2, 0.47, 0.5, 65, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "points_per_sample", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " points_per_sample = dataset.num_examples() * 1.0 / 3.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L84_C8", "label": "in_bags, out_bags = bootstrap_samples()", "type": "assigned_variable", "loc": [84, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "vector": [14, 2, 0.1673, 0.0059, 2, 0.47, 0.75, 530, 3, 3, 0, 0, 629, 10, 1], "semantic": {"name": "in_bags, out_bags", "arg_names": [], "import_names": [], "rhs_call_name": "bootstrap_samples", "annotation": ""}, "snippet": " in_bags, out_bags = ds.bootstrap_samples(dataset, \n self.number_of_learners, \n points_per_sample)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L87_C8", "label": "self.learners = map()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "vector": [14, 2, 0.1713, 0.002, 2, 0.47, 1.0, 991, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "self.learners", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.learners = map(train_trees, in_bags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L89_C4", "label": "transform_input", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L70_C0", "vector": [2, 1, 0.1762, 0.0039, 1, 0.91, 1.0, 639, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "transform_input", "arg_names": ["self", "input", "tree"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_input(self, input, tree=None):\n return input[tree.dimensions_subset, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L89_C4", "vector": [13, 2, 0.1772, 0.002, 2, 0.21, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input[tree.dimensions_subset, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L93_C0", "label": "binary_less_than", "type": "function", "loc": [93, 94], "level": 0, "parent": null, "vector": [2, 0, 0.1841, 0.0039, 0, 0.66, 0.4762, 633, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "binary_less_than", "arg_names": ["attribute", "threshold", "input_vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def binary_less_than(attribute, threshold, input_vec):\n return input_vec[attribute,0] <= threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L94_C4", "label": "return", "type": "return", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L93_C0", "vector": [13, 1, 0.185, 0.002, 1, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input_vec[attribute,0] <= threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L96_C0", "label": "binary_greater_than", "type": "function", "loc": [96, 97], "level": 0, "parent": null, "vector": [2, 0, 0.19, 0.0039, 0, 0.66, 0.5238, 196, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "binary_greater_than", "arg_names": ["attribute", "threshold", "input_vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def binary_greater_than(attribute, threshold, input_vec):\n return input_vec[attribute,0] > threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L97_C4", "label": "return", "type": "return", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L96_C0", "vector": [13, 1, 0.1909, 0.002, 1, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input_vec[attribute,0] > threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L99_C0", "label": "create_binary_tests", "type": "function", "loc": [99, 101], "level": 0, "parent": null, "vector": [2, 0, 0.1969, 0.0059, 0, 0.66, 0.5714, 583, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "create_binary_tests", "arg_names": ["attribute", "threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_binary_tests(attribute, threshold):\n return [('binary_less_than', attribute, threshold), \n ('binary_greater_than', attribute, threshold)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L100_C4", "label": "return", "type": "return", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L99_C0", "vector": [13, 1, 0.1978, 0.0039, 1, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [('binary_less_than', attribute, threshold), \n ('binary_greater_than', attribute, threshold)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "label": "mode_exhaustive", "type": "function", "loc": [110, 135], "level": 0, "parent": null, "vector": [2, 0, 0.2411, 0.0512, 0, 0.66, 0.619, 156, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "mode_exhaustive", "arg_names": ["set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mode_exhaustive(set):\n\n #Count, store in dictionary\n mdict = dict()\n for s in set:\n has_stored = False\n keys = mdict.keys()\n keys.sort() # sorting these keys gives determinism to the classifier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L113_C4", "label": "mdict = dict()", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [14, 1, 0.2224, 0.002, 1, 0.88, 0.0, 234, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "mdict", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " mdict = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "label": "for s", "type": "for", "loc": [114, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [6, 1, 0.2333, 0.0197, 1, 0.88, 0.1429, 553, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for s in set:\n has_stored = False\n keys = mdict.keys()\n keys.sort() # sorting these keys gives determinism to the classifier\n for k in keys:\n if k == s:\n mdict[k] = 1+mdict[k]\n has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L115_C8", "label": "has_stored =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "vector": [14, 2, 0.2264, 0.002, 2, 0.72, 0.0, 586, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "has_stored", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_stored = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L116_C8", "label": "keys = keys()", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "vector": [14, 2, 0.2283, 0.002, 2, 0.72, 0.25, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = mdict.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L117_C8", "label": "sort()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "vector": [8, 2, 0.2303, 0.002, 2, 0.72, 0.5, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort() # sorting these keys gives determinism to the classifier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L118_C8", "label": "for k", "type": "for", "loc": [118, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "vector": [6, 2, 0.2352, 0.0079, 2, 0.72, 0.75, 954, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in keys:\n if k == s:\n mdict[k] = 1+mdict[k]\n has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L119_C12", "label": "if", "type": "if", "loc": [119, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L118_C8", "vector": [4, 3, 0.2362, 0.0059, 3, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if k == s:\n mdict[k] = 1+mdict[k]\n has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L120_C16", "label": "assign", "type": "assigned_variable", "loc": [120, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L119_C12", "vector": [14, 4, 0.2362, 0.002, 4, 0.34, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mdict[k] = 1+mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L121_C16", "label": "has_stored =", "type": "assigned_variable", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L119_C12", "vector": [14, 4, 0.2382, 0.002, 4, 0.34, 1.0, 586, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "has_stored", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_stored = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "vector": [4, 2, 0.2411, 0.0039, 2, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not has_stored:\n mdict[s] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L123_C12", "label": "assign", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L122_C8", "vector": [14, 3, 0.2421, 0.002, 3, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mdict[s] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L126_C4", "label": "max_key =", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [14, 1, 0.248, 0.002, 1, 0.88, 0.2857, 20, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "max_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_key = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L127_C4", "label": "max_count =", "type": "assigned_variable", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [14, 1, 0.25, 0.002, 1, 0.88, 0.4286, 632, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L128_C4", "label": "keys = keys()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [14, 1, 0.252, 0.002, 1, 0.88, 0.5714, 204, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "keys", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " keys = mdict.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L129_C4", "label": "sort()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [8, 1, 0.2539, 0.002, 1, 0.88, 0.7143, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " keys.sort() # sorting these keys gives determinism to the classifier"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L130_C4", "label": "for k", "type": "for", "loc": [130, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [6, 1, 0.2589, 0.0079, 1, 0.88, 0.8571, 954, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in keys:\n if mdict[k] > max_count:\n max_key = k\n max_count = mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L131_C8", "label": "if", "type": "if", "loc": [131, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L130_C4", "vector": [4, 2, 0.2598, 0.0059, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mdict[k] > max_count:\n max_key = k\n max_count = mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L132_C12", "label": "max_key =", "type": "assigned_variable", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L131_C8", "vector": [14, 3, 0.2598, 0.002, 3, 0.59, 0.0, 20, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_key = k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L133_C12", "label": "max_count =", "type": "assigned_variable", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L131_C8", "vector": [14, 3, 0.2618, 0.002, 3, 0.59, 1.0, 632, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_count = mdict[k]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L135_C4", "label": "return", "type": "return", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "vector": [13, 1, 0.2657, 0.002, 1, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return max_key, mdict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "label": "min_entropy_split", "type": "function", "loc": [142, 162], "level": 0, "parent": null, "vector": [2, 0, 0.2992, 0.0413, 0, 0.66, 0.6667, 938, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "min_entropy_split", "arg_names": ["dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def min_entropy_split(dataset):\n #print 'in min_entropy_split'\n # Assume inputs are continuous, and are column vectors.\n hypotheses = []\n entropies = []\n # For each attribute find the best split point.\n for attribute in xrange(dataset.num_attributes()):\n values = ds.unique_values(dataset.inputs, attribute)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L145_C4", "label": "hypotheses =", "type": "assigned_variable", "loc": [145, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "vector": [14, 1, 0.2854, 0.002, 1, 0.16, 0.0, 121, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "hypotheses", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " hypotheses = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L146_C4", "label": "entropies =", "type": "assigned_variable", "loc": [146, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "vector": [14, 1, 0.2874, 0.002, 1, 0.16, 0.2, 411, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "entropies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " entropies = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L148_C4", "label": "for attribute", "type": "for", "loc": [148, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "vector": [6, 1, 0.3012, 0.0217, 1, 0.16, 0.4, 355, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "attribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for attribute in xrange(dataset.num_attributes()):\n values = ds.unique_values(dataset.inputs, attribute)\n #Iterate over the possible values of split & calculate entropy for each split.\n for split_point in values:\n def calc_entropy(data_set):\n num_points = data_set.num_examples()\n #return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()\n return (num_points / float(dataset.num_examples())) * ds.dataset_entropy_discrete(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L149_C8", "label": "values = unique_values()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L148_C4", "vector": [14, 2, 0.2933, 0.002, 2, 0.73, 0.0, 721, 3, 2, 0, 0, 921, 10, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "unique_values", "annotation": ""}, "snippet": " values = ds.unique_values(dataset.inputs, attribute)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "label": "for split_point", "type": "for", "loc": [151, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L148_C4", "vector": [6, 2, 0.3041, 0.0157, 2, 0.73, 1.0, 645, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "split_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for split_point in values:\n def calc_entropy(data_set):\n num_points = data_set.num_examples()\n #return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()\n return (num_points / float(dataset.num_examples())) * ds.dataset_entropy_discrete(dataset)\n split_entropy = map(calc_entropy, ds.split_continuous(dataset, attribute, split_point))\n hypotheses.append((attribute, split_point))\n entropies.append(sum(split_entropy))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L152_C12", "label": "calc_entropy", "type": "function", "loc": [152, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "vector": [2, 3, 0.3022, 0.0079, 3, 0.66, 0.0, 853, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "calc_entropy", "arg_names": ["data_set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def calc_entropy(data_set):\n num_points = data_set.num_examples()\n #return (num_points / float(dataset.num_examples())) * data_set.entropy_discrete()\n return (num_points / float(dataset.num_examples())) * ds.dataset_entropy_discrete(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L153_C16", "label": "num_points = num_examples()", "type": "assigned_variable", "loc": [153, 153], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L152_C12", "vector": [14, 4, 0.3012, 0.002, 4, 0.69, 0.0, 754, 3, 0, 0, 0, 12, 10, 1], "semantic": {"name": "num_points", "arg_names": [], "import_names": [], "rhs_call_name": "num_examples", "annotation": ""}, "snippet": " num_points = data_set.num_examples()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L155_C16", "label": "return", "type": "return", "loc": [155, 155], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L152_C12", "vector": [13, 4, 0.3051, 0.002, 4, 0.69, 1.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (num_points / float(dataset.num_examples())) * ds.dataset_entropy_discrete(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L156_C12", "label": "split_entropy = map()", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "vector": [14, 3, 0.3071, 0.002, 3, 0.66, 0.3333, 152, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "split_entropy", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " split_entropy = map(calc_entropy, ds.split_continuous(dataset, attribute, split_point))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L157_C12", "label": "append()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "vector": [8, 3, 0.3091, 0.002, 3, 0.66, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " hypotheses.append((attribute, split_point))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L158_C12", "label": "append()", "type": "expression", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "vector": [8, 3, 0.311, 0.002, 3, 0.66, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " entropies.append(sum(split_entropy))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L160_C4", "label": "entropies = matrix()", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "vector": [14, 1, 0.315, 0.002, 1, 0.16, 0.6, 411, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "entropies", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " entropies = np.matrix(entropies)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L161_C4", "label": "min_idx = argmin()", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "vector": [14, 1, 0.3169, 0.002, 1, 0.16, 0.8, 912, 3, 1, 0, 0, 879, 10, 1], "semantic": {"name": "min_idx", "arg_names": [], "import_names": [], "rhs_call_name": "argmin", "annotation": ""}, "snippet": " min_idx = np.argmin(entropies)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L162_C4", "label": "return", "type": "return", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "vector": [13, 1, 0.3189, 0.002, 1, 0.16, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hypotheses[min_idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "label": "random_subset", "type": "function", "loc": [164, 171], "level": 0, "parent": null, "vector": [2, 0, 0.3297, 0.0157, 0, 0.66, 0.7143, 299, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "random_subset", "arg_names": ["subset_size", "total_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_subset(subset_size, total_size):\n #print 'in random_subset'\n assert(subset_size <= total_size)\n occupancy = np.matrix(np.zeros((1, total_size)))\n while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1\n rows, columns = np.where(occupancy > 0)\n return columns.A[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L167_C4", "label": "occupancy = matrix()", "type": "assigned_variable", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "vector": [14, 1, 0.3287, 0.002, 1, 0.69, 0.0, 689, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "occupancy", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " occupancy = np.matrix(np.zeros((1, total_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L168_C4", "label": "while", "type": "while", "loc": [168, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "vector": [5, 1, 0.3317, 0.0039, 1, 0.69, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L169_C8", "label": "assign", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L168_C4", "vector": [14, 2, 0.3327, 0.002, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L170_C4", "label": "rows, columns = where()", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "vector": [14, 1, 0.3346, 0.002, 1, 0.69, 0.6667, 804, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "rows, columns", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " rows, columns = np.where(occupancy > 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L171_C4", "label": "return", "type": "return", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "vector": [13, 1, 0.3366, 0.002, 1, 0.69, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return columns.A[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "label": "split_random_subset", "type": "function", "loc": [173, 181], "level": 0, "parent": null, "vector": [2, 0, 0.3484, 0.0177, 0, 0.66, 0.7619, 318, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "split_random_subset", "arg_names": ["subset_size", "total_size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split_random_subset(subset_size, total_size):\n assert(subset_size <= total_size)\n occupancy = np.matrix(np.zeros((1, total_size)))\n while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1\n bool_sel = occupancy > 0\n rows, columns_subset = np.where(bool_sel)\n rows, columns_remaining = np.where(np.invert(bool_sel))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L175_C4", "label": "occupancy = matrix()", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "vector": [14, 1, 0.3445, 0.002, 1, 0.47, 0.0, 689, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "occupancy", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " occupancy = np.matrix(np.zeros((1, total_size)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L176_C4", "label": "while", "type": "while", "loc": [176, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "vector": [5, 1, 0.3474, 0.0039, 1, 0.47, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while occupancy.sum() < subset_size:\n occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L177_C8", "label": "assign", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L176_C4", "vector": [14, 2, 0.3484, 0.002, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 1, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " occupancy[0, np.random.randint(0, total_size)] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L178_C4", "label": "bool_sel =", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "vector": [14, 1, 0.3504, 0.002, 1, 0.47, 0.4, 551, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "bool_sel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bool_sel = occupancy > 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L179_C4", "label": "rows, columns_subset = where()", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "vector": [14, 1, 0.3524, 0.002, 1, 0.47, 0.6, 67, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "rows, columns_subset", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " rows, columns_subset = np.where(bool_sel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L180_C4", "label": "rows, columns_remaining = where()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "vector": [14, 1, 0.3543, 0.002, 1, 0.47, 0.8, 295, 3, 1, 0, 0, 169, 10, 2], "semantic": {"name": "rows, columns_remaining", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " rows, columns_remaining = np.where(np.invert(bool_sel))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L181_C4", "label": "return", "type": "return", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "vector": [13, 1, 0.3563, 0.002, 1, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return columns_subset.A[0], columns_remaining.A[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "label": "random_subset_split", "type": "function", "loc": [185, 191], "level": 0, "parent": null, "vector": [2, 0, 0.3701, 0.0138, 0, 0.66, 0.8095, 219, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "random_subset_split", "arg_names": ["num_subset", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def random_subset_split(num_subset, dataset):\n #print 'in random_subset_split'\n #print 'num_subset', num_subset, dataset, 'dataset.input.shape', dataset.inputs.shape\n subset_indexes = random_subset(num_subset, dataset.num_attributes())\n sub_dataset = Dataset(dataset.inputs[subset_indexes,:], dataset.outputs)\n attribute, point = min_entropy_split(sub_dataset)\n return subset_indexes[attribute], point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L188_C4", "label": "subset_indexes = random_subset()", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "vector": [14, 1, 0.3701, 0.002, 1, 0.26, 0.0, 403, 3, 2, 0, 0, 299, 10, 2], "semantic": {"name": "subset_indexes", "arg_names": [], "import_names": [], "rhs_call_name": "random_subset", "annotation": ""}, "snippet": " subset_indexes = random_subset(num_subset, dataset.num_attributes())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L189_C4", "label": "sub_dataset = Dataset()", "type": "assigned_variable", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "vector": [14, 1, 0.372, 0.002, 1, 0.26, 0.3333, 430, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "sub_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " sub_dataset = Dataset(dataset.inputs[subset_indexes,:], dataset.outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L190_C4", "label": "attribute, point = min_entropy_split()", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "vector": [14, 1, 0.374, 0.002, 1, 0.26, 0.6667, 912, 3, 1, 0, 0, 938, 10, 1], "semantic": {"name": "attribute, point", "arg_names": [], "import_names": [], "rhs_call_name": "min_entropy_split", "annotation": ""}, "snippet": " attribute, point = min_entropy_split(sub_dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L191_C4", "label": "return", "type": "return", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "vector": [13, 1, 0.376, 0.002, 1, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return subset_indexes[attribute], point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "label": "totally_random_split", "type": "function", "loc": [193, 197], "level": 0, "parent": null, "vector": [2, 0, 0.3839, 0.0098, 0, 0.66, 0.8571, 958, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "totally_random_split", "arg_names": ["dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def totally_random_split(dataset):\n #print 'totally random'\n attr = np.random.randint(0, dataset.num_attributes())\n split_pt = dataset.inputs[attr, np.random.randint(0, dataset.num_examples())]\n return attr, split_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L195_C4", "label": "attr = randint()", "type": "assigned_variable", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "vector": [14, 1, 0.3839, 0.002, 1, 0.19, 0.0, 400, 3, 2, 0, 0, 449, 10, 2], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "randint", "annotation": ""}, "snippet": " attr = np.random.randint(0, dataset.num_attributes())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L196_C4", "label": "split_pt =", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "vector": [14, 1, 0.3858, 0.002, 1, 0.19, 0.5, 44, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "split_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " split_pt = dataset.inputs[attr, np.random.randint(0, dataset.num_examples())]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L197_C4", "label": "return", "type": "return", "loc": [197, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "vector": [13, 1, 0.3878, 0.002, 1, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return attr, split_pt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "label": "DecisionTree", "type": "class", "loc": [201, 268], "level": 0, "parent": null, "vector": [3, 0, 0.4616, 0.1339, 0, 0.66, 0.9048, 890, 0, 7, 0, 0, 0, 0, 20], "semantic": {"name": "DecisionTree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DecisionTree:\n\n def __init__(self, dataset=None, splitting_func=min_entropy_split):\n self.children = None\n self.prediction = None\n if dataset is not None:\n self.train(dataset, splitting_func=splitting_func)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "label": "__init__", "type": "function", "loc": [203, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "vector": [2, 1, 0.4035, 0.0098, 1, 0.26, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "dataset", "splitting_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, dataset=None, splitting_func=min_entropy_split):\n self.children = None\n self.prediction = None\n if dataset is not None:\n self.train(dataset, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L204_C8", "label": "self.children =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "vector": [14, 2, 0.4016, 0.002, 2, 0.69, 0.0, 278, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L205_C8", "label": "self.prediction =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "vector": [14, 2, 0.4035, 0.002, 2, 0.69, 0.5, 683, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L206_C8", "label": "if", "type": "if", "loc": [206, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "vector": [4, 2, 0.4065, 0.0039, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dataset is not None:\n self.train(dataset, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L207_C12", "label": "train()", "type": "expression", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L206_C8", "vector": [8, 3, 0.4075, 0.002, 3, 0.0, 0.0, 371, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": " self.train(dataset, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L209_C4", "label": "train", "type": "function", "loc": [209, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "vector": [2, 1, 0.4262, 0.0315, 1, 0.26, 0.2, 371, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "train", "arg_names": ["self", "dataset", "splitting_func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def train(self, dataset, splitting_func=min_entropy_split):\n if not self.make_leaf(dataset):\n #print 'in train.splitting', dataset.num_examples()\n self.split_attribute, self.split_point = splitting_func(dataset)\n #print 'self.split_attribute, self.split_point', self.split_attribute, self.split_point \n data_sets = ds.split_continuous(dataset, self.split_attribute, self.split_point)\n if len(data_sets) < 2:\n self.prediction = dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "label": "if", "type": "if", "loc": [210, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L209_C4", "vector": [4, 2, 0.4272, 0.0295, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.make_leaf(dataset):\n #print 'in train.splitting', dataset.num_examples()\n self.split_attribute, self.split_point = splitting_func(dataset)\n #print 'self.split_attribute, self.split_point', self.split_attribute, self.split_point \n data_sets = ds.split_continuous(dataset, self.split_attribute, self.split_point)\n if len(data_sets) < 2:\n self.prediction = dataset.outputs\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L212_C12", "label": " = splitting_func()", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "vector": [14, 3, 0.4173, 0.002, 3, 0.28, 0.0, 0, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "splitting_func", "annotation": ""}, "snippet": " self.split_attribute, self.split_point = splitting_func(dataset)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L214_C12", "label": "data_sets = split_continuous()", "type": "assigned_variable", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "vector": [14, 3, 0.4213, 0.002, 3, 0.28, 0.2, 883, 3, 3, 0, 0, 193, 10, 1], "semantic": {"name": "data_sets", "arg_names": [], "import_names": [], "rhs_call_name": "split_continuous", "annotation": ""}, "snippet": " data_sets = ds.split_continuous(dataset, self.split_attribute, self.split_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L215_C12", "label": "if", "type": "if", "loc": [215, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "vector": [4, 3, 0.4252, 0.0059, 3, 0.28, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(data_sets) < 2:\n self.prediction = dataset.outputs\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L216_C16", "label": "self.prediction =", "type": "assigned_variable", "loc": [216, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L215_C12", "vector": [14, 4, 0.4252, 0.002, 4, 0.18, 0.0, 683, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L217_C16", "label": "return", "type": "return", "loc": [217, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L215_C12", "vector": [13, 4, 0.4272, 0.002, 4, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L219_C12", "label": "tree_split", "type": "function", "loc": [219, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "vector": [2, 3, 0.4331, 0.0059, 3, 0.28, 0.6, 809, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "tree_split", "arg_names": ["set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tree_split(set):\n #print 'tree', set.num_examples()\n return DecisionTree(set, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L221_C16", "label": "return", "type": "return", "loc": [221, 221], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L219_C12", "vector": [13, 4, 0.435, 0.002, 4, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DecisionTree(set, splitting_func=splitting_func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L223_C12", "label": "tests = create_binary_tests()", "type": "assigned_variable", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "vector": [14, 3, 0.439, 0.002, 3, 0.28, 0.8, 416, 3, 2, 0, 0, 583, 10, 1], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "create_binary_tests", "annotation": ""}, "snippet": " tests = create_binary_tests(self.split_attribute, self.split_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L224_C12", "label": "self.children = zip()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "vector": [14, 3, 0.4409, 0.002, 3, 0.28, 1.0, 278, 3, 2, 0, 0, 814, 10, 2], "semantic": {"name": "self.children", "arg_names": [], "import_names": [], "rhs_call_name": "zip", "annotation": ""}, "snippet": " self.children = zip(tests, map(tree_split, data_sets))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L226_C4", "label": "make_leaf", "type": "function", "loc": [226, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "vector": [2, 1, 0.4547, 0.0217, 1, 0.26, 0.4, 59, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "make_leaf", "arg_names": ["self", "dataset"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_leaf(self, dataset):\n if np.all(dataset.outputs[:,0] == dataset.outputs):\n self.prediction = dataset.outputs[:,0]\n #print 'leaf'\n return True\n elif np.all(dataset.inputs[:,0] == dataset.inputs):\n self.prediction = dataset.outputs\n #print 'leaf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "label": "if", "type": "if", "loc": [227, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L226_C4", "vector": [4, 2, 0.4557, 0.0197, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(dataset.outputs[:,0] == dataset.outputs):\n self.prediction = dataset.outputs[:,0]\n #print 'leaf'\n return True\n elif np.all(dataset.inputs[:,0] == dataset.inputs):\n self.prediction = dataset.outputs\n #print 'leaf'\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L228_C12", "label": "self.prediction =", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "vector": [14, 3, 0.4488, 0.002, 3, 0.57, 0.0, 683, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = dataset.outputs[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L230_C12", "label": "return", "type": "return", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "vector": [13, 3, 0.4528, 0.002, 3, 0.57, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "label": "if", "type": "if", "loc": [231, 236], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "vector": [4, 3, 0.4596, 0.0118, 3, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif np.all(dataset.inputs[:,0] == dataset.inputs):\n self.prediction = dataset.outputs\n #print 'leaf'\n return True\n else:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L232_C12", "label": "self.prediction =", "type": "assigned_variable", "loc": [232, 232], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "vector": [14, 4, 0.4567, 0.002, 4, 0.85, 0.0, 683, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.prediction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.prediction = dataset.outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L234_C12", "label": "return", "type": "return", "loc": [234, 234], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "vector": [13, 4, 0.4606, 0.002, 4, 0.85, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L236_C12", "label": "return", "type": "return", "loc": [236, 236], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "vector": [13, 4, 0.4646, 0.002, 4, 0.85, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L238_C4", "label": "predict", "type": "function", "loc": [238, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "vector": [2, 1, 0.4833, 0.0315, 1, 0.26, 0.6, 127, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "predict", "arg_names": ["self", "input"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def predict(self, input):\n if self.prediction is not None:\n return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]\n else:\n for test, child in self.children:\n test_func_name, attribute, threshold = test\n if test_func_name == 'binary_less_than':\n test_func = binary_less_than"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L239_C8", "label": "if", "type": "if", "loc": [239, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L238_C4", "vector": [4, 2, 0.4843, 0.0295, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.prediction is not None:\n return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]\n else:\n for test, child in self.children:\n test_func_name, attribute, threshold = test\n if test_func_name == 'binary_less_than':\n test_func = binary_less_than\n elif test_func_name == 'binary_greater_than':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L240_C12", "label": "return", "type": "return", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L239_C8", "vector": [13, 3, 0.4724, 0.002, 3, 0.23, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.prediction[:, np.random.randint(0, self.prediction.shape[1])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "label": "for test, child", "type": "for", "loc": [242, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L239_C8", "vector": [6, 3, 0.4862, 0.0217, 3, 0.23, 1.0, 419, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "test, child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test, child in self.children:\n test_func_name, attribute, threshold = test\n if test_func_name == 'binary_less_than':\n test_func = binary_less_than\n elif test_func_name == 'binary_greater_than':\n test_func = binary_greater_than\n else:\n rospy.logerr(\"DecisionTree bad function name : %s\" % "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L243_C16", "label": "test_func_name, attribute, threshold =", "type": "assigned_variable", "loc": [243, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "vector": [14, 4, 0.4783, 0.002, 4, 0.15, 0.0, 12, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_func_name, attribute, threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_func_name, attribute, threshold = test"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L244_C16", "label": "if", "type": "if", "loc": [244, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "vector": [4, 4, 0.4862, 0.0138, 4, 0.15, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_func_name == 'binary_less_than':\n test_func = binary_less_than\n elif test_func_name == 'binary_greater_than':\n test_func = binary_greater_than\n else:\n rospy.logerr(\"DecisionTree bad function name : %s\" % \n test_func_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L245_C20", "label": "test_func =", "type": "assigned_variable", "loc": [245, 245], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L244_C16", "vector": [14, 5, 0.4823, 0.002, 5, 0.86, 0.0, 100, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_func = binary_less_than"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L246_C16", "label": "if", "type": "if", "loc": [246, 250], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L244_C16", "vector": [4, 5, 0.4882, 0.0098, 5, 0.86, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif test_func_name == 'binary_greater_than':\n test_func = binary_greater_than\n else:\n rospy.logerr(\"DecisionTree bad function name : %s\" % \n test_func_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L247_C20", "label": "test_func =", "type": "assigned_variable", "loc": [247, 247], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L246_C16", "vector": [14, 6, 0.4862, 0.002, 6, 0.16, 0.0, 100, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test_func", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_func = binary_greater_than"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L249_C20", "label": "logerr()", "type": "expression", "loc": [249, 250], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L246_C16", "vector": [8, 6, 0.4911, 0.0039, 6, 0.16, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr(\"DecisionTree bad function name : %s\" % \n test_func_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L251_C16", "label": "if", "type": "if", "loc": [251, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "vector": [4, 4, 0.4951, 0.0039, 4, 0.15, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_func(attribute, threshold, input):\n return child.predict(input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L252_C20", "label": "return", "type": "return", "loc": [252, 252], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L251_C16", "vector": [13, 5, 0.4961, 0.002, 5, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return child.predict(input)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L257_C4", "label": "transform_input", "type": "function", "loc": [257, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "vector": [2, 1, 0.5069, 0.0039, 1, 0.26, 0.8, 639, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "transform_input", "arg_names": ["self", "input", "tree"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_input(self, input, tree=None):\n return input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L258_C8", "label": "return", "type": "return", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L257_C4", "vector": [13, 2, 0.5079, 0.002, 2, 0.83, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return input"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "label": "get_tree_depth", "type": "function", "loc": [260, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "vector": [2, 1, 0.5197, 0.0177, 1, 0.26, 1.0, 383, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_tree_depth", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_tree_depth(self):\n if self.prediction is not None:\n return 1\n\n depths = []\n for test, child in self.children:\n depths.append(child.get_tree_depth() + 1)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L261_C8", "label": "if", "type": "if", "loc": [261, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "vector": [4, 2, 0.5148, 0.0039, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.prediction is not None:\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L262_C12", "label": "return", "type": "return", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L261_C8", "vector": [13, 3, 0.5157, 0.002, 3, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L264_C8", "label": "depths =", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "vector": [14, 2, 0.5197, 0.002, 2, 0.73, 0.3333, 206, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "depths", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " depths = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L265_C8", "label": "for test, child", "type": "for", "loc": [265, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "vector": [6, 2, 0.5226, 0.0039, 2, 0.73, 0.6667, 419, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "test, child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test, child in self.children:\n depths.append(child.get_tree_depth() + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L266_C12", "label": "append()", "type": "expression", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L265_C8", "vector": [8, 3, 0.5236, 0.002, 3, 0.8, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " depths.append(child.get_tree_depth() + 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L268_C8", "label": "return", "type": "return", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "vector": [13, 2, 0.5276, 0.002, 2, 0.73, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return max(depths)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "label": "evaluate_classifier", "type": "function", "loc": [278, 378], "level": 0, "parent": null, "vector": [2, 0, 0.6457, 0.1988, 0, 0.66, 0.9524, 233, 0, 6, 0, 0, 0, 0, 67], "semantic": {"name": "evaluate_classifier", "arg_names": ["building_func", "data", "times", "percentage", "extra_args", "test_pca"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def evaluate_classifier(building_func, data, times=10.0, percentage=None, extra_args={}, test_pca=False):\n print('evaluate_classifier: extra_args', extra_args)\n total_pts = data.num_examples()\n testing_errors = []\n training_errors = []\n build_times = []\n classification_times = []\n for i in range(times):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L279_C4", "label": "print()", "type": "expression", "loc": [279, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [8, 1, 0.5492, 0.002, 1, 0.72, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('evaluate_classifier: extra_args', extra_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L280_C4", "label": "total_pts = num_examples()", "type": "assigned_variable", "loc": [280, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [14, 1, 0.5512, 0.002, 1, 0.72, 0.0909, 34, 3, 0, 0, 0, 12, 10, 1], "semantic": {"name": "total_pts", "arg_names": [], "import_names": [], "rhs_call_name": "num_examples", "annotation": ""}, "snippet": " total_pts = data.num_examples()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L281_C4", "label": "testing_errors =", "type": "assigned_variable", "loc": [281, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [14, 1, 0.5531, 0.002, 1, 0.72, 0.1818, 292, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "testing_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " testing_errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L282_C4", "label": "training_errors =", "type": "assigned_variable", "loc": [282, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [14, 1, 0.5551, 0.002, 1, 0.72, 0.2727, 28, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "training_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " training_errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L283_C4", "label": "build_times =", "type": "assigned_variable", "loc": [283, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [14, 1, 0.5571, 0.002, 1, 0.72, 0.3636, 845, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "build_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " build_times = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L284_C4", "label": "classification_times =", "type": "assigned_variable", "loc": [284, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [14, 1, 0.5591, 0.002, 1, 0.72, 0.4545, 709, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "classification_times", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " classification_times = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "label": "for i", "type": "for", "loc": [285, 369], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [6, 1, 0.6437, 0.1673, 1, 0.72, 0.5455, 826, 3, 0, 0, 0, 0, 0, 57], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(times):\n if percentage == None:\n percentage = (i+1)/times\n num_examples = int(round(total_pts*percentage))\n print('Evaluate classifier built with', percentage*100, '% data, num examples', num_examples)\n subset, unselected = split_random_subset(num_examples, total_pts)\n i = data.inputs[:, subset]\n o = data.outputs[:, subset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L286_C8", "label": "if", "type": "if", "loc": [286, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [4, 2, 0.564, 0.0039, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if percentage == None:\n percentage = (i+1)/times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L287_C12", "label": "percentage =", "type": "assigned_variable", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L286_C8", "vector": [14, 3, 0.565, 0.002, 3, 0.26, 0.0, 568, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "percentage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percentage = (i+1)/times"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L288_C8", "label": "num_examples = int()", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.5669, 0.002, 2, 0.98, 0.0385, 12, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "num_examples", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " num_examples = int(round(total_pts*percentage))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L289_C8", "label": "print()", "type": "expression", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.5689, 0.002, 2, 0.98, 0.0769, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Evaluate classifier built with', percentage*100, '% data, num examples', num_examples)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L290_C8", "label": "subset, unselected = split_random_subset()", "type": "assigned_variable", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.5709, 0.002, 2, 0.98, 0.1154, 565, 3, 2, 0, 0, 318, 10, 1], "semantic": {"name": "subset, unselected", "arg_names": [], "import_names": [], "rhs_call_name": "split_random_subset", "annotation": ""}, "snippet": " subset, unselected = split_random_subset(num_examples, total_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L291_C8", "label": "i =", "type": "assigned_variable", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.5728, 0.002, 2, 0.98, 0.1538, 826, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = data.inputs[:, subset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L292_C8", "label": "o =", "type": "assigned_variable", "loc": [292, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.5748, 0.002, 2, 0.98, 0.1923, 926, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "o", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " o = data.outputs[:, subset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L293_C8", "label": "print()", "type": "expression", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.5768, 0.002, 2, 0.98, 0.2308, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Building classifier...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "label": "if", "type": "if", "loc": [294, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [4, 2, 0.5866, 0.0177, 2, 0.98, 0.2692, 0, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pca:\n print(' TESTING PCA')\n import dimreduce as dr\n subseted_dataset = dr.LinearDimReduceDataset(i,o)\n subseted_dataset.set_projection_vectors(dr.pca_vectors(subseted_dataset.inputs, percent_variance=.95))\n subseted_dataset.reduce_input()\n print('subseted_dataset.num_attributes(), subseted_dataset.num_examples()', subseted_dataset.num_attributes(), subseted_dataset.num_examples())\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L295_C12", "label": "print()", "type": "expression", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [8, 3, 0.5807, 0.002, 3, 0.08, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(' TESTING PCA')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L296_C12", "label": "dimreduce import dr", "type": "import", "loc": [296, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [1, 3, 0.5827, 0.002, 3, 0.08, 0.1667, 169, 0, 1, 0, 0, 169, 0, 0], "semantic": {"name": "dimreduce", "arg_names": [], "import_names": ["dr"], "rhs_call_name": "", "annotation": ""}, "snippet": " import dimreduce as dr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L297_C12", "label": "subseted_dataset = LinearDimReduceDataset()", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [14, 3, 0.5846, 0.002, 3, 0.08, 0.3333, 184, 3, 2, 0, 0, 44, 10, 1], "semantic": {"name": "subseted_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "LinearDimReduceDataset", "annotation": ""}, "snippet": " subseted_dataset = dr.LinearDimReduceDataset(i,o)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L298_C12", "label": "set_projection_vectors()", "type": "expression", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [8, 3, 0.5866, 0.002, 3, 0.08, 0.5, 443, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_projection_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "set_projection_vectors", "annotation": ""}, "snippet": " subseted_dataset.set_projection_vectors(dr.pca_vectors(subseted_dataset.inputs, percent_variance=.95))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L299_C12", "label": "reduce_input()", "type": "expression", "loc": [299, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [8, 3, 0.5886, 0.002, 3, 0.08, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reduce_input", "arg_names": [], "import_names": [], "rhs_call_name": "reduce_input", "annotation": ""}, "snippet": " subseted_dataset.reduce_input()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L300_C12", "label": "print()", "type": "expression", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [8, 3, 0.5906, 0.002, 3, 0.08, 0.8333, 535, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('subseted_dataset.num_attributes(), subseted_dataset.num_examples()', subseted_dataset.num_attributes(), subseted_dataset.num_examples())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L302_C12", "label": "subseted_dataset = Dataset()", "type": "assigned_variable", "loc": [302, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "vector": [14, 3, 0.5945, 0.002, 3, 0.08, 1.0, 184, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "subseted_dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " subseted_dataset = Dataset(i,o)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L304_C8", "label": "start_time = time()", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.5984, 0.002, 2, 0.98, 0.3077, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L305_C8", "label": "classifier = building_func()", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.6004, 0.002, 2, 0.98, 0.3462, 71, 3, 2, 0, 0, 302, 10, 1], "semantic": {"name": "classifier", "arg_names": [], "import_names": [], "rhs_call_name": "building_func", "annotation": ""}, "snippet": " classifier = building_func(subseted_dataset, **extra_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L306_C8", "label": "append()", "type": "expression", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.6024, 0.002, 2, 0.98, 0.3846, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " build_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L307_C8", "label": "print()", "type": "expression", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.6043, 0.002, 2, 0.98, 0.4231, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"done building...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L312_C8", "label": "count_selected =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.6142, 0.002, 2, 0.98, 0.4615, 286, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_selected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_selected = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "label": "for i, idx", "type": "for", "loc": [313, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [6, 2, 0.6299, 0.0295, 2, 0.98, 0.5, 506, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i, idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, idx in enumerate(subset):\n start_time = time.time()\n if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])\n\n classification_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L314_C12", "label": "start_time = time()", "type": "assigned_variable", "loc": [314, 314], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "vector": [14, 3, 0.6181, 0.002, 3, 0.04, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L315_C12", "label": "if", "type": "if", "loc": [315, 318], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "vector": [4, 3, 0.623, 0.0079, 3, 0.04, 0.2, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L316_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [316, 316], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L315_C12", "vector": [14, 4, 0.622, 0.002, 4, 0.99, 0.0, 612, 3, 1, 0, 0, 127, 10, 2], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L318_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [318, 318], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L315_C12", "vector": [14, 4, 0.626, 0.002, 4, 0.99, 1.0, 612, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L320_C12", "label": "append()", "type": "expression", "loc": [320, 320], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "vector": [8, 3, 0.6299, 0.002, 3, 0.04, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " classification_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L321_C12", "label": "true_val =", "type": "assigned_variable", "loc": [321, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "vector": [14, 3, 0.6319, 0.002, 3, 0.04, 0.6, 359, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "true_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " true_val = data.outputs[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L322_C12", "label": "if", "type": "if", "loc": [322, 325], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "vector": [4, 3, 0.6368, 0.0079, 3, 0.04, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prediction == true_val:\n count_selected.append(1)\n else:\n count_selected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L323_C16", "label": "append()", "type": "expression", "loc": [323, 323], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L322_C12", "vector": [8, 4, 0.6358, 0.002, 4, 0.59, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_selected.append(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L325_C16", "label": "append()", "type": "expression", "loc": [325, 325], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L322_C12", "vector": [8, 4, 0.6398, 0.002, 4, 0.59, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_selected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L326_C12", "label": "if", "type": "if", "loc": [326, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "vector": [4, 3, 0.6427, 0.0039, 3, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i%100 == 0:\n print(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L327_C16", "label": "print()", "type": "expression", "loc": [327, 327], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L326_C12", "vector": [8, 4, 0.6437, 0.002, 4, 0.4, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L328_C8", "label": "count_selected = matrix()", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.6457, 0.002, 2, 0.98, 0.5385, 286, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "count_selected", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " count_selected = np.matrix(count_selected)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L333_C8", "label": "confusion_matrix = dict()", "type": "assigned_variable", "loc": [333, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.6555, 0.002, 2, 0.98, 0.5769, 473, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "confusion_matrix", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " confusion_matrix = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L334_C8", "label": "count_unselected =", "type": "assigned_variable", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.6575, 0.002, 2, 0.98, 0.6154, 49, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "count_unselected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " count_unselected = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L335_C8", "label": "print()", "type": "expression", "loc": [335, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.6594, 0.002, 2, 0.98, 0.6538, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Total points', total_pts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "label": "for idx", "type": "for", "loc": [336, 355], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [6, 2, 0.6801, 0.0394, 2, 0.98, 0.6923, 187, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for idx in unselected:\n start_time = time.time()\n if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])\n classification_times.append(time.time() - start_time)\n true_val = data.outputs[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L337_C12", "label": "start_time = time()", "type": "assigned_variable", "loc": [337, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "vector": [14, 3, 0.6634, 0.002, 3, 0.1, 0.0, 511, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " start_time = time.time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L338_C12", "label": "if", "type": "if", "loc": [338, 341], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "vector": [4, 3, 0.6683, 0.0079, 3, 0.1, 0.2, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pca:\n prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))\n else:\n prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L339_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [339, 339], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L338_C12", "vector": [14, 4, 0.6673, 0.002, 4, 0.38, 0.0, 612, 3, 1, 0, 0, 127, 10, 2], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.reduce(data.inputs[:,idx]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L341_C16", "label": "prediction, _ = predict()", "type": "assigned_variable", "loc": [341, 341], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L338_C12", "vector": [14, 4, 0.6713, 0.002, 4, 0.38, 1.0, 612, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "prediction, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " prediction, _ = classifier.predict(data.inputs[:,idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L342_C12", "label": "append()", "type": "expression", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "vector": [8, 3, 0.6732, 0.002, 3, 0.1, 0.4, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " classification_times.append(time.time() - start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L343_C12", "label": "true_val =", "type": "assigned_variable", "loc": [343, 343], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "vector": [14, 3, 0.6752, 0.002, 3, 0.1, 0.6, 359, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "true_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " true_val = data.outputs[:,idx]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L344_C12", "label": "if", "type": "if", "loc": [344, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "vector": [4, 3, 0.6801, 0.0079, 3, 0.1, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prediction == true_val:\n count_unselected.append(1)\n else:\n count_unselected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L345_C16", "label": "append()", "type": "expression", "loc": [345, 345], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L344_C12", "vector": [8, 4, 0.6791, 0.002, 4, 0.58, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_unselected.append(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L347_C16", "label": "append()", "type": "expression", "loc": [347, 347], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L344_C12", "vector": [8, 4, 0.6831, 0.002, 4, 0.58, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " count_unselected.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "label": "if", "type": "if", "loc": [348, 355], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "vector": [4, 3, 0.6919, 0.0157, 3, 0.1, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confusion_matrix.has_key(true_val[0,0]):\n if confusion_matrix[true_val[0,0]].has_key(prediction[0,0]):\n confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1\n else:\n confusion_matrix[true_val[0,0]][prediction[0,0]] = 1\n else:\n confusion_matrix[true_val[0,0]] = dict()\n confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L349_C16", "label": "if", "type": "if", "loc": [349, 352], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "vector": [4, 4, 0.69, 0.0079, 4, 0.2, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if confusion_matrix[true_val[0,0]].has_key(prediction[0,0]):\n confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1\n else:\n confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L350_C20", "label": "assign", "type": "assigned_variable", "loc": [350, 350], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L349_C16", "vector": [14, 5, 0.689, 0.002, 5, 0.88, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]][prediction[0,0]] = confusion_matrix[true_val[0,0]][prediction[0,0]] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L352_C20", "label": "assign", "type": "assigned_variable", "loc": [352, 352], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L349_C16", "vector": [14, 5, 0.6929, 0.002, 5, 0.88, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L354_C16", "label": " = dict()", "type": "assigned_variable", "loc": [354, 354], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "vector": [14, 4, 0.6969, 0.002, 4, 0.2, 0.5, 0, 3, 0, 0, 0, 827, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]] = dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L355_C16", "label": "assign", "type": "assigned_variable", "loc": [355, 355], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "vector": [14, 4, 0.6988, 0.002, 4, 0.2, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " confusion_matrix[true_val[0,0]][prediction[0,0]] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L357_C8", "label": "training_error =", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.7028, 0.002, 2, 0.98, 0.7308, 397, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "training_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " training_error = 100.0 * np.sum(count_selected) / float(len(subset))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L358_C8", "label": "testing_error =", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [14, 2, 0.7047, 0.002, 2, 0.98, 0.7692, 939, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "testing_error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " testing_error = 100.0 * np.sum(count_unselected) / float(len(unselected))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L359_C8", "label": "append()", "type": "expression", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.7067, 0.002, 2, 0.98, 0.8077, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " testing_errors.append(testing_error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L360_C8", "label": "append()", "type": "expression", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.7087, 0.002, 2, 0.98, 0.8462, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " training_errors.append(training_error)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L361_C8", "label": "print()", "type": "expression", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.7106, 0.002, 2, 0.98, 0.8846, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Correct on training set', training_error, '%')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L362_C8", "label": "print()", "type": "expression", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.7126, 0.002, 2, 0.98, 0.9231, 535, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(' on testing set', testing_error, '%')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L363_C8", "label": "print()", "type": "expression", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [8, 2, 0.7146, 0.002, 2, 0.98, 0.9615, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Confusion')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "label": "for k", "type": "for", "loc": [364, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "vector": [6, 2, 0.7215, 0.0118, 2, 0.98, 1.0, 954, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k in confusion_matrix.keys():\n sum = 0.0\n for k2 in confusion_matrix[k]:\n sum = sum + confusion_matrix[k][k2]\n for k2 in confusion_matrix[k]:\n print('true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L365_C12", "label": "sum =", "type": "assigned_variable", "loc": [365, 365], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "vector": [14, 3, 0.7185, 0.002, 3, 0.79, 0.0, 824, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L366_C12", "label": "for k2", "type": "for", "loc": [366, 367], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "vector": [6, 3, 0.7215, 0.0039, 3, 0.79, 0.5, 482, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k2 in confusion_matrix[k]:\n sum = sum + confusion_matrix[k][k2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L367_C16", "label": "sum =", "type": "assigned_variable", "loc": [367, 367], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L366_C12", "vector": [14, 4, 0.7224, 0.002, 4, 0.01, 0.0, 824, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum = sum + confusion_matrix[k][k2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L368_C12", "label": "for k2", "type": "for", "loc": [368, 369], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "vector": [6, 3, 0.7254, 0.0039, 3, 0.79, 1.0, 482, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k2 in confusion_matrix[k]:\n print('true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L369_C16", "label": "print()", "type": "expression", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L368_C12", "vector": [8, 4, 0.7264, 0.002, 4, 0.69, 0.0, 535, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('true class', k, 'classified as', k2, 100.0 * (confusion_matrix[k][k2] / sum), '% of the time')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L371_C4", "label": "print_stats", "type": "function", "loc": [371, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [2, 1, 0.7323, 0.0059, 1, 0.72, 0.6364, 764, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "print_stats", "arg_names": ["name", "list_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_stats(name, list_data):\n m = np.matrix(list_data)\n print('%s: average %f std %f' % (name, m.mean(), np.std(m)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L372_C8", "label": "m = matrix()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L371_C4", "vector": [14, 2, 0.7323, 0.002, 2, 0.14, 0.0, 711, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " m = np.matrix(list_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L373_C8", "label": "print()", "type": "expression", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L371_C4", "vector": [8, 2, 0.7343, 0.002, 2, 0.14, 1.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%s: average %f std %f' % (name, m.mean(), np.std(m)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L375_C4", "label": "print_stats()", "type": "expression", "loc": [375, 375], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [8, 1, 0.7382, 0.002, 1, 0.72, 0.7273, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('training error', training_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L376_C4", "label": "print_stats()", "type": "expression", "loc": [376, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [8, 1, 0.7402, 0.002, 1, 0.72, 0.8182, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('testing error', testing_errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L377_C4", "label": "print_stats()", "type": "expression", "loc": [377, 377], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [8, 1, 0.7421, 0.002, 1, 0.72, 0.9091, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('build time', build_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L378_C4", "label": "print_stats()", "type": "expression", "loc": [378, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "vector": [8, 1, 0.7441, 0.002, 1, 0.72, 1.0, 764, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": " print_stats('classification time', classification_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "label": "if", "type": "if", "loc": [381, 506], "level": 0, "parent": null, "vector": [4, 0, 0.873, 0.248, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 80], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n test_iris = False\n test_pickle = False\n test_number_trees = False\n test_pca = False\n test_packing = False\n test_new_design = True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L382_C4", "label": "test_iris =", "type": "assigned_variable", "loc": [382, 382], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [14, 1, 0.752, 0.002, 1, 0.37, 0.0, 354, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_iris", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_iris = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L383_C4", "label": "test_pickle =", "type": "assigned_variable", "loc": [383, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [14, 1, 0.7539, 0.002, 1, 0.37, 0.0833, 507, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_pickle = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L384_C4", "label": "test_number_trees =", "type": "assigned_variable", "loc": [384, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [14, 1, 0.7559, 0.002, 1, 0.37, 0.1667, 359, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_number_trees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_number_trees = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L385_C4", "label": "test_pca =", "type": "assigned_variable", "loc": [385, 385], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [14, 1, 0.7579, 0.002, 1, 0.37, 0.25, 856, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_pca", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_pca = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L386_C4", "label": "test_packing =", "type": "assigned_variable", "loc": [386, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [14, 1, 0.7598, 0.002, 1, 0.37, 0.3333, 478, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_packing", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_packing = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L387_C4", "label": "test_new_design =", "type": "assigned_variable", "loc": [387, 387], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [14, 1, 0.7618, 0.002, 1, 0.37, 0.4167, 152, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "test_new_design", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test_new_design = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L389_C4", "label": "pickle import pk", "type": "import", "loc": [389, 389], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [1, 1, 0.7657, 0.002, 1, 0.37, 0.5, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pk"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pickle as pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "label": "save_pickle", "type": "function", "loc": [390, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [2, 1, 0.7707, 0.0079, 1, 0.37, 0.5833, 390, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "save_pickle", "arg_names": ["pickle", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_pickle(pickle, filename):\n p = open(filename, 'w')\n picklelicious = pk.dump(pickle, p)\n p.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L391_C8", "label": "p = open()", "type": "assigned_variable", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "vector": [14, 2, 0.7697, 0.002, 2, 0.04, 0.0, 491, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " p = open(filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L392_C8", "label": "picklelicious = dump()", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "vector": [14, 2, 0.7717, 0.002, 2, 0.04, 0.5, 536, 3, 2, 0, 0, 952, 10, 1], "semantic": {"name": "picklelicious", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " picklelicious = pk.dump(pickle, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L393_C8", "label": "close()", "type": "expression", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "vector": [8, 2, 0.7736, 0.002, 2, 0.04, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " p.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "label": "load_pickle", "type": "function", "loc": [394, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [2, 1, 0.7795, 0.0098, 1, 0.37, 0.6667, 65, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "load_pickle", "arg_names": ["filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_pickle(filename):\n p = open(filename, 'r')\n picklelicious = pk.load(p)\n p.close()\n return picklelicious"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L395_C8", "label": "p = open()", "type": "assigned_variable", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "vector": [14, 2, 0.7776, 0.002, 2, 0.32, 0.0, 491, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " p = open(filename, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L396_C8", "label": "picklelicious = load()", "type": "assigned_variable", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "vector": [14, 2, 0.7795, 0.002, 2, 0.32, 0.3333, 536, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "picklelicious", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " picklelicious = pk.load(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L397_C8", "label": "close()", "type": "expression", "loc": [397, 397], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "vector": [8, 2, 0.7815, 0.002, 2, 0.32, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " p.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L398_C8", "label": "return", "type": "return", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "vector": [13, 2, 0.7835, 0.002, 2, 0.32, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return picklelicious"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "label": "if", "type": "if", "loc": [400, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [4, 1, 0.7982, 0.0236, 1, 0.37, 0.75, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_iris:\n #Setup for repeated testing\n iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))\n inputs = np.float32(iris_array[:, 0:4]).T\n outputs = iris_array[:, 4].T\n dataset = Dataset(inputs, outputs)\n\n print('================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L402_C8", "label": "iris_array = matrix()", "type": "assigned_variable", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [14, 2, 0.7913, 0.002, 2, 0.61, 0.0, 112, 3, 1, 0, 0, 162, 10, 2], "semantic": {"name": "iris_array", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " iris_array = np.matrix(np.loadtxt('iris.data', dtype='|S30', delimiter=','))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L403_C8", "label": "inputs =", "type": "assigned_variable", "loc": [403, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [14, 2, 0.7933, 0.002, 2, 0.61, 0.1429, 226, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inputs = np.float32(iris_array[:, 0:4]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L404_C8", "label": "outputs =", "type": "assigned_variable", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [14, 2, 0.7953, 0.002, 2, 0.61, 0.2857, 451, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outputs = iris_array[:, 4].T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L405_C8", "label": "dataset = Dataset()", "type": "assigned_variable", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [14, 2, 0.7972, 0.002, 2, 0.61, 0.4286, 603, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " dataset = Dataset(inputs, outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L407_C8", "label": "print()", "type": "expression", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [8, 2, 0.8012, 0.002, 2, 0.61, 0.5714, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L408_C8", "label": "print()", "type": "expression", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [8, 2, 0.8031, 0.002, 2, 0.61, 0.7143, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Test DecisionTree\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L409_C8", "label": "evaluate_classifier()", "type": "expression", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [8, 2, 0.8051, 0.002, 2, 0.61, 0.8571, 233, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " evaluate_classifier(DecisionTree, dataset, 5, .9)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L411_C8", "label": "print()", "type": "expression", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "vector": [8, 2, 0.8091, 0.002, 2, 0.61, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "label": "if", "type": "if", "loc": [418, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [4, 1, 0.8514, 0.0591, 1, 0.37, 0.8333, 0, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_pickle:\n\n def print_separator(times=2):\n for i in xrange(times):\n print('===============================================================')\n\n dataset = load_pickle('PatchClassifier.dataset.pickle')\n #if test_pca:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L420_C8", "label": "print_separator", "type": "function", "loc": [420, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "vector": [2, 2, 0.8287, 0.0059, 2, 0.21, 0.0, 564, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print_separator", "arg_names": ["times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def print_separator(times=2):\n for i in xrange(times):\n print('===============================================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L421_C12", "label": "for i", "type": "for", "loc": [421, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L420_C8", "vector": [6, 3, 0.8297, 0.0039, 3, 0.8, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(times):\n print('===============================================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L422_C16", "label": "print()", "type": "expression", "loc": [422, 422], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L421_C12", "vector": [8, 4, 0.8307, 0.002, 4, 0.46, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('===============================================================')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L424_C8", "label": "dataset = load_pickle()", "type": "assigned_variable", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "vector": [14, 2, 0.8346, 0.002, 2, 0.21, 0.5, 603, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dataset", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dataset = load_pickle('PatchClassifier.dataset.pickle')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "label": "if", "type": "if", "loc": [430, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "vector": [4, 2, 0.8632, 0.0354, 2, 0.21, 1.0, 0, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_number_trees:\n tree_types = [RFBreiman, RFRandomInputSubset]\n #tree_types = [RFBreiman]\n for tree_type in tree_types:\n print_separator()\n print('Testing', tree_type)\n for i in range(10):\n print(tree_type, 'using', (i+1)*10, 'trees')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L431_C12", "label": "tree_types =", "type": "assigned_variable", "loc": [431, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "vector": [14, 3, 0.8484, 0.002, 3, 0.38, 0.0, 631, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tree_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree_types = [RFBreiman, RFRandomInputSubset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "label": "for tree_type", "type": "for", "loc": [433, 439], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "vector": [6, 3, 0.8583, 0.0138, 3, 0.38, 0.3333, 782, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "tree_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tree_type in tree_types:\n print_separator()\n print('Testing', tree_type)\n for i in range(10):\n print(tree_type, 'using', (i+1)*10, 'trees')\n evaluate_classifier(tree_type, dataset, 3, .95, \n extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L434_C16", "label": "print_separator()", "type": "expression", "loc": [434, 434], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "vector": [8, 4, 0.8543, 0.002, 4, 0.3, 0.0, 564, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "print_separator", "arg_names": [], "import_names": [], "rhs_call_name": "print_separator", "annotation": ""}, "snippet": " print_separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L435_C16", "label": "print()", "type": "expression", "loc": [435, 435], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "vector": [8, 4, 0.8563, 0.002, 4, 0.3, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Testing', tree_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L436_C16", "label": "for i", "type": "for", "loc": [436, 439], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "vector": [6, 4, 0.8612, 0.0079, 4, 0.3, 1.0, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(10):\n print(tree_type, 'using', (i+1)*10, 'trees')\n evaluate_classifier(tree_type, dataset, 3, .95, \n extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L437_C20", "label": "print()", "type": "expression", "loc": [437, 437], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L436_C16", "vector": [8, 5, 0.8602, 0.002, 5, 0.34, 0.0, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tree_type, 'using', (i+1)*10, 'trees')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L438_C20", "label": "evaluate_classifier()", "type": "expression", "loc": [438, 439], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L436_C16", "vector": [8, 5, 0.8632, 0.0039, 5, 0.34, 1.0, 233, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " evaluate_classifier(tree_type, dataset, 3, .95, \n extra_args={'number_of_learners': (i+1)*10}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L441_C12", "label": "tree_types =", "type": "assigned_variable", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "vector": [14, 3, 0.8681, 0.002, 3, 0.38, 0.6667, 631, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tree_types", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tree_types = [RFBreiman, RFRandomInputSubset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "label": "for tree_type", "type": "for", "loc": [443, 447], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "vector": [6, 3, 0.876, 0.0098, 3, 0.38, 1.0, 782, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tree_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tree_type in tree_types:\n print_separator()\n print(tree_type)\n evaluate_classifier(tree_type, dataset, 10, .95, \n extra_args={'number_of_learners': 70}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L444_C16", "label": "print_separator()", "type": "expression", "loc": [444, 444], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "vector": [8, 4, 0.874, 0.002, 4, 0.97, 0.0, 564, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "print_separator", "arg_names": [], "import_names": [], "rhs_call_name": "print_separator", "annotation": ""}, "snippet": " print_separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L445_C16", "label": "print()", "type": "expression", "loc": [445, 445], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "vector": [8, 4, 0.876, 0.002, 4, 0.97, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(tree_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L446_C16", "label": "evaluate_classifier()", "type": "expression", "loc": [446, 447], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "vector": [8, 4, 0.8789, 0.0039, 4, 0.97, 1.0, 233, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "evaluate_classifier", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate_classifier", "annotation": ""}, "snippet": " evaluate_classifier(tree_type, dataset, 10, .95, \n extra_args={'number_of_learners': 70}, test_pca=test_pca)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "label": "if", "type": "if", "loc": [448, 489], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [4, 1, 0.9222, 0.0827, 1, 0.37, 0.9167, 0, 2, 0, 0, 0, 0, 0, 37], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_packing:\n train = np.mat(np.random.rand(4, 20))\n resp = np.mat(np.round(np.random.rand(1, 20)))\n data = ds.Dataset(train, resp)\n dt = DecisionTree(data)\n packed = dt.pack_tree()\n print(packed)\n new_dt = DecisionTree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L449_C8", "label": "train = mat()", "type": "assigned_variable", "loc": [449, 449], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8839, 0.002, 2, 0.01, 0.0, 371, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " train = np.mat(np.random.rand(4, 20))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L450_C8", "label": "resp = mat()", "type": "assigned_variable", "loc": [450, 450], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8858, 0.002, 2, 0.01, 0.0588, 48, 3, 1, 0, 0, 882, 10, 3], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " resp = np.mat(np.round(np.random.rand(1, 20)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L451_C8", "label": "data = Dataset()", "type": "assigned_variable", "loc": [451, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8878, 0.002, 2, 0.01, 0.1176, 929, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " data = ds.Dataset(train, resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L452_C8", "label": "dt = DecisionTree()", "type": "assigned_variable", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8898, 0.002, 2, 0.01, 0.1765, 455, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "DecisionTree", "annotation": ""}, "snippet": " dt = DecisionTree(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L453_C8", "label": "packed = pack_tree()", "type": "assigned_variable", "loc": [453, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8917, 0.002, 2, 0.01, 0.2353, 321, 3, 0, 0, 0, 182, 10, 1], "semantic": {"name": "packed", "arg_names": [], "import_names": [], "rhs_call_name": "pack_tree", "annotation": ""}, "snippet": " packed = dt.pack_tree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L454_C8", "label": "print()", "type": "expression", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [8, 2, 0.8937, 0.002, 2, 0.01, 0.2941, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(packed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L455_C8", "label": "new_dt = DecisionTree()", "type": "assigned_variable", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8957, 0.002, 2, 0.01, 0.3529, 814, 3, 0, 0, 0, 890, 10, 1], "semantic": {"name": "new_dt", "arg_names": [], "import_names": [], "rhs_call_name": "DecisionTree", "annotation": ""}, "snippet": " new_dt = DecisionTree()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L456_C8", "label": "unpack_tree()", "type": "expression", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [8, 2, 0.8976, 0.002, 2, 0.01, 0.4118, 338, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unpack_tree", "arg_names": [], "import_names": [], "rhs_call_name": "unpack_tree", "annotation": ""}, "snippet": " new_dt.unpack_tree(packed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L457_C8", "label": "bad =", "type": "assigned_variable", "loc": [457, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.8996, 0.002, 2, 0.01, 0.4706, 297, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "bad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bad = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "label": "for i", "type": "for", "loc": [458, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [6, 2, 0.9114, 0.0217, 2, 0.01, 0.5294, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(500):\n np.random.seed(i)\n test = np.mat(np.random.rand(4, 1))\n np.random.seed(1)\n pred_old = dt.predict(test)\n np.random.seed(1)\n pred_new = new_dt.predict(test)\n if pred_old != pred_new:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L459_C12", "label": "seed()", "type": "expression", "loc": [459, 459], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [8, 3, 0.9035, 0.002, 3, 0.05, 0.0, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L460_C12", "label": "test = mat()", "type": "assigned_variable", "loc": [460, 460], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [14, 3, 0.9055, 0.002, 3, 0.05, 0.1667, 224, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " test = np.mat(np.random.rand(4, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L461_C12", "label": "seed()", "type": "expression", "loc": [461, 461], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [8, 3, 0.9075, 0.002, 3, 0.05, 0.3333, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L462_C12", "label": "pred_old = predict()", "type": "assigned_variable", "loc": [462, 462], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [14, 3, 0.9094, 0.002, 3, 0.05, 0.5, 897, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "pred_old", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " pred_old = dt.predict(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L463_C12", "label": "seed()", "type": "expression", "loc": [463, 463], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [8, 3, 0.9114, 0.002, 3, 0.05, 0.6667, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L464_C12", "label": "pred_new = predict()", "type": "assigned_variable", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [14, 3, 0.9134, 0.002, 3, 0.05, 0.8333, 635, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "pred_new", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " pred_new = new_dt.predict(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "label": "if", "type": "if", "loc": [465, 468], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "vector": [4, 3, 0.9183, 0.0079, 3, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pred_old != pred_new:\n print(\"Not same prediction:\")\n print(pred_old, pred_new)\n bad = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L466_C16", "label": "print()", "type": "expression", "loc": [466, 466], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "vector": [8, 4, 0.9173, 0.002, 4, 0.55, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Not same prediction:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L467_C16", "label": "print()", "type": "expression", "loc": [467, 467], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "vector": [8, 4, 0.9193, 0.002, 4, 0.55, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(pred_old, pred_new)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L468_C16", "label": "bad =", "type": "assigned_variable", "loc": [468, 468], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "vector": [14, 4, 0.9213, 0.002, 4, 0.55, 1.0, 297, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "bad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bad = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L469_C8", "label": "if", "type": "if", "loc": [469, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [4, 2, 0.9242, 0.0039, 2, 0.01, 0.5882, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not bad:\n print(\"Prediction tests successful!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L470_C12", "label": "print()", "type": "expression", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L469_C8", "vector": [8, 3, 0.9252, 0.002, 3, 0.61, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Prediction tests successful!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L472_C8", "label": "dt = RFBreiman()", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.9291, 0.002, 2, 0.01, 0.6471, 455, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "RFBreiman", "annotation": ""}, "snippet": " dt = RFBreiman(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L473_C8", "label": "packed = pack_rf()", "type": "assigned_variable", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.9311, 0.002, 2, 0.01, 0.7059, 321, 3, 0, 0, 0, 946, 10, 1], "semantic": {"name": "packed", "arg_names": [], "import_names": [], "rhs_call_name": "pack_rf", "annotation": ""}, "snippet": " packed = dt.pack_rf()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L474_C8", "label": "new_dt = RFBreiman()", "type": "assigned_variable", "loc": [474, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.9331, 0.002, 2, 0.01, 0.7647, 814, 3, 0, 0, 0, 766, 10, 1], "semantic": {"name": "new_dt", "arg_names": [], "import_names": [], "rhs_call_name": "RFBreiman", "annotation": ""}, "snippet": " new_dt = RFBreiman()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L475_C8", "label": "unpack_rf()", "type": "expression", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [8, 2, 0.935, 0.002, 2, 0.01, 0.8235, 291, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unpack_rf", "arg_names": [], "import_names": [], "rhs_call_name": "unpack_rf", "annotation": ""}, "snippet": " new_dt.unpack_rf(packed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L476_C8", "label": "bad =", "type": "assigned_variable", "loc": [476, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [14, 2, 0.937, 0.002, 2, 0.01, 0.8824, 297, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "bad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bad = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "label": "for i", "type": "for", "loc": [477, 487], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [6, 2, 0.9488, 0.0217, 2, 0.01, 0.9412, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(500):\n np.random.seed(i)\n test = np.mat(np.random.rand(4, 1))\n np.random.seed(1)\n pred_old, _ = dt.predict(test)\n np.random.seed(1)\n pred_new, _ = new_dt.predict(test)\n if pred_old != pred_new:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L478_C12", "label": "seed()", "type": "expression", "loc": [478, 478], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [8, 3, 0.9409, 0.002, 3, 0.32, 0.0, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L479_C12", "label": "test = mat()", "type": "assigned_variable", "loc": [479, 479], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [14, 3, 0.9429, 0.002, 3, 0.32, 0.1667, 224, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " test = np.mat(np.random.rand(4, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L480_C12", "label": "seed()", "type": "expression", "loc": [480, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [8, 3, 0.9449, 0.002, 3, 0.32, 0.3333, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L481_C12", "label": "pred_old, _ = predict()", "type": "assigned_variable", "loc": [481, 481], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [14, 3, 0.9469, 0.002, 3, 0.32, 0.5, 485, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "pred_old, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " pred_old, _ = dt.predict(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L482_C12", "label": "seed()", "type": "expression", "loc": [482, 482], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [8, 3, 0.9488, 0.002, 3, 0.32, 0.6667, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L483_C12", "label": "pred_new, _ = predict()", "type": "assigned_variable", "loc": [483, 483], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [14, 3, 0.9508, 0.002, 3, 0.32, 0.8333, 148, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "pred_new, _", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " pred_new, _ = new_dt.predict(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "label": "if", "type": "if", "loc": [484, 487], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "vector": [4, 3, 0.9557, 0.0079, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pred_old != pred_new:\n print(\"RF Not same prediction:\")\n print(pred_old, pred_new)\n bad = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L485_C16", "label": "print()", "type": "expression", "loc": [485, 485], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "vector": [8, 4, 0.9547, 0.002, 4, 0.12, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"RF Not same prediction:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L486_C16", "label": "print()", "type": "expression", "loc": [486, 486], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "vector": [8, 4, 0.9567, 0.002, 4, 0.12, 0.5, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(pred_old, pred_new)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L487_C16", "label": "bad =", "type": "assigned_variable", "loc": [487, 487], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "vector": [14, 4, 0.9587, 0.002, 4, 0.12, 1.0, 297, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "bad", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " bad = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L488_C8", "label": "if", "type": "if", "loc": [488, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "vector": [4, 2, 0.9616, 0.0039, 2, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not bad:\n print(\"RF Prediction tests successful!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L489_C12", "label": "print()", "type": "expression", "loc": [489, 489], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L488_C8", "vector": [8, 3, 0.9626, 0.002, 3, 0.65, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"RF Prediction tests successful!\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "label": "if", "type": "if", "loc": [491, 506], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "vector": [4, 1, 0.9813, 0.0315, 1, 0.37, 1.0, 0, 2, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test_new_design:\n np.random.seed(2)\n train = np.mat(np.random.rand(4, 20))\n resp = np.mat(np.round(np.random.rand(1, 20)))\n data = ds.Dataset(train, resp)\n dt = RFBreiman(data)\n save_pickle(dt, \"rfbreiman.pickle\")\n dt = load_pickle(\"rfbreiman.pickle\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L492_C8", "label": "seed()", "type": "expression", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [8, 2, 0.9685, 0.002, 2, 0.46, 0.0, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L493_C8", "label": "train = mat()", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [14, 2, 0.9705, 0.002, 2, 0.46, 0.1111, 371, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " train = np.mat(np.random.rand(4, 20))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L494_C8", "label": "resp = mat()", "type": "assigned_variable", "loc": [494, 494], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [14, 2, 0.9724, 0.002, 2, 0.46, 0.2222, 48, 3, 1, 0, 0, 882, 10, 3], "semantic": {"name": "resp", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " resp = np.mat(np.round(np.random.rand(1, 20)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L495_C8", "label": "data = Dataset()", "type": "assigned_variable", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [14, 2, 0.9744, 0.002, 2, 0.46, 0.3333, 929, 3, 2, 0, 0, 957, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "Dataset", "annotation": ""}, "snippet": " data = ds.Dataset(train, resp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L496_C8", "label": "dt = RFBreiman()", "type": "assigned_variable", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [14, 2, 0.9764, 0.002, 2, 0.46, 0.4444, 455, 3, 1, 0, 0, 766, 10, 1], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "RFBreiman", "annotation": ""}, "snippet": " dt = RFBreiman(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L497_C8", "label": "save_pickle()", "type": "expression", "loc": [497, 497], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [8, 2, 0.9783, 0.002, 2, 0.46, 0.5556, 390, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(dt, \"rfbreiman.pickle\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L498_C8", "label": "dt = load_pickle()", "type": "assigned_variable", "loc": [498, 498], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [14, 2, 0.9803, 0.002, 2, 0.46, 0.6667, 455, 3, 1, 0, 0, 65, 10, 1], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "load_pickle", "annotation": ""}, "snippet": " dt = load_pickle(\"rfbreiman.pickle\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L499_C8", "label": "preds =", "type": "assigned_variable", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [14, 2, 0.9823, 0.002, 2, 0.46, 0.7778, 481, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "preds", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " preds = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "label": "for i", "type": "for", "loc": [500, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [6, 2, 0.9892, 0.0118, 2, 0.46, 0.8889, 826, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(500):\n np.random.seed(i)\n test = np.mat(np.random.rand(4, 1))\n np.random.seed(1)\n pred, pred_dict = dt.predict(test)\n preds.append(pred[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L501_C12", "label": "seed()", "type": "expression", "loc": [501, 501], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "vector": [8, 3, 0.9862, 0.002, 3, 0.76, 0.0, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L502_C12", "label": "test = mat()", "type": "assigned_variable", "loc": [502, 502], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "vector": [14, 3, 0.9882, 0.002, 3, 0.76, 0.25, 224, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " test = np.mat(np.random.rand(4, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L503_C12", "label": "seed()", "type": "expression", "loc": [503, 503], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "vector": [8, 3, 0.9902, 0.002, 3, 0.76, 0.5, 365, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seed", "arg_names": [], "import_names": [], "rhs_call_name": "seed", "annotation": ""}, "snippet": " np.random.seed(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L504_C12", "label": "pred, pred_dict = predict()", "type": "assigned_variable", "loc": [504, 504], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "vector": [14, 3, 0.9921, 0.002, 3, 0.76, 0.75, 815, 3, 1, 0, 0, 127, 10, 1], "semantic": {"name": "pred, pred_dict", "arg_names": [], "import_names": [], "rhs_call_name": "predict", "annotation": ""}, "snippet": " pred, pred_dict = dt.predict(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L505_C12", "label": "append()", "type": "expression", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "vector": [8, 3, 0.9941, 0.002, 3, 0.76, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " preds.append(pred[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L506_C8", "label": "print()", "type": "expression", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "vector": [8, 2, 0.9961, 0.002, 2, 0.46, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(preds)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L34_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L119_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L120_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L119_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L152_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L153_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L152_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L155_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L164_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:While_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L173_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L185_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L193_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L206_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L215_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L216_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L215_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L217_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L219_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L221_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L231_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L243_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L244_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L245_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L244_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L246_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L247_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L246_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L249_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L242_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L251_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L251_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L252_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L257_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L257_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L282_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L296_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L302_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L314_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L315_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L316_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L315_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L318_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L320_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L323_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L325_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L313_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L326_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L327_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L337_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L338_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L338_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L339_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L338_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L341_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L343_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L344_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L344_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L345_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L344_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L347_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L349_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L349_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L350_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L349_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L352_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L354_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L348_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L355_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L365_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L366_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L367_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L368_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L368_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L369_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L377_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L278_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L383_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L384_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L387_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Import_L389_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L390_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L397_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Return_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:FunctionDef_L420_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L421_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L421_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L422_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L434_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L435_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L433_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L436_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L436_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L437_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L436_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L438_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L444_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L445_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L443_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L446_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L450_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L451_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L459_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L460_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L461_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L462_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L463_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L464_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L466_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L467_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L465_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L468_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L474_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L478_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L480_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L481_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L482_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L483_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L477_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L485_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L486_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L484_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L487_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L448_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L489_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L381_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L498_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L501_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L502_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L503_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Assign_L504_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:For_L500_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L505_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99251:If_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99251:Expr_L506_C8"}] |
## @author Hai Nguyen/hai@gatech.edu
import roslib
roslib.load_manifest('ml_lib')
import numpy as np
import dataset as ds
import hrl_lib.util as ut
def pca_gain_threshold(s, percentage_change_threshold=.15):
if s.__class__ != np.ndarray:
raise ValueError('Need ndarray as input.')
shifted = np.concatenate((s[1:].copy(), np.array([s[-1]])), axis=1)
diff = s - shifted
percent_diff = diff / s
positions = np.where(percent_diff < percentage_change_threshold)
return positions[0][0]
def pca_variance_threshold(eigen_values, percent_variance=.9):
eigen_sum = np.sum(eigen_values)
#print 'pca_variance_threshold: eigen_sum', eigen_sum
eigen_normed = np.cumsum(eigen_values) / eigen_sum
positions = np.where(eigen_normed >= percent_variance)
print 'pca_variance_threshold: percent_variance', percent_variance
#print 'eigen_normed', eigen_normed
#import pdb
#pdb.set_trace()
if positions[0].shape[0] == 0:
return eigen_normed.shape[0]-1
else:
return positions[0][0]
def pca(data):
cov_data = np.cov(data)
u, s, vh = np.linalg.svd(cov_data)
return u,s,vh
def pca_eigenface_trick(data):
u, s, vh = np.linalg.svd(data.T * data)
orig_u = data * u
orig_u = orig_u / ut.norm(orig_u)
return orig_u, s, None
def pca_vectors(data, percent_variance):
#import pdb
#pdb.set_trace()
if data.shape[1] < data.shape[0]:
print 'pca_vectors: using pca_eigenface_trick since number of data points is less than dim'
u, s, _ = pca_eigenface_trick(data)
#u1, s1, _ = pca(data)
#print 'S', s
#print 'S1', s1
else:
print 'pca_vectors: using normal PCA...'
u, s, _ = pca(data)
#u, s, _ = pca(data)
#import pdb
#pdb.set_trace()
number_of_vectors = pca_variance_threshold(s, percent_variance=percent_variance)
return np.matrix(u[:,0:number_of_vectors+1])
def randomized_vectors(dataset, number_of_vectors):
rvectors = np.matrix(np.random.random_sample((dataset.num_attributes(), number_of_vectors))) * 2 - 1.0
lengths = np.diag(1.0 / np.power(np.sum(np.power(rvectors, 2), axis=0), 0.5))
return rvectors * lengths
##
# Dataset which performs linear dimensionality reduction
class LinearDimReduceDataset(ds.Dataset):
def __init__(self, inputs, outputs):
ds.Dataset.__init__(self, inputs, outputs)
self.original_inputs = inputs
##
# Project this dataset's input instances (stores original instances)
def reduce_input(self):
self.original_inputs = self.inputs
self.inputs = self.projection_basis.T * self.inputs
##
# Projection vectors are assumed to be column vectors
def set_projection_vectors(self, vec):
self.projection_basis = vec
##
# Project data points onto the linear embedding
# @param data_points to project
def reduce(self, data_points):
return self.projection_basis.T * data_points
##
# Performs PCA dim reduction
# @param percent_variance
def pca_reduce(self, percent_variance):
self.set_projection_vectors(pca_vectors(self.inputs, percent_variance))
##
# Performs randomized vector dim reduction
# @param number_of_vectors number of vectors to generate/use
def randomized_vectors_reduce(self, number_of_vectors):
self.set_projection_vectors(randomized_vectors(self.inputs, number_of_vectors))
##
# returns full dimensioned inputs
def get_original_inputs(self):
return self.original_inputs
| ajibawa-2023/Python-Code-Large/train/row_99252 | 58 | 109 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Import_L2_C0", "label": "roslib import roslib", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0092, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0275, 0.0092, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('ml_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0459, 0.0092, 0, 0.66, 0.1818, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Import_L6_C0", "label": "dataset import ds", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.055, 0.0092, 0, 0.66, 0.2727, 603, 0, 1, 0, 0, 603, 0, 0], "semantic": {"name": "dataset", "arg_names": [], "import_names": ["ds"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dataset as ds"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Import_L7_C0", "label": "hrl_lib.util import ut", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0642, 0.0092, 0, 0.66, 0.3636, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["ut"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.util as ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "label": "pca_gain_threshold", "type": "function", "loc": [9, 16], "level": 0, "parent": null, "vector": [2, 0, 0.1147, 0.0734, 0, 0.66, 0.4545, 171, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "pca_gain_threshold", "arg_names": ["s", "percentage_change_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_gain_threshold(s, percentage_change_threshold=.15):\n if s.__class__ != np.ndarray:\n raise ValueError('Need ndarray as input.') \n shifted = np.concatenate((s[1:].copy(), np.array([s[-1]])), axis=1)\n diff = s - shifted\n percent_diff = diff / s\n positions = np.where(percent_diff < percentage_change_threshold)\n return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L10_C4", "label": "if", "type": "if", "loc": [10, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "vector": [4, 1, 0.0963, 0.0183, 1, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if s.__class__ != np.ndarray:\n raise ValueError('Need ndarray as input.') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L12_C4", "label": "shifted = concatenate()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "vector": [14, 1, 0.1101, 0.0092, 1, 0.84, 0.2, 221, 3, 2, 0, 0, 63, 10, 3], "semantic": {"name": "shifted", "arg_names": [], "import_names": [], "rhs_call_name": "concatenate", "annotation": ""}, "snippet": " shifted = np.concatenate((s[1:].copy(), np.array([s[-1]])), axis=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L13_C4", "label": "diff =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "vector": [14, 1, 0.1193, 0.0092, 1, 0.84, 0.4, 833, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " diff = s - shifted"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L14_C4", "label": "percent_diff =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "vector": [14, 1, 0.1284, 0.0092, 1, 0.84, 0.6, 190, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "percent_diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " percent_diff = diff / s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L15_C4", "label": "positions = where()", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "vector": [14, 1, 0.1376, 0.0092, 1, 0.84, 0.8, 320, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "positions", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " positions = np.where(percent_diff < percentage_change_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "vector": [13, 1, 0.1468, 0.0092, 1, 0.84, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "label": "pca_variance_threshold", "type": "function", "loc": [18, 30], "level": 0, "parent": null, "vector": [2, 0, 0.2202, 0.1193, 0, 0.66, 0.5455, 311, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "pca_variance_threshold", "arg_names": ["eigen_values", "percent_variance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_variance_threshold(eigen_values, percent_variance=.9):\n eigen_sum = np.sum(eigen_values)\n #print 'pca_variance_threshold: eigen_sum', eigen_sum\n eigen_normed = np.cumsum(eigen_values) / eigen_sum\n positions = np.where(eigen_normed >= percent_variance)\n print('pca_variance_threshold: percent_variance', percent_variance)\n #print 'eigen_normed', eigen_normed\n #import pdb"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L19_C4", "label": "eigen_sum = sum()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "vector": [14, 1, 0.1743, 0.0092, 1, 0.26, 0.0, 400, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "eigen_sum", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " eigen_sum = np.sum(eigen_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L21_C4", "label": "eigen_normed =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "vector": [14, 1, 0.1927, 0.0092, 1, 0.26, 0.25, 959, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "eigen_normed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " eigen_normed = np.cumsum(eigen_values) / eigen_sum"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L22_C4", "label": "positions = where()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "vector": [14, 1, 0.2018, 0.0092, 1, 0.26, 0.5, 320, 3, 1, 0, 0, 169, 10, 1], "semantic": {"name": "positions", "arg_names": [], "import_names": [], "rhs_call_name": "where", "annotation": ""}, "snippet": " positions = np.where(eigen_normed >= percent_variance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L23_C4", "label": "print()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "vector": [8, 1, 0.211, 0.0092, 1, 0.26, 0.75, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pca_variance_threshold: percent_variance', percent_variance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L27_C4", "label": "if", "type": "if", "loc": [27, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "vector": [4, 1, 0.2615, 0.0367, 1, 0.26, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if positions[0].shape[0] == 0:\n return eigen_normed.shape[0]-1\n else:\n return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L27_C4", "vector": [13, 2, 0.2569, 0.0092, 2, 0.64, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return eigen_normed.shape[0]-1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L27_C4", "vector": [13, 2, 0.2752, 0.0092, 2, 0.64, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return positions[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "label": "pca", "type": "function", "loc": [32, 35], "level": 0, "parent": null, "vector": [2, 0, 0.3073, 0.0367, 0, 0.66, 0.6364, 425, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "pca", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca(data):\n cov_data = np.cov(data)\n u, s, vh = np.linalg.svd(cov_data)\n return u,s,vh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L33_C4", "label": "cov_data = cov()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "vector": [14, 1, 0.3028, 0.0092, 1, 0.9, 0.0, 897, 3, 1, 0, 0, 251, 10, 1], "semantic": {"name": "cov_data", "arg_names": [], "import_names": [], "rhs_call_name": "cov", "annotation": ""}, "snippet": " cov_data = np.cov(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L34_C4", "label": "u, s, vh = svd()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "vector": [14, 1, 0.3119, 0.0092, 1, 0.9, 0.5, 625, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "u, s, vh", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " u, s, vh = np.linalg.svd(cov_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L35_C4", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "vector": [13, 1, 0.3211, 0.0092, 1, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u,s,vh"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "label": "pca_eigenface_trick", "type": "function", "loc": [37, 41], "level": 0, "parent": null, "vector": [2, 0, 0.3578, 0.0459, 0, 0.66, 0.7273, 739, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "pca_eigenface_trick", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_eigenface_trick(data):\n u, s, vh = np.linalg.svd(data.T * data)\n orig_u = data * u\n orig_u = orig_u / ut.norm(orig_u)\n return orig_u, s, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L38_C4", "label": "u, s, vh = svd()", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "vector": [14, 1, 0.3486, 0.0092, 1, 0.5, 0.0, 625, 3, 1, 0, 0, 388, 10, 1], "semantic": {"name": "u, s, vh", "arg_names": [], "import_names": [], "rhs_call_name": "svd", "annotation": ""}, "snippet": " u, s, vh = np.linalg.svd(data.T * data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L39_C4", "label": "orig_u =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "vector": [14, 1, 0.3578, 0.0092, 1, 0.5, 0.3333, 127, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orig_u", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orig_u = data * u"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L40_C4", "label": "orig_u =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "vector": [14, 1, 0.367, 0.0092, 1, 0.5, 0.6667, 127, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "orig_u", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orig_u = orig_u / ut.norm(orig_u)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L41_C4", "label": "return", "type": "return", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "vector": [13, 1, 0.3761, 0.0092, 1, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return orig_u, s, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "label": "pca_vectors", "type": "function", "loc": [43, 60], "level": 0, "parent": null, "vector": [2, 0, 0.4725, 0.1651, 0, 0.66, 0.8182, 712, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "pca_vectors", "arg_names": ["data", "percent_variance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pca_vectors(data, percent_variance):\n #import pdb\n #pdb.set_trace()\n if data.shape[1] < data.shape[0]:\n print('pca_vectors: using pca_eigenface_trick since number of data points is less than dim')\n u, s, _ = pca_eigenface_trick(data)\n #u1, s1, _ = pca(data)\n #print 'S', s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "label": "if", "type": "if", "loc": [46, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "vector": [4, 1, 0.4587, 0.0826, 1, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.shape[1] < data.shape[0]:\n print('pca_vectors: using pca_eigenface_trick since number of data points is less than dim')\n u, s, _ = pca_eigenface_trick(data)\n #u1, s1, _ = pca(data)\n #print 'S', s\n #print 'S1', s1\n else:\n print('pca_vectors: using normal PCA...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L47_C8", "label": "print()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "vector": [8, 2, 0.4312, 0.0092, 2, 0.32, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pca_vectors: using pca_eigenface_trick since number of data points is less than dim')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L48_C8", "label": "u, s, _ = pca_eigenface_trick()", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "vector": [14, 2, 0.4404, 0.0092, 2, 0.32, 0.3333, 867, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "u, s, _", "arg_names": [], "import_names": [], "rhs_call_name": "pca_eigenface_trick", "annotation": ""}, "snippet": " u, s, _ = pca_eigenface_trick(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L53_C8", "label": "print()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "vector": [8, 2, 0.4862, 0.0092, 2, 0.32, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('pca_vectors: using normal PCA...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L54_C8", "label": "u, s, _ = pca()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "vector": [14, 2, 0.4954, 0.0092, 2, 0.32, 1.0, 867, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "u, s, _", "arg_names": [], "import_names": [], "rhs_call_name": "pca", "annotation": ""}, "snippet": " u, s, _ = pca(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L59_C4", "label": "number_of_vectors = pca_variance_threshold()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "vector": [14, 1, 0.5413, 0.0092, 1, 0.04, 0.5, 903, 3, 2, 0, 0, 311, 10, 1], "semantic": {"name": "number_of_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "pca_variance_threshold", "annotation": ""}, "snippet": " number_of_vectors = pca_variance_threshold(s, percent_variance=percent_variance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "vector": [13, 1, 0.5505, 0.0092, 1, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(u[:,0:number_of_vectors+1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "label": "randomized_vectors", "type": "function", "loc": [62, 65], "level": 0, "parent": null, "vector": [2, 0, 0.5826, 0.0367, 0, 0.66, 0.9091, 889, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "randomized_vectors", "arg_names": ["dataset", "number_of_vectors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def randomized_vectors(dataset, number_of_vectors):\n rvectors = np.matrix(np.random.random_sample((dataset.num_attributes(), number_of_vectors))) * 2 - 1.0\n lengths = np.diag(1.0 / np.power(np.sum(np.power(rvectors, 2), axis=0), 0.5))\n return rvectors * lengths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L63_C4", "label": "rvectors =", "type": "assigned_variable", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "vector": [14, 1, 0.578, 0.0092, 1, 0.4, 0.0, 274, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rvectors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rvectors = np.matrix(np.random.random_sample((dataset.num_attributes(), number_of_vectors))) * 2 - 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L64_C4", "label": "lengths = diag()", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "vector": [14, 1, 0.5872, 0.0092, 1, 0.4, 0.5, 214, 3, 1, 0, 0, 288, 10, 4], "semantic": {"name": "lengths", "arg_names": [], "import_names": [], "rhs_call_name": "diag", "annotation": ""}, "snippet": " lengths = np.diag(1.0 / np.power(np.sum(np.power(rvectors, 2), axis=0), 0.5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L65_C4", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "vector": [13, 1, 0.5963, 0.0092, 1, 0.4, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rvectors * lengths"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "label": "LinearDimReduceDataset", "type": "class", "loc": [69, 107], "level": 0, "parent": null, "vector": [3, 0, 0.8073, 0.3578, 0, 0.66, 1.0, 44, 0, 7, 0, 0, 803, 0, 5], "semantic": {"name": "LinearDimReduceDataset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LinearDimReduceDataset(ds.Dataset):\n\n def __init__(self, inputs, outputs):\n ds.Dataset.__init__(self, inputs, outputs)\n self.original_inputs = inputs\n\n ##\n # Project this dataset's input instances (stores original instances) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L71_C4", "label": "__init__", "type": "function", "loc": [71, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.6606, 0.0275, 1, 0.55, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "inputs", "outputs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, inputs, outputs):\n ds.Dataset.__init__(self, inputs, outputs)\n self.original_inputs = inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L72_C8", "label": "__init__()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L71_C4", "vector": [8, 2, 0.6606, 0.0092, 2, 0.7, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " ds.Dataset.__init__(self, inputs, outputs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L73_C8", "label": "self.original_inputs =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L71_C4", "vector": [14, 2, 0.6697, 0.0092, 2, 0.7, 1.0, 307, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.original_inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.original_inputs = inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L77_C4", "label": "reduce_input", "type": "function", "loc": [77, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.7156, 0.0275, 1, 0.55, 0.1667, 77, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "reduce_input", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reduce_input(self):\n self.original_inputs = self.inputs\n self.inputs = self.projection_basis.T * self.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L78_C8", "label": "self.original_inputs =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L77_C4", "vector": [14, 2, 0.7156, 0.0092, 2, 0.87, 0.0, 307, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.original_inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.original_inputs = self.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L79_C8", "label": "self.inputs =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L77_C4", "vector": [14, 2, 0.7248, 0.0092, 2, 0.87, 1.0, 646, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.inputs = self.projection_basis.T * self.inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L83_C4", "label": "set_projection_vectors", "type": "function", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.7661, 0.0183, 1, 0.55, 0.3333, 443, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_projection_vectors", "arg_names": ["self", "vec"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_projection_vectors(self, vec):\n self.projection_basis = vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L84_C8", "label": "self.projection_basis =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L83_C4", "vector": [14, 2, 0.7706, 0.0092, 2, 0.44, 0.0, 344, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.projection_basis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.projection_basis = vec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L89_C4", "label": "reduce", "type": "function", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.8211, 0.0183, 1, 0.55, 0.5, 622, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "reduce", "arg_names": ["self", "data_points"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reduce(self, data_points):\n return self.projection_basis.T * data_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L89_C4", "vector": [13, 2, 0.8257, 0.0092, 2, 0.24, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.projection_basis.T * data_points"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L95_C4", "label": "pca_reduce", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.8761, 0.0183, 1, 0.55, 0.6667, 422, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "pca_reduce", "arg_names": ["self", "percent_variance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pca_reduce(self, percent_variance):\n self.set_projection_vectors(pca_vectors(self.inputs, percent_variance))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L96_C8", "label": "set_projection_vectors()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L95_C4", "vector": [8, 2, 0.8807, 0.0092, 2, 0.33, 0.0, 443, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_projection_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "set_projection_vectors", "annotation": ""}, "snippet": " self.set_projection_vectors(pca_vectors(self.inputs, percent_variance))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L101_C4", "label": "randomized_vectors_reduce", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.9312, 0.0183, 1, 0.55, 0.8333, 843, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "randomized_vectors_reduce", "arg_names": ["self", "number_of_vectors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def randomized_vectors_reduce(self, number_of_vectors):\n self.set_projection_vectors(randomized_vectors(self.inputs, number_of_vectors))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L102_C8", "label": "set_projection_vectors()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L101_C4", "vector": [8, 2, 0.9358, 0.0092, 2, 0.43, 0.0, 443, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_projection_vectors", "arg_names": [], "import_names": [], "rhs_call_name": "set_projection_vectors", "annotation": ""}, "snippet": " self.set_projection_vectors(randomized_vectors(self.inputs, number_of_vectors))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L106_C4", "label": "get_original_inputs", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "vector": [2, 1, 0.9771, 0.0183, 1, 0.55, 1.0, 549, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_original_inputs", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_original_inputs(self):\n return self.original_inputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L106_C4", "vector": [13, 2, 0.9817, 0.0092, 2, 0.36, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.original_inputs"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L43_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:ClassDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99252:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99252:Return_L107_C8"}] |
##
# Taken from http://opencv.willowgarage.com/wiki/PythonInterface
#
import roslib
roslib.load_manifest('hrl_opencv')
import cv
import Image #PIL
import numpy as np
def pil2cv(pi):
cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 1)
cv.SetData(cv_im, pi.tostring())
return cv_im
def cv2pil(cv_im):
return Image.fromstring(cv.GetSize(cv_im), "L", cv_im.tostring())
def cv2array(im):
depth2dtype = {
cv.IPL_DEPTH_8U: 'uint8',
cv.IPL_DEPTH_8S: 'int8',
cv.IPL_DEPTH_16U: 'uint16',
cv.IPL_DEPTH_16S: 'int16',
cv.IPL_DEPTH_32S: 'int32',
cv.IPL_DEPTH_32F: 'float32',
cv.IPL_DEPTH_64F: 'float64',
}
arrdtype=im.depth
a = np.fromstring(
im.tostring(),
dtype=depth2dtype[im.depth],
count=im.width*im.height*im.nChannels)
a.shape = (im.height,im.width,im.nChannels)
return a
def array2cv(a):
dtype2depth = {
'uint8': cv.IPL_DEPTH_8U,
'int8': cv.IPL_DEPTH_8S,
'uint16': cv.IPL_DEPTH_16U,
'int16': cv.IPL_DEPTH_16S,
'int32': cv.IPL_DEPTH_32S,
'float32': cv.IPL_DEPTH_32F,
'float64': cv.IPL_DEPTH_64F,
}
try:
nChannels = a.shape[2]
except:
nChannels = 1
cv_im = cv.CreateImageHeader((a.shape[1],a.shape[0]),
dtype2depth[str(a.dtype)],
nChannels)
cv.SetData(cv_im, a.tostring(),
a.dtype.itemsize*nChannels*a.shape[1])
return cv_im
def array2cvmat(a):
dtype2type = {
'uint8': cv.CV_8UC1,
'int8': cv.CV_8SC1,
'uint16': cv.CV_16UC1,
'int16': cv.CV_16SC1,
'int32': cv.CV_32SC1,
'float32': cv.CV_32FC1,
'float64': cv.CV_64FC1
}
#create matrix headers
rows = a.shape[0]
cols = a.shape[1]
type = dtype2type[str(a.dtype)]
cvmat = cv.CreateMatHeader(rows, cols, type)
#set data
cv.SetData(cvmat, a.tostring(), a.dtype.itemsize * a.shape[1])
return cvmat
| ajibawa-2023/Python-Code-Large/train/row_99254 | 33 | 77 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Import_L4_C0", "label": "roslib import roslib", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0519, 0.013, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0649, 0.013, 0, 0.66, 0.1111, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_opencv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Import_L6_C0", "label": "cv import cv", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0779, 0.013, 0, 0.66, 0.2222, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Import_L7_C0", "label": "Image import Image", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.013, 0, 0.66, 0.3333, 721, 0, 1, 0, 0, 721, 0, 0], "semantic": {"name": "Image", "arg_names": [], "import_names": ["Image"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Image #PIL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1039, 0.013, 0, 0.66, 0.4444, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "label": "pil2cv", "type": "function", "loc": [10, 13], "level": 0, "parent": null, "vector": [2, 0, 0.1494, 0.0519, 0, 0.66, 0.5556, 194, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "pil2cv", "arg_names": ["pi"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pil2cv(pi):\n cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 1)\n cv.SetData(cv_im, pi.tostring())\n return cv_im"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L11_C4", "label": "cv_im = CreateImageHeader()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "vector": [14, 1, 0.1429, 0.013, 1, 0.54, 0.0, 782, 3, 3, 0, 0, 564, 10, 1], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImageHeader", "annotation": ""}, "snippet": " cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L12_C4", "label": "SetData()", "type": "expression", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "vector": [8, 1, 0.1558, 0.013, 1, 0.54, 0.5, 617, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "SetData", "arg_names": [], "import_names": [], "rhs_call_name": "SetData", "annotation": ""}, "snippet": " cv.SetData(cv_im, pi.tostring())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L13_C4", "label": "return", "type": "return", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "vector": [13, 1, 0.1688, 0.013, 1, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cv_im"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L15_C0", "label": "cv2pil", "type": "function", "loc": [15, 16], "level": 0, "parent": null, "vector": [2, 0, 0.2013, 0.026, 0, 0.66, 0.6667, 816, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "cv2pil", "arg_names": ["cv_im"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cv2pil(cv_im):\n return Image.fromstring(cv.GetSize(cv_im), \"L\", cv_im.tostring())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L15_C0", "vector": [13, 1, 0.2078, 0.013, 1, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Image.fromstring(cv.GetSize(cv_im), \"L\", cv_im.tostring())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "label": "cv2array", "type": "function", "loc": [18, 35], "level": 0, "parent": null, "vector": [2, 0, 0.3442, 0.2338, 0, 0.66, 0.7778, 771, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "cv2array", "arg_names": ["im"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def cv2array(im):\n depth2dtype = {\n cv.IPL_DEPTH_8U: 'uint8',\n cv.IPL_DEPTH_8S: 'int8',\n cv.IPL_DEPTH_16U: 'uint16',\n cv.IPL_DEPTH_16S: 'int16',\n cv.IPL_DEPTH_32S: 'int32',\n cv.IPL_DEPTH_32F: 'float32',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L19_C2", "label": "depth2dtype =", "type": "assigned_variable", "loc": [19, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "vector": [14, 1, 0.2987, 0.1169, 1, 0.04, 0.0, 326, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "depth2dtype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " depth2dtype = {\n cv.IPL_DEPTH_8U: 'uint8',\n cv.IPL_DEPTH_8S: 'int8',\n cv.IPL_DEPTH_16U: 'uint16',\n cv.IPL_DEPTH_16S: 'int16',\n cv.IPL_DEPTH_32S: 'int32',\n cv.IPL_DEPTH_32F: 'float32',\n cv.IPL_DEPTH_64F: 'float64',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L29_C2", "label": "arrdtype =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "vector": [14, 1, 0.3766, 0.013, 1, 0.04, 0.25, 927, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arrdtype", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arrdtype=im.depth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L30_C2", "label": "a = fromstring()", "type": "assigned_variable", "loc": [30, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "vector": [14, 1, 0.4091, 0.0519, 1, 0.04, 0.5, 475, 3, 3, 0, 0, 551, 10, 2], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "fromstring", "annotation": ""}, "snippet": " a = np.fromstring(\n im.tostring(),\n dtype=depth2dtype[im.depth],\n count=im.width*im.height*im.nChannels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L34_C2", "label": "a.shape =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "vector": [14, 1, 0.4416, 0.013, 1, 0.04, 0.75, 206, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "a.shape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " a.shape = (im.height,im.width,im.nChannels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L35_C2", "label": "return", "type": "return", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "vector": [13, 1, 0.4545, 0.013, 1, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "label": "array2cv", "type": "function", "loc": [37, 56], "level": 0, "parent": null, "vector": [2, 0, 0.6039, 0.2597, 0, 0.66, 0.8889, 769, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "array2cv", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def array2cv(a):\n dtype2depth = {\n 'uint8': cv.IPL_DEPTH_8U,\n 'int8': cv.IPL_DEPTH_8S,\n 'uint16': cv.IPL_DEPTH_16U,\n 'int16': cv.IPL_DEPTH_16S,\n 'int32': cv.IPL_DEPTH_32S,\n 'float32': cv.IPL_DEPTH_32F,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L38_C2", "label": "dtype2depth =", "type": "assigned_variable", "loc": [38, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "vector": [14, 1, 0.5455, 0.1169, 1, 0.05, 0.0, 154, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dtype2depth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dtype2depth = {\n 'uint8': cv.IPL_DEPTH_8U,\n 'int8': cv.IPL_DEPTH_8S,\n 'uint16': cv.IPL_DEPTH_16U,\n 'int16': cv.IPL_DEPTH_16S,\n 'int32': cv.IPL_DEPTH_32S,\n 'float32': cv.IPL_DEPTH_32F,\n 'float64': cv.IPL_DEPTH_64F,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Try_L47_C2", "label": "try", "type": "try", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "vector": [7, 1, 0.6299, 0.0519, 1, 0.05, 0.25, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n nChannels = a.shape[2]\n except:\n nChannels = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L48_C4", "label": "nChannels =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:Try_L47_C2", "vector": [14, 2, 0.6234, 0.013, 2, 0.14, 0.0, 808, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "nChannels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nChannels = a.shape[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L50_C4", "label": "nChannels =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:Try_L47_C2", "vector": [14, 2, 0.6494, 0.013, 2, 0.14, 0.0, 808, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "nChannels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nChannels = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L51_C2", "label": "cv_im = CreateImageHeader()", "type": "assigned_variable", "loc": [51, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "vector": [14, 1, 0.6753, 0.039, 1, 0.05, 0.5, 782, 3, 3, 0, 0, 564, 10, 2], "semantic": {"name": "cv_im", "arg_names": [], "import_names": [], "rhs_call_name": "CreateImageHeader", "annotation": ""}, "snippet": " cv_im = cv.CreateImageHeader((a.shape[1],a.shape[0]), \n dtype2depth[str(a.dtype)],\n nChannels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L54_C2", "label": "SetData()", "type": "expression", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "vector": [8, 1, 0.7078, 0.026, 1, 0.05, 0.75, 617, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "SetData", "arg_names": [], "import_names": [], "rhs_call_name": "SetData", "annotation": ""}, "snippet": " cv.SetData(cv_im, a.tostring(), \n a.dtype.itemsize*nChannels*a.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L56_C2", "label": "return", "type": "return", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "vector": [13, 1, 0.7273, 0.013, 1, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cv_im"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "label": "array2cvmat", "type": "function", "loc": [58, 76], "level": 0, "parent": null, "vector": [2, 0, 0.8701, 0.2468, 0, 0.66, 1.0, 393, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "array2cvmat", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def array2cvmat(a):\n dtype2type = {\n 'uint8': cv.CV_8UC1,\n 'int8': cv.CV_8SC1, \n 'uint16': cv.CV_16UC1, \n 'int16': cv.CV_16SC1, \n 'int32': cv.CV_32SC1, \n 'float32': cv.CV_32FC1, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L59_C4", "label": "dtype2type =", "type": "assigned_variable", "loc": [59, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [14, 1, 0.8182, 0.1169, 1, 0.48, 0.0, 681, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dtype2type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dtype2type = {\n 'uint8': cv.CV_8UC1,\n 'int8': cv.CV_8SC1, \n 'uint16': cv.CV_16UC1, \n 'int16': cv.CV_16SC1, \n 'int32': cv.CV_32SC1, \n 'float32': cv.CV_32FC1, \n 'float64': cv.CV_64FC1 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L69_C4", "label": "rows =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [14, 1, 0.8961, 0.013, 1, 0.48, 0.1667, 275, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rows = a.shape[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L70_C4", "label": "cols =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [14, 1, 0.9091, 0.013, 1, 0.48, 0.3333, 876, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cols", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cols = a.shape[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L71_C4", "label": "type =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [14, 1, 0.9221, 0.013, 1, 0.48, 0.5, 801, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = dtype2type[str(a.dtype)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L72_C4", "label": "cvmat = CreateMatHeader()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [14, 1, 0.9351, 0.013, 1, 0.48, 0.6667, 58, 3, 3, 0, 0, 995, 10, 1], "semantic": {"name": "cvmat", "arg_names": [], "import_names": [], "rhs_call_name": "CreateMatHeader", "annotation": ""}, "snippet": " cvmat = cv.CreateMatHeader(rows, cols, type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L75_C4", "label": "SetData()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [8, 1, 0.974, 0.013, 1, 0.48, 0.8333, 617, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "SetData", "arg_names": [], "import_names": [], "rhs_call_name": "SetData", "annotation": ""}, "snippet": " cv.SetData(cvmat, a.tostring(), a.dtype.itemsize * a.shape[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L76_C4", "label": "return", "type": "return", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "vector": [13, 1, 0.987, 0.013, 1, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cvmat"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Try_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:Try_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:Try_L47_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L51_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99254:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99254:Return_L76_C4"}] |
import roslib
roslib.load_manifest('hrl_opencv')
import cv
def print_mat(m):
for j in range(m.height):
for i in range(m.width):
print m[j,i], ' ',
print ''
##Display a list of OpenCV images tiled across the screen
#with maximum width of max_x and maximum height of max_y
# @param save_images - will save the images(with timestamp) (NOT IMPLEMENTED)
def display_images(image_list, max_x = 1200, max_y = 1000, save_images_flag=False):
if image_list == []:
return
loc_x, loc_y = 0, 0
wins = []
# if save_images_flag:
# save_images(image_list)
for i, im in enumerate(image_list):
window_name = 'image %d' % i
wins.append((window_name, im))
cv.NamedWindow(window_name, cv.CV_WINDOW_AUTOSIZE)
cv.MoveWindow(window_name, loc_x, loc_y)
loc_x = loc_x + im.width
if loc_x > max_x:
loc_x = 0
loc_y = loc_y + im.height
if loc_y > max_y:
loc_y = 0
while True:
for name, im in wins:
cv.ShowImage(name, im)
keypress = cv.WaitKey(10)
if keypress & 255 == 27:
break
| ajibawa-2023/Python-Code-Large/train/row_99255 | 29 | 44 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0227, 0.0227, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0455, 0.0227, 0, 0.66, 0.25, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_opencv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Import_L3_C0", "label": "cv import cv", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0682, 0.0227, 0, 0.66, 0.5, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "cv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L5_C0", "label": "print_mat", "type": "function", "loc": [5, 9], "level": 0, "parent": null, "vector": [2, 0, 0.1591, 0.1136, 0, 0.66, 0.75, 338, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "print_mat", "arg_names": ["m"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def print_mat(m):\n for j in range(m.height):\n for i in range(m.width):\n print(m[j,i], ' ',)\n print('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L6_C4", "label": "for j", "type": "for", "loc": [6, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L5_C0", "vector": [6, 1, 0.1705, 0.0909, 1, 0.72, 0.0, 100, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(m.height):\n for i in range(m.width):\n print(m[j,i], ' ',)\n print('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L7_C8", "label": "for i", "type": "for", "loc": [7, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L6_C4", "vector": [6, 2, 0.1705, 0.0455, 2, 0.01, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(m.width):\n print(m[j,i], ' ',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L8_C12", "label": "print()", "type": "expression", "loc": [8, 8], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L7_C8", "vector": [8, 3, 0.1818, 0.0227, 3, 0.27, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(m[j,i], ' ',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L9_C8", "label": "print()", "type": "expression", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L6_C4", "vector": [8, 2, 0.2045, 0.0227, 2, 0.01, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "label": "display_images", "type": "function", "loc": [15, 39], "level": 0, "parent": null, "vector": [2, 0, 0.6136, 0.5682, 0, 0.66, 1.0, 280, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "display_images", "arg_names": ["image_list", "max_x", "max_y", "save_images_flag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def display_images(image_list, max_x = 1200, max_y = 1000, save_images_flag=False):\n if image_list == []:\n return\n loc_x, loc_y = 0, 0\n wins = []\n# if save_images_flag:\n# save_images(image_list)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L16_C4", "label": "if", "type": "if", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "vector": [4, 1, 0.375, 0.0455, 1, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if image_list == []:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Return_L17_C8", "label": "return", "type": "return", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L16_C4", "vector": [13, 2, 0.3864, 0.0227, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L18_C4", "label": "loc_x, loc_y =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "vector": [14, 1, 0.4091, 0.0227, 1, 0.92, 0.25, 286, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "loc_x, loc_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc_x, loc_y = 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L19_C4", "label": "wins =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "vector": [14, 1, 0.4318, 0.0227, 1, 0.92, 0.5, 555, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "wins", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wins = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "label": "for i, im", "type": "for", "loc": [23, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "vector": [6, 1, 0.6364, 0.25, 1, 0.92, 0.75, 539, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, im", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, im in enumerate(image_list):\n window_name = 'image %d' % i\n wins.append((window_name, im))\n cv.NamedWindow(window_name, cv.CV_WINDOW_AUTOSIZE)\n cv.MoveWindow(window_name, loc_x, loc_y)\n loc_x = loc_x + im.width\n if loc_x > max_x:\n loc_x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L24_C8", "label": "window_name =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "vector": [14, 2, 0.5455, 0.0227, 2, 0.41, 0.0, 664, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "window_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " window_name = 'image %d' % i"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L25_C8", "label": "append()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "vector": [8, 2, 0.5682, 0.0227, 2, 0.41, 0.2, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " wins.append((window_name, im))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L26_C8", "label": "NamedWindow()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "vector": [8, 2, 0.5909, 0.0227, 2, 0.41, 0.4, 60, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "NamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "NamedWindow", "annotation": ""}, "snippet": " cv.NamedWindow(window_name, cv.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L27_C8", "label": "MoveWindow()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "vector": [8, 2, 0.6136, 0.0227, 2, 0.41, 0.6, 151, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "MoveWindow", "arg_names": [], "import_names": [], "rhs_call_name": "MoveWindow", "annotation": ""}, "snippet": " cv.MoveWindow(window_name, loc_x, loc_y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L28_C8", "label": "loc_x =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "vector": [14, 2, 0.6364, 0.0227, 2, 0.41, 0.8, 751, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loc_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc_x = loc_x + im.width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "label": "if", "type": "if", "loc": [29, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "vector": [4, 2, 0.7045, 0.1136, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if loc_x > max_x:\n loc_x = 0\n loc_y = loc_y + im.height\n if loc_y > max_y:\n loc_y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L30_C12", "label": "loc_x =", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "vector": [14, 3, 0.6818, 0.0227, 3, 0.56, 0.0, 751, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "loc_x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc_x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L31_C12", "label": "loc_y =", "type": "assigned_variable", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "vector": [14, 3, 0.7045, 0.0227, 3, 0.56, 0.5, 938, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "loc_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc_y = loc_y + im.height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L32_C12", "label": "if", "type": "if", "loc": [32, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "vector": [4, 3, 0.7386, 0.0455, 3, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if loc_y > max_y:\n loc_y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L33_C16", "label": "loc_y =", "type": "assigned_variable", "loc": [33, 33], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L32_C12", "vector": [14, 4, 0.75, 0.0227, 4, 0.17, 0.0, 938, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "loc_y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " loc_y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "label": "while", "type": "while", "loc": [34, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "vector": [5, 1, 0.8295, 0.1364, 1, 0.92, 1.0, 0, 1, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n for name, im in wins:\n cv.ShowImage(name, im)\n keypress = cv.WaitKey(10)\n if keypress & 255 == 27:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L35_C8", "label": "for name, im", "type": "for", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "vector": [6, 2, 0.8068, 0.0455, 2, 0.59, 0.0, 427, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name, im", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, im in wins:\n cv.ShowImage(name, im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L36_C12", "label": "ShowImage()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L35_C8", "vector": [8, 3, 0.8182, 0.0227, 3, 0.0, 0.0, 896, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "ShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "ShowImage", "annotation": ""}, "snippet": " cv.ShowImage(name, im)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L37_C8", "label": "keypress = WaitKey()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "vector": [14, 2, 0.8409, 0.0227, 2, 0.59, 0.5, 313, 3, 1, 0, 0, 885, 10, 1], "semantic": {"name": "keypress", "arg_names": [], "import_names": [], "rhs_call_name": "WaitKey", "annotation": ""}, "snippet": " keypress = cv.WaitKey(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "vector": [4, 2, 0.875, 0.0455, 2, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if keypress & 255 == 27:\n break"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L7_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L8_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Return_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L32_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L33_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99255:While_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99255:If_L38_C8"}] |
import roslib
roslib.load_manifest('hrl_opencv')
#from sensor_msgs.msg import Image as RosImage
from std_msgs.msg import UInt8MultiArray
from std_msgs.msg import MultiArrayLayout
from std_msgs.msg import MultiArrayDimension
import opencv as cv
import opencv.highgui as hg
import opencv.adaptors as ad
import Image as pil
import numpy as np
#################################################################################################################
# ROS Utility Functions
#################################################################################################################
##
# Convert from ROS to OpenCV image datatype
# @param image to convert
def ros2cv(image):
#ros to pil then pil to opencv
#if image.encoding != 'bgr' and image.encoding != 'rgb' and image.encoding != 'bgr8':
channels = 1
if image.encoding != 'bgr8':
raise RuntimeError('Unsupported format "%s"' % image.encoding)
else:
channels = 3
if image.is_bigendian != 0:
raise RuntimeError('Unsupported endianess')
#print image.encoding
#print image.step
#print image.is_bigendian
#if image.depth != 'uint8':
# raise RuntimeError('Unsupported depth "%s"' % image.depth)
#height = image.data.layout.dim[0].size
#width = image.data.layout.dim[1].size
#channels = image.data.layout.dim[2].size
#print 'expected', image.width * channels
#print 'step', image.step
#print 'image.width', image.width, image.height
assert(image.width * channels == image.step)
height = image.height
width = image.width
np_image = np.reshape(np.fromstring(image.data, dtype='uint8', count=height*width*channels), [height, width, 3])
#np
#np_image[:,:,2].A1
#np_image[:,:,1].A1
#np_image[:,:,0].A1
np_image2 = np.empty(np_image.shape, dtype='uint8')
np_image2[:, :, 0] = np_image[:, :, 2]
np_image2[:, :, 1] = np_image[:, :, 1]
np_image2[:, :, 2] = np_image[:, :, 0]
#concatenated = np.concatenate([np_image[:,:,2].flatten(), np_image[:,:,1].flatten(), np_image[:,:,0].flatten()], axis=0)
#print 2050*2448*3
#print concatenated.shape
#np_image2 = np.reshape(np.concatenate([np_image[:,:,0].flatten(), np_image[:,:,1].flatten(), np_image[:,:,2].flatten()], axis=0), [3, width, height])
#np_image2 = np.swapaxes(np_image2, 0, 2)
#print np_image[:,:,2].shape
#print 'datatype:', np_image2.dtype
#print np_image2.shape
return ad.NumPy2Ipl(np_image2)
#return None
#################################################################################################################
# Highgui
#################################################################################################################
##
# Simple drawing of text on an image with a drop shadow
def text(image, x, y, a_string):
font = cv.cvInitFont(CV_FONT_HERSHEY_SIMPLEX, .3, .3)
cv.cvPutText(image, a_string, cv.cvPoint(x, y), font, cv.cvScalar(0,0,0))
cv.cvPutText(image, a_string, cv.cvPoint(x+1, y+1), font, cv.cvScalar(255,255,255))
def clone_image(image):
return cv.cvCloneImage(image)
def save_image(name, image):
hg.cvSaveImage(name, image)
def show_image(name, image):
hg.cvShowImage(name, image)
def named_window(name):
hg.cvNamedWindow(name, hg.CV_WINDOW_AUTOSIZE)
def wait_key(msecs=33):
return hg.cvWaitKey(msecs)
#################################################################################################################
# CXCore
#################################################################################################################
#################################################################################################################
# CVAux
#################################################################################################################
#################################################################################################################
# Machine Learning
#################################################################################################################
#################################################################################################################
# CVReference
#################################################################################################################
##
# Morphological closing
def morpho_close(cv_image, n_times=1):
dst = cv.cvCloneImage(cv_image)
dst2 = cv.cvCloneImage(cv_image)
cv.cvDilate(cv_image, dst, None, n_times)
cv.cvErode(dst, dst2, None, n_times)
return dst2
##
# Morphological opening
def morpho_open(cv_image, n_times=1):
dst = cv.cvCloneImage(cv_image)
dst2 = cv.cvCloneImage(cv_image)
cv.cvErode(cv_image, dst, None, n_times)
cv.cvDilate(dst, dst2, None, n_times)
return dst2
##
# Morphological opening
def dilate(cv_image, n_times=1):
dst = cv.cvCloneImage(cv_image)
cv.cvDilate(cv_img, dst, None, n_times)
return dst
##
# Morphological opening
def erode(cv_image, n_times=1):
dst = cv.cvCloneImage(cv_image)
cv.cvErode(cv_img, dst, None, n_times)
return dst
##
# Mask a color image with a given black and white mask
# @param img
# @param img_mask one channeled image
# @return color image with masked part filled with black
def mask(img, img_mask):
dim = img.width, img.height
depth = img.depth
channels = img.nChannels
r_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)
g_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)
b_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)
combined = cv.cvCreateImage(cv.cvSize(*dim), depth, 3)
cv.cvSplit(img, r_chan, g_chan, b_chan, None)
cv.cvAnd(r_chan, img_mask, r_chan)
cv.cvAnd(g_chan, img_mask, g_chan)
cv.cvAnd(b_chan, img_mask, b_chan)
cv.cvMerge(r_chan, g_chan, b_chan, None, combined)
return combined
##
# Split a color image into its component parts
def split(image):
img1 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)
img2 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)
img3 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)
cv.cvSplit(image, img1, img2, img3, None)
return (img1, img2, img3)
##
# Easy scaling of an image by factor s
# @param image
# @param s
def scale(image, s):
scaled = cv.cvCreateImage(cv.cvSize(int(image.width * s), int(image.height * s)), image.depth, image.nChannels)
cv.cvResize(image, scaled, cv.CV_INTER_AREA)
return scaled
if __name__ == '__main__':
import opencv.highgui as hg
import rospy
from photo.srv import *
#a = create_ros_image()
#print a
rospy.wait_for_service('/photo/capture')
say_cheese = rospy.ServiceProxy('/photo/capture', Capture)
ros_img = say_cheese().image
print dir(ros_img)
cv_img = ros2cv(ros_img)
hg.cvSaveImage('test.png', cv_img)
#def create_ros_image(width=1, height=1, channels=2, data='12'):
# d1 = MultiArrayDimension(label='height', size=height, stride=width*height*channels)
# d2 = MultiArrayDimension(label='width', size=width, stride=width*channels)
# d3 = MultiArrayDimension(label='channels', size=channels, stride=channels)
#
# layout = MultiArrayLayout(dim = [d1,d2,d3])
# multiarray = UInt8MultiArray(layout=layout, data=data)
# return RosImage(label='image', encoding='bgr', depth='uint8', uint8_data=multiarray)
###
## Fill holes in a binary image using scipy
##
#def fill_holes(cv_img):
# img_np = ut.cv2np(cv_img)
# img_binary = img_np[:,:,0]
# results = ni.binary_fill_holes(img_binary)
# img_cv = ut.np2cv(np_mask2np_image(results))
# return img_cv
| ajibawa-2023/Python-Code-Large/train/row_99256 | 91 | 213 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0047, 0.0047, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0094, 0.0047, 0, 0.66, 0.0417, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_opencv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:ImportFrom_L4_C0", "label": "from std_msgs.msg import UInt8MultiArray", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0188, 0.0047, 0, 0.66, 0.0833, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["UInt8MultiArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import UInt8MultiArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:ImportFrom_L5_C0", "label": "from std_msgs.msg import MultiArrayLayout", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0235, 0.0047, 0, 0.66, 0.125, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["MultiArrayLayout"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import MultiArrayLayout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:ImportFrom_L6_C0", "label": "from std_msgs.msg import MultiArrayDimension", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0282, 0.0047, 0, 0.66, 0.1667, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["MultiArrayDimension"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import MultiArrayDimension"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L8_C0", "label": "opencv import cv", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0376, 0.0047, 0, 0.66, 0.2083, 437, 0, 1, 0, 0, 437, 0, 0], "semantic": {"name": "opencv", "arg_names": [], "import_names": ["cv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv as cv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L9_C0", "label": "opencv.highgui import hg", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.0047, 0, 0.66, 0.25, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["hg"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.highgui as hg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L10_C0", "label": "opencv.adaptors import ad", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0469, 0.0047, 0, 0.66, 0.2917, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "opencv.adaptors", "arg_names": [], "import_names": ["ad"], "rhs_call_name": "", "annotation": ""}, "snippet": "import opencv.adaptors as ad"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L11_C0", "label": "Image import pil", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0516, 0.0047, 0, 0.66, 0.3333, 721, 0, 1, 0, 0, 721, 0, 0], "semantic": {"name": "Image", "arg_names": [], "import_names": ["pil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Image as pil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L12_C0", "label": "numpy import np", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0563, 0.0047, 0, 0.66, 0.375, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "label": "ros2cv", "type": "function", "loc": [21, 65], "level": 0, "parent": null, "vector": [2, 0, 0.2019, 0.2113, 0, 0.66, 0.4167, 556, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "ros2cv", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ros2cv(image):\n #ros to pil then pil to opencv\n #if image.encoding != 'bgr' and image.encoding != 'rgb' and image.encoding != 'bgr8':\n channels = 1\n if image.encoding != 'bgr8':\n raise RuntimeError('Unsupported format \"%s\"' % image.encoding)\n else:\n channels = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L24_C4", "label": "channels =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.1127, 0.0047, 1, 0.23, 0.0, 989, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "channels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " channels = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L25_C4", "label": "if", "type": "if", "loc": [25, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [4, 1, 0.1244, 0.0188, 1, 0.23, 0.1, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if image.encoding != 'bgr8':\n raise RuntimeError('Unsupported format \"%s\"' % image.encoding)\n else:\n channels = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L28_C8", "label": "channels =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L25_C4", "vector": [14, 2, 0.1315, 0.0047, 2, 0.91, 0.0, 989, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "channels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " channels = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L29_C4", "label": "if", "type": "if", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [4, 1, 0.1385, 0.0094, 1, 0.23, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if image.is_bigendian != 0:\n raise RuntimeError('Unsupported endianess')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L45_C4", "label": "height =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.2113, 0.0047, 1, 0.23, 0.3, 751, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height = image.height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L46_C4", "label": "width =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.216, 0.0047, 1, 0.23, 0.4, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = image.width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L47_C4", "label": "np_image = reshape()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.2207, 0.0047, 1, 0.23, 0.5, 195, 3, 2, 0, 0, 276, 10, 2], "semantic": {"name": "np_image", "arg_names": [], "import_names": [], "rhs_call_name": "reshape", "annotation": ""}, "snippet": " np_image = np.reshape(np.fromstring(image.data, dtype='uint8', count=height*width*channels), [height, width, 3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L52_C4", "label": "np_image2 = empty()", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.2441, 0.0047, 1, 0.23, 0.6, 963, 3, 2, 0, 0, 365, 10, 1], "semantic": {"name": "np_image2", "arg_names": [], "import_names": [], "rhs_call_name": "empty", "annotation": ""}, "snippet": " np_image2 = np.empty(np_image.shape, dtype='uint8')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L53_C4", "label": "assign", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.2488, 0.0047, 1, 0.23, 0.7, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " np_image2[:, :, 0] = np_image[:, :, 2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L54_C4", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.2535, 0.0047, 1, 0.23, 0.8, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " np_image2[:, :, 1] = np_image[:, :, 1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L55_C4", "label": "assign", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [14, 1, 0.2582, 0.0047, 1, 0.23, 0.9, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " np_image2[:, :, 2] = np_image[:, :, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L65_C4", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "vector": [13, 1, 0.3052, 0.0047, 1, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ad.NumPy2Ipl(np_image2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "label": "text", "type": "function", "loc": [74, 77], "level": 0, "parent": null, "vector": [2, 0, 0.3545, 0.0188, 0, 0.66, 0.4583, 439, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "text", "arg_names": ["image", "x", "y", "a_string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def text(image, x, y, a_string):\n font = cv.cvInitFont(CV_FONT_HERSHEY_SIMPLEX, .3, .3)\n cv.cvPutText(image, a_string, cv.cvPoint(x, y), font, cv.cvScalar(0,0,0))\n cv.cvPutText(image, a_string, cv.cvPoint(x+1, y+1), font, cv.cvScalar(255,255,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L75_C4", "label": "font = cvInitFont()", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "vector": [14, 1, 0.3521, 0.0047, 1, 0.46, 0.0, 768, 3, 3, 0, 0, 966, 10, 1], "semantic": {"name": "font", "arg_names": [], "import_names": [], "rhs_call_name": "cvInitFont", "annotation": ""}, "snippet": " font = cv.cvInitFont(CV_FONT_HERSHEY_SIMPLEX, .3, .3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L76_C4", "label": "cvPutText()", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "vector": [8, 1, 0.3568, 0.0047, 1, 0.46, 0.5, 481, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "cvPutText", "arg_names": [], "import_names": [], "rhs_call_name": "cvPutText", "annotation": ""}, "snippet": " cv.cvPutText(image, a_string, cv.cvPoint(x, y), font, cv.cvScalar(0,0,0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L77_C4", "label": "cvPutText()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "vector": [8, 1, 0.3615, 0.0047, 1, 0.46, 1.0, 481, 3, 5, 0, 0, 0, 0, 3], "semantic": {"name": "cvPutText", "arg_names": [], "import_names": [], "rhs_call_name": "cvPutText", "annotation": ""}, "snippet": " cv.cvPutText(image, a_string, cv.cvPoint(x+1, y+1), font, cv.cvScalar(255,255,255))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L79_C0", "label": "clone_image", "type": "function", "loc": [79, 80], "level": 0, "parent": null, "vector": [2, 0, 0.3732, 0.0094, 0, 0.66, 0.5, 949, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "clone_image", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clone_image(image):\n return cv.cvCloneImage(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L80_C4", "label": "return", "type": "return", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L79_C0", "vector": [13, 1, 0.3756, 0.0047, 1, 0.69, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cv.cvCloneImage(image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L82_C0", "label": "save_image", "type": "function", "loc": [82, 83], "level": 0, "parent": null, "vector": [2, 0, 0.3873, 0.0094, 0, 0.66, 0.5417, 484, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "save_image", "arg_names": ["name", "image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_image(name, image):\n hg.cvSaveImage(name, image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L83_C4", "label": "cvSaveImage()", "type": "expression", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L82_C0", "vector": [8, 1, 0.3897, 0.0047, 1, 0.29, 0.0, 100, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " hg.cvSaveImage(name, image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L85_C0", "label": "show_image", "type": "function", "loc": [85, 86], "level": 0, "parent": null, "vector": [2, 0, 0.4014, 0.0094, 0, 0.66, 0.5833, 192, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "show_image", "arg_names": ["name", "image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def show_image(name, image):\n hg.cvShowImage(name, image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L86_C4", "label": "cvShowImage()", "type": "expression", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L85_C0", "vector": [8, 1, 0.4038, 0.0047, 1, 0.49, 0.0, 105, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvShowImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvShowImage", "annotation": ""}, "snippet": " hg.cvShowImage(name, image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L88_C0", "label": "named_window", "type": "function", "loc": [88, 89], "level": 0, "parent": null, "vector": [2, 0, 0.4155, 0.0094, 0, 0.66, 0.625, 452, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "named_window", "arg_names": ["name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def named_window(name):\n hg.cvNamedWindow(name, hg.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L89_C4", "label": "cvNamedWindow()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L88_C0", "vector": [8, 1, 0.4178, 0.0047, 1, 0.19, 0.0, 431, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvNamedWindow", "arg_names": [], "import_names": [], "rhs_call_name": "cvNamedWindow", "annotation": ""}, "snippet": " hg.cvNamedWindow(name, hg.CV_WINDOW_AUTOSIZE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L91_C0", "label": "wait_key", "type": "function", "loc": [91, 92], "level": 0, "parent": null, "vector": [2, 0, 0.4296, 0.0094, 0, 0.66, 0.6667, 543, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "wait_key", "arg_names": ["msecs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wait_key(msecs=33):\n return hg.cvWaitKey(msecs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L92_C4", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L91_C0", "vector": [13, 1, 0.4319, 0.0047, 1, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hg.cvWaitKey(msecs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "label": "morpho_close", "type": "function", "loc": [111, 116], "level": 0, "parent": null, "vector": [2, 0, 0.5329, 0.0282, 0, 0.66, 0.7083, 304, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "morpho_close", "arg_names": ["cv_image", "n_times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def morpho_close(cv_image, n_times=1):\n dst = cv.cvCloneImage(cv_image)\n dst2 = cv.cvCloneImage(cv_image)\n cv.cvDilate(cv_image, dst, None, n_times)\n cv.cvErode(dst, dst2, None, n_times)\n return dst2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L112_C4", "label": "dst = cvCloneImage()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "vector": [14, 1, 0.5258, 0.0047, 1, 0.18, 0.0, 856, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " dst = cv.cvCloneImage(cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L113_C4", "label": "dst2 = cvCloneImage()", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "vector": [14, 1, 0.5305, 0.0047, 1, 0.18, 0.25, 227, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "dst2", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " dst2 = cv.cvCloneImage(cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L114_C4", "label": "cvDilate()", "type": "expression", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "vector": [8, 1, 0.5352, 0.0047, 1, 0.18, 0.5, 26, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvDilate", "arg_names": [], "import_names": [], "rhs_call_name": "cvDilate", "annotation": ""}, "snippet": " cv.cvDilate(cv_image, dst, None, n_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L115_C4", "label": "cvErode()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "vector": [8, 1, 0.5399, 0.0047, 1, 0.18, 0.75, 815, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvErode", "arg_names": [], "import_names": [], "rhs_call_name": "cvErode", "annotation": ""}, "snippet": " cv.cvErode(dst, dst2, None, n_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L116_C4", "label": "return", "type": "return", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "vector": [13, 1, 0.5446, 0.0047, 1, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dst2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "label": "morpho_open", "type": "function", "loc": [120, 125], "level": 0, "parent": null, "vector": [2, 0, 0.5751, 0.0282, 0, 0.66, 0.75, 134, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "morpho_open", "arg_names": ["cv_image", "n_times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def morpho_open(cv_image, n_times=1):\n dst = cv.cvCloneImage(cv_image)\n dst2 = cv.cvCloneImage(cv_image)\n cv.cvErode(cv_image, dst, None, n_times)\n cv.cvDilate(dst, dst2, None, n_times)\n return dst2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L121_C4", "label": "dst = cvCloneImage()", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "vector": [14, 1, 0.5681, 0.0047, 1, 0.84, 0.0, 856, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " dst = cv.cvCloneImage(cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L122_C4", "label": "dst2 = cvCloneImage()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "vector": [14, 1, 0.5728, 0.0047, 1, 0.84, 0.25, 227, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "dst2", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " dst2 = cv.cvCloneImage(cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L123_C4", "label": "cvErode()", "type": "expression", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "vector": [8, 1, 0.5775, 0.0047, 1, 0.84, 0.5, 815, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvErode", "arg_names": [], "import_names": [], "rhs_call_name": "cvErode", "annotation": ""}, "snippet": " cv.cvErode(cv_image, dst, None, n_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L124_C4", "label": "cvDilate()", "type": "expression", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "vector": [8, 1, 0.5822, 0.0047, 1, 0.84, 0.75, 26, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvDilate", "arg_names": [], "import_names": [], "rhs_call_name": "cvDilate", "annotation": ""}, "snippet": " cv.cvDilate(dst, dst2, None, n_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L125_C4", "label": "return", "type": "return", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "vector": [13, 1, 0.5869, 0.0047, 1, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dst2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "label": "dilate", "type": "function", "loc": [129, 132], "level": 0, "parent": null, "vector": [2, 0, 0.6127, 0.0188, 0, 0.66, 0.7917, 803, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "dilate", "arg_names": ["cv_image", "n_times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dilate(cv_image, n_times=1):\n dst = cv.cvCloneImage(cv_image)\n cv.cvDilate(cv_img, dst, None, n_times)\n return dst"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L130_C4", "label": "dst = cvCloneImage()", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "vector": [14, 1, 0.6103, 0.0047, 1, 0.26, 0.0, 856, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " dst = cv.cvCloneImage(cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L131_C4", "label": "cvDilate()", "type": "expression", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "vector": [8, 1, 0.615, 0.0047, 1, 0.26, 0.5, 26, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvDilate", "arg_names": [], "import_names": [], "rhs_call_name": "cvDilate", "annotation": ""}, "snippet": " cv.cvDilate(cv_img, dst, None, n_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L132_C4", "label": "return", "type": "return", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "vector": [13, 1, 0.6197, 0.0047, 1, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dst"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "label": "erode", "type": "function", "loc": [136, 139], "level": 0, "parent": null, "vector": [2, 0, 0.6455, 0.0188, 0, 0.66, 0.8333, 875, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "erode", "arg_names": ["cv_image", "n_times"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def erode(cv_image, n_times=1):\n dst = cv.cvCloneImage(cv_image)\n cv.cvErode(cv_img, dst, None, n_times)\n return dst"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L137_C4", "label": "dst = cvCloneImage()", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "vector": [14, 1, 0.6432, 0.0047, 1, 0.11, 0.0, 856, 3, 1, 0, 0, 483, 10, 1], "semantic": {"name": "dst", "arg_names": [], "import_names": [], "rhs_call_name": "cvCloneImage", "annotation": ""}, "snippet": " dst = cv.cvCloneImage(cv_image)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L138_C4", "label": "cvErode()", "type": "expression", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "vector": [8, 1, 0.6479, 0.0047, 1, 0.11, 0.5, 815, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "cvErode", "arg_names": [], "import_names": [], "rhs_call_name": "cvErode", "annotation": ""}, "snippet": " cv.cvErode(cv_img, dst, None, n_times)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L139_C4", "label": "return", "type": "return", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "vector": [13, 1, 0.6526, 0.0047, 1, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dst"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "label": "mask", "type": "function", "loc": [147, 162], "level": 0, "parent": null, "vector": [2, 0, 0.7254, 0.0751, 0, 0.66, 0.875, 904, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "mask", "arg_names": ["img", "img_mask"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def mask(img, img_mask):\n dim = img.width, img.height\n depth = img.depth\n channels = img.nChannels\n\n r_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)\n g_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)\n b_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L148_C4", "label": "dim =", "type": "assigned_variable", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.6948, 0.0047, 1, 0.58, 0.0, 596, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "dim", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dim = img.width, img.height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L149_C4", "label": "depth =", "type": "assigned_variable", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.6995, 0.0047, 1, 0.58, 0.0833, 341, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "depth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " depth = img.depth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L150_C4", "label": "channels =", "type": "assigned_variable", "loc": [150, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.7042, 0.0047, 1, 0.58, 0.1667, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "channels", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " channels = img.nChannels"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L152_C4", "label": "r_chan = cvCreateImage()", "type": "assigned_variable", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.7136, 0.0047, 1, 0.58, 0.25, 280, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "r_chan", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " r_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L153_C4", "label": "g_chan = cvCreateImage()", "type": "assigned_variable", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.7183, 0.0047, 1, 0.58, 0.3333, 823, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "g_chan", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " g_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L154_C4", "label": "b_chan = cvCreateImage()", "type": "assigned_variable", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.723, 0.0047, 1, 0.58, 0.4167, 701, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "b_chan", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " b_chan = cv.cvCreateImage(cv.cvSize(*dim), depth, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L155_C4", "label": "combined = cvCreateImage()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [14, 1, 0.7277, 0.0047, 1, 0.58, 0.5, 339, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "combined", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " combined = cv.cvCreateImage(cv.cvSize(*dim), depth, 3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L156_C4", "label": "cvSplit()", "type": "expression", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [8, 1, 0.7324, 0.0047, 1, 0.58, 0.5833, 389, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "cvSplit", "arg_names": [], "import_names": [], "rhs_call_name": "cvSplit", "annotation": ""}, "snippet": " cv.cvSplit(img, r_chan, g_chan, b_chan, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L158_C4", "label": "cvAnd()", "type": "expression", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [8, 1, 0.7418, 0.0047, 1, 0.58, 0.6667, 273, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvAnd", "arg_names": [], "import_names": [], "rhs_call_name": "cvAnd", "annotation": ""}, "snippet": " cv.cvAnd(r_chan, img_mask, r_chan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L159_C4", "label": "cvAnd()", "type": "expression", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [8, 1, 0.7465, 0.0047, 1, 0.58, 0.75, 273, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvAnd", "arg_names": [], "import_names": [], "rhs_call_name": "cvAnd", "annotation": ""}, "snippet": " cv.cvAnd(g_chan, img_mask, g_chan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L160_C4", "label": "cvAnd()", "type": "expression", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [8, 1, 0.7512, 0.0047, 1, 0.58, 0.8333, 273, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvAnd", "arg_names": [], "import_names": [], "rhs_call_name": "cvAnd", "annotation": ""}, "snippet": " cv.cvAnd(b_chan, img_mask, b_chan)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L161_C4", "label": "cvMerge()", "type": "expression", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [8, 1, 0.7559, 0.0047, 1, 0.58, 0.9167, 832, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "cvMerge", "arg_names": [], "import_names": [], "rhs_call_name": "cvMerge", "annotation": ""}, "snippet": " cv.cvMerge(r_chan, g_chan, b_chan, None, combined)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L162_C4", "label": "return", "type": "return", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "vector": [13, 1, 0.7606, 0.0047, 1, 0.58, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "label": "split", "type": "function", "loc": [166, 171], "level": 0, "parent": null, "vector": [2, 0, 0.7911, 0.0282, 0, 0.66, 0.9167, 908, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "split", "arg_names": ["image"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def split(image):\n img1 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)\n img2 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)\n img3 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)\n cv.cvSplit(image, img1, img2, img3, None)\n return (img1, img2, img3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L167_C4", "label": "img1 = cvCreateImage()", "type": "assigned_variable", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "vector": [14, 1, 0.784, 0.0047, 1, 0.57, 0.0, 533, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "img1", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img1 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L168_C4", "label": "img2 = cvCreateImage()", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "vector": [14, 1, 0.7887, 0.0047, 1, 0.57, 0.25, 750, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "img2", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img2 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L169_C4", "label": "img3 = cvCreateImage()", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "vector": [14, 1, 0.7934, 0.0047, 1, 0.57, 0.5, 549, 3, 3, 0, 0, 953, 10, 2], "semantic": {"name": "img3", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " img3 = cv.cvCreateImage(cv.cvSize(image.width, image.height), 8, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L170_C4", "label": "cvSplit()", "type": "expression", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "vector": [8, 1, 0.7981, 0.0047, 1, 0.57, 0.75, 389, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "cvSplit", "arg_names": [], "import_names": [], "rhs_call_name": "cvSplit", "annotation": ""}, "snippet": " cv.cvSplit(image, img1, img2, img3, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L171_C4", "label": "return", "type": "return", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "vector": [13, 1, 0.8028, 0.0047, 1, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (img1, img2, img3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "label": "scale", "type": "function", "loc": [177, 180], "level": 0, "parent": null, "vector": [2, 0, 0.838, 0.0188, 0, 0.66, 0.9583, 18, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "scale", "arg_names": ["image", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def scale(image, s):\n scaled = cv.cvCreateImage(cv.cvSize(int(image.width * s), int(image.height * s)), image.depth, image.nChannels)\n cv.cvResize(image, scaled, cv.CV_INTER_AREA)\n return scaled"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L178_C4", "label": "scaled = cvCreateImage()", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "vector": [14, 1, 0.8357, 0.0047, 1, 0.62, 0.0, 396, 3, 3, 0, 0, 953, 10, 4], "semantic": {"name": "scaled", "arg_names": [], "import_names": [], "rhs_call_name": "cvCreateImage", "annotation": ""}, "snippet": " scaled = cv.cvCreateImage(cv.cvSize(int(image.width * s), int(image.height * s)), image.depth, image.nChannels)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L179_C4", "label": "cvResize()", "type": "expression", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "vector": [8, 1, 0.8404, 0.0047, 1, 0.62, 0.5, 382, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "cvResize", "arg_names": [], "import_names": [], "rhs_call_name": "cvResize", "annotation": ""}, "snippet": " cv.cvResize(image, scaled, cv.CV_INTER_AREA)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L180_C4", "label": "return", "type": "return", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "vector": [13, 1, 0.8451, 0.0047, 1, 0.62, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return scaled"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "label": "if", "type": "if", "loc": [182, 194], "level": 0, "parent": null, "vector": [4, 0, 0.8826, 0.061, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import opencv.highgui as hg\n import rospy\n from photo.srv import *\n #a = create_ros_image()\n #print a\n\n rospy.wait_for_service('/photo/capture')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L183_C4", "label": "opencv.highgui import hg", "type": "import", "loc": [183, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [1, 1, 0.8592, 0.0047, 1, 0.73, 0.0, 453, 0, 1, 0, 0, 453, 0, 0], "semantic": {"name": "opencv.highgui", "arg_names": [], "import_names": ["hg"], "rhs_call_name": "", "annotation": ""}, "snippet": " import opencv.highgui as hg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L184_C4", "label": "rospy import rospy", "type": "import", "loc": [184, 184], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [1, 1, 0.8638, 0.0047, 1, 0.73, 0.125, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": " import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:ImportFrom_L185_C4", "label": "from photo.srv import *", "type": "import", "loc": [185, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [1, 1, 0.8685, 0.0047, 1, 0.73, 0.25, 673, 0, 1, 0, 0, 673, 0, 0], "semantic": {"name": "photo.srv", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": " from photo.srv import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L189_C4", "label": "wait_for_service()", "type": "expression", "loc": [189, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [8, 1, 0.8873, 0.0047, 1, 0.73, 0.375, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service('/photo/capture')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L190_C4", "label": "say_cheese = ServiceProxy()", "type": "assigned_variable", "loc": [190, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [14, 1, 0.892, 0.0047, 1, 0.73, 0.5, 264, 3, 2, 0, 0, 915, 10, 1], "semantic": {"name": "say_cheese", "arg_names": [], "import_names": [], "rhs_call_name": "ServiceProxy", "annotation": ""}, "snippet": " say_cheese = rospy.ServiceProxy('/photo/capture', Capture)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L191_C4", "label": "ros_img =", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [14, 1, 0.8967, 0.0047, 1, 0.73, 0.625, 478, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ros_img", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_img = say_cheese().image"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L192_C4", "label": "print()", "type": "expression", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [8, 1, 0.9014, 0.0047, 1, 0.73, 0.75, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(dir(ros_img))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L193_C4", "label": "cv_img = ros2cv()", "type": "assigned_variable", "loc": [193, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [14, 1, 0.9061, 0.0047, 1, 0.73, 0.875, 348, 3, 1, 0, 0, 556, 10, 1], "semantic": {"name": "cv_img", "arg_names": [], "import_names": [], "rhs_call_name": "ros2cv", "annotation": ""}, "snippet": " cv_img = ros2cv(ros_img)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L194_C4", "label": "cvSaveImage()", "type": "expression", "loc": [194, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "vector": [8, 1, 0.9108, 0.0047, 1, 0.73, 1.0, 100, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cvSaveImage", "arg_names": [], "import_names": [], "rhs_call_name": "cvSaveImage", "annotation": ""}, "snippet": " hg.cvSaveImage('test.png', cv_img)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L111_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L136_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L147_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:FunctionDef_L177_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Return_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Import_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:ImportFrom_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L190_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Assign_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99256:If_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99256:Expr_L194_C4"}] |
#!/usr/bin/env python
import roslib
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'std_msgs' )
import rospy
from std_msgs.msg import Float64, Int8
import numpy as np
rospy.init_node( 'move_joint_node' )
topic = 'r_shoulder_pan_controller/command'
topic = 'r_forearm_roll_controller/command'
pub = rospy.Publisher( topic, Float64 )
update_pub = rospy.Publisher( '/joint_state_viz/update', Int8 )
soft_lower_limit = -np.pi
soft_upper_limit = np.pi
# soft_lower_limit = -2.1353981634
# soft_upper_limit = 0.564601836603
counter = 0
while not rospy.is_shutdown():
counter = counter + 1
print( '----- %d -----'%counter )
pos = np.random.rand() * ( soft_upper_limit - soft_lower_limit ) + soft_lower_limit
rospy.loginfo( 'move to pos %6.4f'%pos )
update_pub.publish( 0 )
rospy.sleep( 0.5 )
pub.publish( pos )
rospy.sleep( 1 )
update_pub.publish( 1 )
if counter == 500:
break
| ajibawa-2023/Python-Code-Large/train/row_99258 | 25 | 45 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0222, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0889, 0.0222, 0, 0.66, 0.0714, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rospy' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.1111, 0.0222, 0, 0.66, 0.1429, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'std_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1556, 0.0222, 0, 0.66, 0.2143, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:ImportFrom_L9_C0", "label": "from std_msgs.msg import Float64, Int8", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.0222, 0, 0.66, 0.2857, 366, 0, 2, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64", "Int8"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64, Int8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Import_L11_C0", "label": "numpy import np", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2444, 0.0222, 0, 0.66, 0.3571, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L13_C0", "label": "init_node()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.2889, 0.0222, 0, 0.66, 0.4286, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": "rospy.init_node( 'move_joint_node' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L14_C0", "label": "topic =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.3111, 0.0222, 0, 0.66, 0.5, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "topic = 'r_shoulder_pan_controller/command'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L16_C0", "label": "topic =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.3556, 0.0222, 0, 0.66, 0.5714, 225, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "topic = 'r_forearm_roll_controller/command'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L18_C0", "label": "pub = Publisher()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0222, 0, 0.66, 0.6429, 41, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "pub = rospy.Publisher( topic, Float64 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L20_C0", "label": "update_pub = Publisher()", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0222, 0, 0.66, 0.7143, 241, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "update_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": "update_pub = rospy.Publisher( '/joint_state_viz/update', Int8 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L22_C0", "label": "soft_lower_limit =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.4889, 0.0222, 0, 0.66, 0.7857, 170, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "soft_lower_limit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "soft_lower_limit = -np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L23_C0", "label": "soft_upper_limit =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.5111, 0.0222, 0, 0.66, 0.8571, 621, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "soft_upper_limit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "soft_upper_limit = np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L28_C0", "label": "counter =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.6222, 0.0222, 0, 0.66, 0.9286, 7, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "label": "while", "type": "while", "loc": [30, 45], "level": 0, "parent": null, "vector": [5, 0, 0.8333, 0.3556, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "while not rospy.is_shutdown():\n \n counter = counter + 1\n print( '----- %d -----'%counter )\n \n pos = np.random.rand() * ( soft_upper_limit - soft_lower_limit ) + soft_lower_limit\n rospy.loginfo( 'move to pos %6.4f'%pos )\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L32_C4", "label": "counter =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [14, 1, 0.7111, 0.0222, 1, 0.43, 0.0, 7, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " counter = counter + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L33_C4", "label": "print()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.7333, 0.0222, 1, 0.43, 0.1111, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( '----- %d -----'%counter )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L35_C4", "label": "pos =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [14, 1, 0.7778, 0.0222, 1, 0.43, 0.2222, 627, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = np.random.rand() * ( soft_upper_limit - soft_lower_limit ) + soft_lower_limit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L36_C4", "label": "loginfo()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.8, 0.0222, 1, 0.43, 0.3333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'move to pos %6.4f'%pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L38_C4", "label": "publish()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.8444, 0.0222, 1, 0.43, 0.4444, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " update_pub.publish( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L39_C4", "label": "sleep()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.8667, 0.0222, 1, 0.43, 0.5556, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 0.5 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L40_C4", "label": "publish()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.8889, 0.0222, 1, 0.43, 0.6667, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " pub.publish( pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L41_C4", "label": "sleep()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.9111, 0.0222, 1, 0.43, 0.7778, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L42_C4", "label": "publish()", "type": "expression", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [8, 1, 0.9333, 0.0222, 1, 0.43, 0.8889, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " update_pub.publish( 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99258:If_L44_C4", "label": "if", "type": "if", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "vector": [4, 1, 0.9889, 0.0444, 1, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if counter == 500:\n break"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:Expr_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99258:While_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99258:If_L44_C4"}] |
#!/usr/bin/env python
import roslib
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'kinematics_msgs' )
roslib.load_manifest( 'geometry_msgs' )
import rospy
from kinematics_msgs.srv import \
GetPositionIK, GetPositionIKRequest
from geometry_msgs.msg import \
Pose, Point, Quaternion
import numpy as np
import dynamics_utils as dynutils
if __name__== '__main__':
node_name = "circle_node"
rospy.loginfo( 'register node %s ...'%node_name )
rospy.init_node( node_name )
rospy.loginfo( 'node %s up and running!'%node_name )
joint_names = dynutils.get_joint_names( 'l_arm_controller' )
ik_service_name = 'pr2_left_arm_kinematics/get_ik'
rospy.loginfo( 'wait for service %s ...'%ik_service_name )
rospy.wait_for_service( ik_service_name )
ik_service = rospy.ServiceProxy( ik_service_name, GetPositionIK )
rospy.loginfo( 'ik service %s is up and running!'%ik_service_name )
# trajectory in cartesian space
time = 5.0; # trajectory time in sec
n = int(time * 200)
dt = time / n;
alphas = np.linspace( 0, 2 * np.pi, n + 1 )
alphas = alphas[0:-1]
ys = np.cos( alphas ) * 0.2
zs = -np.sin( alphas ) * 0.2
# creating trajectory in joint space
rospy.loginfo( 'creating trajectory ...' )
trajectory = []
req = GetPositionIKRequest()
req.timeout = rospy.Duration(5.0)
req.ik_request.ik_link_name = "l_wrist_roll_link"
req.ik_request.pose_stamped.header.frame_id = "torso_lift_link"
req.ik_request.ik_seed_state.joint_state.name = joint_names
req.ik_request.ik_seed_state.joint_state.position = [0.61309537, 0.45494851, 0.03, -1.03480809, 2.23232079, -0.79696399, -2.44271129]
joint_positions = []
for (y, z) in zip( ys, zs ):
pose = Pose( position = Point( 0.6 + z/2.0, 0.20 + y, 0.0 + z ),
orientation = Quaternion( 0.0, 0.0, 0.0, 1.0 ) )
req.ik_request.pose_stamped.pose = pose
# make the call
try:
# print "send request :" #, req
res = ik_service( req )
if res.error_code.val == res.error_code.SUCCESS:
joint_positions = np.asarray( res.solution.joint_state.position )
else:
print "IK failed, error code : ", res.error_code.val
break
except rospy.ServiceException, e:
print "service call failed: %s"%e
break
trajectory.append( joint_positions )
req.ik_request.ik_seed_state.joint_state.position = joint_positions
rospy.loginfo( 'done!' )
t = np.cumsum( [dt] * n ) - dt
pos = np.asarray( trajectory )
dynutils.wrap_trajectory( pos )
vel = dynutils.compute_derivative( pos, dt )
acc = dynutils.compute_derivative( vel, dt )
dynutils.save_motion( 'circle.pkl', 'circle', t, pos, vel, acc )
| ajibawa-2023/Python-Code-Large/train/row_99259 | 6 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99259:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99259:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99259:ImportFrom_L3_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest", "type": "import", "loc": [3, 4], "level": 0, "parent": null, "vector": [1, 0, 0.35, 0.2, 0, 0.66, 0.4, 247, 0, 2, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import \\\n GetPositionIK, GetPositionIKRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99259:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Pose, Point, Quaternion", "type": "import", "loc": [5, 6], "level": 0, "parent": null, "vector": [1, 0, 0.55, 0.2, 0, 0.66, 0.6, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose", "Point", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import \\\n Pose, Point, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99259:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.8, 0.1, 0, 0.66, 0.8, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99259:Import_L9_C0", "label": "dynamics_utils import dynutils", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.9, 0.1, 0, 0.66, 1.0, 318, 0, 1, 0, 0, 318, 0, 0], "semantic": {"name": "dynamics_utils", "arg_names": [], "import_names": ["dynutils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamics_utils as dynutils"}] | [] |
#!/usr/bin/python
from scipy import pi, sin, cos, array, asarray, linspace, zeros, ones, sqrt
import matplotlib.pyplot as plt
import roslib
roslib.load_manifest( 'pr2_controllers_msgs' )
roslib.load_manifest( 'trajectory_msgs' )
roslib.load_manifest( 'actionlib' )
import rospy
from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
import actionlib
def main():
joint_names = ['l_shoulder_pan_joint',
'l_shoulder_lift_joint',
'l_upper_arm_roll_joint',
'l_elbow_flex_joint',
'l_forearm_roll_joint',
'l_wrist_flex_joint',
'l_wrist_roll_joint']
N = len( joint_names )
# lower_limit = asarray( [-2.13, -0.35, -3.75, -2.32, -2.0 * pi, -2.09, -2.0 * pi ] )
# upper_limit = asarray( [ 0.56,
# 0.8, #1.29,
# 0.65, 0.0, 2.0 * pi, 0.0, 2.0 * pi ] )
lower_limit = asarray( [2.13,
-0.35,
-0.5, #3.75,
-2.0, #-2.32,
-2.0 * pi,
-2.09,
-2.0 * pi ] )
upper_limit = asarray( [-0.56,
0.6, #1.29,
2, #0.65,
0.0,
2.0 * pi,
0.0,
2.0 * pi ] )
A = (lower_limit - upper_limit) * 1/4
f = 0.1
f1 = asarray([f * sqrt(2),
f * sqrt(2),
f * sqrt(2),
f * sqrt(9),
f * sqrt(7),
f * sqrt(1),
f * sqrt(7)])
f2 = asarray([0.4,
0.4,
0.6,
0.9,
1.1,
0.3,
0.9])
start_time = 0.0
dt = 0.001
max_time = 60.0
t = linspace( 0.0, max_time - dt, int( max_time / dt ) )
q = zeros( (N, len( t )))
dq = zeros( (N, len( t )))
ddq = zeros( (N, len( t )))
# start_pos = [ 0, 0, 0, 0, 0, 0, 0 ]
# joint = 2;
for i in range(N):
#if i == joint:
q[i,:] = A[i] * sin( 2.0 * pi * f1[i] * t ) \
+ A[i]/3.0 * sin( 2.0 * pi * f2[i] * t ) + ( upper_limit[i] + lower_limit[i]) / 2.0
dq[i,:] = 2.0 * pi * f1[i] * A[i] * cos( 2.0 * pi * f1[i] * t ) \
+ 2.0/3.0 * pi * f2[i] * A[i] * cos( 2.0 * pi * f2[i] * t )
ddq[i,:] = - 4.0 * pi ** 2 * f1[i] ** 2 * A[i] * sin( 2.0 * pi * f1[i] * t ) \
- 4.0/3.0 * pi ** 2 * f2[i] ** 2 * A[i] * sin( 2.0 * pi * f2[i] * t )
#else:
# q[i,:] = ones( (1, len( t )) ) * start_pos[i]
# plt.subplot( 3, 1, 1);
# plt.plot( q[joint,:] )
# plt.subplot( 3, 1, 2);
# plt.plot( dq[joint,:] )
# plt.subplot( 3, 1, 3);
# plt.plot( ddq[joint,:] )
# plt.show()
rospy.init_node( 'gpr_controller_trajectory_generator' )
client = actionlib.SimpleActionClient( 'l_arm_controller/joint_trajectory_action',
JointTrajectoryAction )
client.wait_for_server()
jt = JointTrajectory()
jt.joint_names = joint_names
jt.points = []
# start at neutral position
jp = JointTrajectoryPoint()
jp.time_from_start = rospy.Time.from_seconds( start_time )
jp.positions = q[:,0]
jp.velocities = [0] * len( joint_names )
jp.accelerations = [0] * len( joint_names )
jt.points.append( jp )
# add precomputed trajectory
for i in range( len( t ) ):
jp = JointTrajectoryPoint()
jp.time_from_start = rospy.Time.from_seconds( t[i] + start_time )
jp.positions = q[:,i]
jp.velocities = dq[:,i]
jp.accelerations = ddq[:,i]
jt.points.append( jp )
# push trajectory goal to ActionServer
goal = JointTrajectoryGoal()
goal.trajectory = jt
goal.trajectory.header.stamp = rospy.Time.now() + rospy.Duration(4.0)
client.send_goal(goal)
client.wait_for_result()
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99260 | 56 | 136 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99260:ImportFrom_L3_C0", "label": "from scipy import pi, sin, cos\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0221, 0.0074, 0, 0.66, 0.0, 265, 0, 9, 0, 0, 265, 0, 0], "semantic": {"name": "scipy", "arg_names": [], "import_names": ["pi", "sin", "cos", "array", "asarray", "linspace", "zeros", "ones", "sqrt"], "rhs_call_name": "", "annotation": ""}, "snippet": "from scipy import pi, sin, cos, array, asarray, linspace, zeros, ones, sqrt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Import_L4_C0", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0074, 0, 0.66, 0.0909, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": ["plt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib.pyplot as plt "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0074, 0, 0.66, 0.1818, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0515, 0.0074, 0, 0.66, 0.2727, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'pr2_controllers_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0074, 0, 0.66, 0.3636, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'trajectory_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0662, 0.0074, 0, 0.66, 0.4545, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'actionlib' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0735, 0.0074, 0, 0.66, 0.5455, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:ImportFrom_L11_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0809, 0.0074, 0, 0.66, 0.6364, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:ImportFrom_L12_C0", "label": "from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0074, 0, 0.66, 0.7273, 485, 0, 2, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectory", "JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Import_L13_C0", "label": "actionlib import actionlib", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0956, 0.0074, 0, 0.66, 0.8182, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "label": "main", "type": "function", "loc": [16, 132], "level": 0, "parent": null, "vector": [2, 0, 0.5441, 0.8603, 0, 0.66, 0.9091, 624, 0, 0, 0, 0, 0, 0, 46], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n joint_names = ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint',\n 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint',\n 'l_forearm_roll_joint',\n 'l_wrist_flex_joint',\n 'l_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L17_C4", "label": "joint_names =", "type": "assigned_variable", "loc": [17, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.1471, 0.0515, 1, 0.48, 0.0, 393, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names = ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint',\n 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint',\n 'l_forearm_roll_joint',\n 'l_wrist_flex_joint',\n 'l_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L25_C4", "label": "N = len()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.1838, 0.0074, 1, 0.48, 0.0303, 644, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "N", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " N = len( joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L32_C4", "label": "lower_limit = asarray()", "type": "assigned_variable", "loc": [32, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.2574, 0.0515, 1, 0.48, 0.0606, 445, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "lower_limit", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " lower_limit = asarray( [2.13,\n -0.35,\n -0.5, #3.75,\n -2.0, #-2.32,\n -2.0 * pi,\n -2.09,\n -2.0 * pi ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L39_C4", "label": "upper_limit = asarray()", "type": "assigned_variable", "loc": [39, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.3088, 0.0515, 1, 0.48, 0.0909, 119, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "upper_limit", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " upper_limit = asarray( [-0.56, \n 0.6, #1.29, \n 2, #0.65,\n 0.0,\n 2.0 * pi,\n 0.0,\n 2.0 * pi ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L47_C4", "label": "A =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.3456, 0.0074, 1, 0.48, 0.1212, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A = (lower_limit - upper_limit) * 1/4 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L49_C4", "label": "f =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.3603, 0.0074, 1, 0.48, 0.1515, 899, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L51_C4", "label": "f1 = asarray()", "type": "assigned_variable", "loc": [51, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.3971, 0.0515, 1, 0.48, 0.1818, 282, 3, 1, 0, 0, 43, 10, 8], "semantic": {"name": "f1", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " f1 = asarray([f * sqrt(2), \n f * sqrt(2), \n f * sqrt(2), \n f * sqrt(9), \n f * sqrt(7),\n f * sqrt(1),\n f * sqrt(7)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L59_C4", "label": "f2 = asarray()", "type": "assigned_variable", "loc": [59, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.4559, 0.0515, 1, 0.48, 0.2121, 833, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "f2", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " f2 = asarray([0.4, \n 0.4, \n 0.6, \n 0.9, \n 1.1, \n 0.3, \n 0.9])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L67_C4", "label": "start_time =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.4926, 0.0074, 1, 0.48, 0.2424, 511, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_time = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L68_C4", "label": "dt =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.5, 0.0074, 1, 0.48, 0.2727, 455, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dt = 0.001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L69_C4", "label": "max_time =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.5074, 0.0074, 1, 0.48, 0.303, 334, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_time = 60.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L70_C4", "label": "t = linspace()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.5147, 0.0074, 1, 0.48, 0.3333, 15, 3, 3, 0, 0, 119, 10, 2], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " t = linspace( 0.0, max_time - dt, int( max_time / dt ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L72_C4", "label": "q = zeros()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.5294, 0.0074, 1, 0.48, 0.3636, 516, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " q = zeros( (N, len( t )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L73_C4", "label": "dq = zeros()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.5368, 0.0074, 1, 0.48, 0.3939, 387, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "dq", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " dq = zeros( (N, len( t )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L74_C4", "label": "ddq = zeros()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.5441, 0.0074, 1, 0.48, 0.4242, 812, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "ddq", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " ddq = zeros( (N, len( t )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "label": "for i", "type": "for", "loc": [79, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [6, 1, 0.6066, 0.0588, 1, 0.48, 0.4545, 826, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(N):\n #if i == joint:\n q[i,:] = A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n + A[i]/3.0 * sin( 2.0 * pi * f2[i] * t ) + ( upper_limit[i] + lower_limit[i]) / 2.0\n dq[i,:] = 2.0 * pi * f1[i] * A[i] * cos( 2.0 * pi * f1[i] * t ) \\\n + 2.0/3.0 * pi * f2[i] * A[i] * cos( 2.0 * pi * f2[i] * t )\n ddq[i,:] = - 4.0 * pi ** 2 * f1[i] ** 2 * A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n - 4.0/3.0 * pi ** 2 * f2[i] ** 2 * A[i] * sin( 2.0 * pi * f2[i] * t )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L81_C12", "label": "assign", "type": "assigned_variable", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "vector": [14, 2, 0.5993, 0.0147, 2, 0.45, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[i,:] = A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n + A[i]/3.0 * sin( 2.0 * pi * f2[i] * t ) + ( upper_limit[i] + lower_limit[i]) / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L83_C12", "label": "assign", "type": "assigned_variable", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "vector": [14, 2, 0.614, 0.0147, 2, 0.45, 0.5, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dq[i,:] = 2.0 * pi * f1[i] * A[i] * cos( 2.0 * pi * f1[i] * t ) \\\n + 2.0/3.0 * pi * f2[i] * A[i] * cos( 2.0 * pi * f2[i] * t )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L85_C12", "label": "assign", "type": "assigned_variable", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "vector": [14, 2, 0.6287, 0.0147, 2, 0.45, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ddq[i,:] = - 4.0 * pi ** 2 * f1[i] ** 2 * A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n - 4.0/3.0 * pi ** 2 * f2[i] ** 2 * A[i] * sin( 2.0 * pi * f2[i] * t )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L99_C4", "label": "init_node()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [8, 1, 0.7279, 0.0074, 1, 0.48, 0.4848, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'gpr_controller_trajectory_generator' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L102_C4", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.7537, 0.0147, 1, 0.48, 0.5152, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'l_arm_controller/joint_trajectory_action', \n JointTrajectoryAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L104_C4", "label": "wait_for_server()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [8, 1, 0.7647, 0.0074, 1, 0.48, 0.5455, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L106_C4", "label": "jt = JointTrajectory()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.7794, 0.0074, 1, 0.48, 0.5758, 61, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jt", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " jt = JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L107_C4", "label": "jt.joint_names =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.7868, 0.0074, 1, 0.48, 0.6061, 350, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.joint_names = joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L108_C4", "label": "jt.points =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.7941, 0.0074, 1, 0.48, 0.6364, 737, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jt.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L111_C4", "label": "jp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.8162, 0.0074, 1, 0.48, 0.6667, 507, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L112_C4", "label": "jp.time_from_start = from_seconds()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.8235, 0.0074, 1, 0.48, 0.697, 186, 3, 1, 0, 0, 866, 10, 1], "semantic": {"name": "jp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "from_seconds", "annotation": ""}, "snippet": " jp.time_from_start = rospy.Time.from_seconds( start_time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L113_C4", "label": "jp.positions =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.8309, 0.0074, 1, 0.48, 0.7273, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.positions = q[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L114_C4", "label": "jp.velocities =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.8382, 0.0074, 1, 0.48, 0.7576, 907, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "jp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.velocities = [0] * len( joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L115_C4", "label": "jp.accelerations =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.8456, 0.0074, 1, 0.48, 0.7879, 836, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "jp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.accelerations = [0] * len( joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L116_C4", "label": "append()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [8, 1, 0.8529, 0.0074, 1, 0.48, 0.8182, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "label": "for i", "type": "for", "loc": [119, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [6, 1, 0.8971, 0.0515, 1, 0.48, 0.8485, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range( len( t ) ):\n jp = JointTrajectoryPoint()\n jp.time_from_start = rospy.Time.from_seconds( t[i] + start_time )\n jp.positions = q[:,i]\n jp.velocities = dq[:,i]\n jp.accelerations = ddq[:,i]\n jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L120_C8", "label": "jp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "vector": [14, 2, 0.8824, 0.0074, 2, 0.81, 0.0, 507, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L121_C8", "label": "jp.time_from_start = from_seconds()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "vector": [14, 2, 0.8897, 0.0074, 2, 0.81, 0.2, 186, 3, 1, 0, 0, 866, 10, 1], "semantic": {"name": "jp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "from_seconds", "annotation": ""}, "snippet": " jp.time_from_start = rospy.Time.from_seconds( t[i] + start_time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L122_C8", "label": "jp.positions =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "vector": [14, 2, 0.8971, 0.0074, 2, 0.81, 0.4, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.positions = q[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L123_C8", "label": "jp.velocities =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "vector": [14, 2, 0.9044, 0.0074, 2, 0.81, 0.6, 907, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.velocities = dq[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L124_C8", "label": "jp.accelerations =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "vector": [14, 2, 0.9118, 0.0074, 2, 0.81, 0.8, 836, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.accelerations = ddq[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L125_C8", "label": "append()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "vector": [8, 2, 0.9191, 0.0074, 2, 0.81, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L128_C4", "label": "goal = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.9412, 0.0074, 1, 0.48, 0.8788, 914, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " goal = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L129_C4", "label": "goal.trajectory =", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.9485, 0.0074, 1, 0.48, 0.9091, 772, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.trajectory = jt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L130_C4", "label": "goal.trajectory.header.stamp =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [14, 1, 0.9559, 0.0074, 1, 0.48, 0.9394, 841, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "goal.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.trajectory.header.stamp = rospy.Time.now() + rospy.Duration(4.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L131_C4", "label": "send_goal()", "type": "expression", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [8, 1, 0.9632, 0.0074, 1, 0.48, 0.9697, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L132_C4", "label": "wait_for_result()", "type": "expression", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "vector": [8, 1, 0.9706, 0.0074, 1, 0.48, 1.0, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:If_L135_C0", "label": "if", "type": "if", "loc": [135, 136], "level": 0, "parent": null, "vector": [4, 0, 0.9963, 0.0147, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L136_C4", "label": "main()", "type": "expression", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99260:If_L135_C0", "vector": [8, 1, 1.0, 0.0074, 1, 0.55, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99260:If_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99260:Expr_L136_C4"}] |
#!/usr/bin/env python
import matplotlib
matplotlib.interactive( True )
matplotlib.use( 'WXAgg' )
import numpy as np
import wx
import sys
import roslib
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'sensor_msgs' )
roslib.load_manifest( 'std_msgs' )
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Int8
from threading import Thread, Lock
class WXMatPlotLibPanel( wx.Panel ):
def __init__( self, parent, color=None, dpi=None, **kwargs ):
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
# initialize Panel
if 'id' not in kwargs.keys():
kwargs['id'] = wx.ID_ANY
if 'style' not in kwargs.keys():
kwargs['style'] = wx.NO_FULL_REPAINT_ON_RESIZE
wx.Panel.__init__( self, parent, **kwargs )
# initialize matplotlib stuff
self.figure = Figure( None, dpi )
self.canvas = FigureCanvasWxAgg( self, -1, self.figure )
#self.SetColor( color )
self._SetSize()
self.draw()
self._resizeflag = False
self.Bind(wx.EVT_IDLE, self._onIdle)
self.Bind(wx.EVT_SIZE, self._onSize)
def SetColor( self, rgbtuple=None ):
"""Set figure and canvas colours to be the same."""
if rgbtuple is None:
rgbtuple = wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ).Get()
clr = [c/255. for c in rgbtuple]
self.figure.set_facecolor( clr )
self.figure.set_edgecolor( clr )
self.canvas.SetBackgroundColour( wx.Colour( *rgbtuple ) )
def _onSize( self, event ):
self._resizeflag = True
def _onIdle( self, evt ):
if self._resizeflag:
self._resizeflag = False
self._SetSize()
def _SetSize( self ):
pixels = tuple( self.parent.GetClientSize() )
self.SetSize( pixels )
self.canvas.SetSize( pixels )
self.figure.set_size_inches( float( pixels[0] )/self.figure.get_dpi(),
float( pixels[1] )/self.figure.get_dpi() )
def draw(self): pass # abstract, to be overridden by child classes
class JointStateVizPanel( WXMatPlotLibPanel ):
def __init__( self, parent, **kwargs ):
self.lock = Lock()
self.parent = parent
self.positions = None
self.velocities = None
self.efforts = None
WXMatPlotLibPanel.__init__( self, parent, **kwargs )
#self.SetColor( (255,255,255) )
def init_plots( self, names, limits ):
N = len( names )
self.axes = []
self.lines = []
self.scatter = []
for j in range( N ):
axes = self.figure.add_subplot( 3, N, j + 1 )
axes.set_title( names[j] )
upper = -np.pi
lower = np.pi
if limits[j].has_key( 'upper' ):
upper = limits[j].get( 'upper' )
if limits[j].has_key( 'lower' ):
lower = limits[j].get( 'lower' )
axes.set_ylim( lower, upper )
axes.set_xticks( [] )
self.lines.append( axes.plot( [0], 'r' )[0] )
axes.autoscale_view( scalex = False, scaley = False )
self.axes.append( axes )
for j in range( N ):
axes = self.figure.add_subplot( 3, N, j + N + 1 )
effort = 30
if limits[j].has_key( 'effort' ):
effort = limits[j].get( 'effort' )
axes.set_ylim( -effort, effort )
axes.set_xticks( [] )
self.lines.append( axes.plot( [0], 'b' )[0] )
self.axes.append( axes )
for j in range( N ):
axes = self.figure.add_subplot( 3, N, j + 2 * N + 1 )
upper = -2 * np.pi
lower = 2 * np.pi
velocity = 2 * np.pi
if limits[j].has_key( 'upper' ):
upper = limits[j].get( 'upper' )
if limits[j].has_key( 'lower' ):
lower = limits[j].get( 'lower' )
if limits[j].has_key( 'velocity' ):
velocity = limits[j].get( 'velocity' )
axes.set_ylim( -velocity, velocity )
axes.set_xlim( lower, upper )
self.scatter.append( axes.scatter( [0], [0],
c = 'b',
s = 2.0,
marker = 'x') )
self.axes.append( axes )
#self.figure.subplots_adjust( wspace = 0.3, hspace = 0.1 )
def update_plots( self ):
# self.lock.acquire()
if not hasattr( self, 'axes' ):
return
if self.positions is None or len( self.positions ) == 0:
return
( l, N ) = self.positions.shape
for j in range( N ):
axes = self.axes[j]
axes.lines[0].remove()
axes.plot( self.positions[:,j], 'r')
for j in range( N ):
axes = self.axes[j + N]
axes.lines[0].remove()
axes.plot( self.efforts[:,j], 'b')
for j in range( N ):
axes = self.axes[j + N * 2]
self.scatter[j].remove()
self.scatter[j] = axes.scatter( self.positions[:,j],
self.velocities[:,j],
c = 'b',
s = 2.0,
marker = 'x')
# self.lock.release()
def draw( self ):
self.update_plots()
def setData( self, pos, vel, eff, duration ):
self.positions = pos
self.velocities = vel
self.efforts = eff
self.duration = duration
self.draw()
class JointStateVizFrame( wx.Frame ) :
def __init__( self, title, ns, js_topic ):
wx.Frame.__init__( self, None, wx.ID_ANY, title, size = (2000, 800) )
self.CreateStatusBar()
self.SetStatusText( 'waiting for data on %s ...'%js_topic )
self.panel = JointStateVizPanel( self )
self.Show()
self.js_sub = rospy.Subscriber( js_topic, JointState, self.js_callback )
self.update_sub = rospy.Subscriber( ''.join( (ns, '/update' ) ), Int8, self.update_callback )
# load parameters
(self.joint_names, self.limits) = self.load_params( ns )
self.idx = None
self.joint_states = []
self.panel.init_plots( self.joint_names, self.limits )
def load_params( self, ns ):
params = rospy.get_param( ns )
joint_names = params.keys()
limits = []
for joint_name in joint_names:
limits.append( params.get( joint_name ) )
return ( joint_names, limits )
def js_callback( self, msg ):
self.joint_states.append( msg )
def update_callback( self, msg ):
if msg.data == 0:
self.joint_states = []
elif msg.data == 1:
self.update()
def update( self ):
if self.joint_names is None or len( self.joint_names ) == 0 or len( self.joint_states ) == 0:
return
if self.idx is None:
self.idx = map( self.joint_states[0].name.index, self.joint_names )
positions = []
velocities = []
efforts = []
for js in self.joint_states:
pos = map( lambda x: js.position[x], self.idx )
vel = map( lambda x: js.velocity[x], self.idx )
effort = map( lambda x: js.effort[x], self.idx )
positions.append( pos )
velocities.append( vel )
efforts.append( effort )
start_time = self.joint_states[0].header.stamp
stop_time = self.joint_states[-1].header.stamp
duration = stop_time - start_time
self.panel.setData( np.asarray( positions ),
np.asarray( velocities ),
np.asarray( efforts ),
duration.to_sec())
# status = ''.join( ( str( self.joint_states[0].header.stamp ),
# ' ',
# str( duration.to_sec() ) ) )
status = 'ros-time: %s, duration: %5.3f sec'%( self.joint_states[0].header.stamp, duration.to_sec() )
self.SetStatusText( status )
self.joint_states = []
arm_joint_names = ['lr_shoulder_pan_joint',
'lr_shoulder_lift_joint',
'lr_upper_arm_roll_joint',
'lr_elbow_flex_joint',
'lr_forearm_roll_joint',
'lr_wrist_flex_joint',
'lr_wrist_roll_joint']
l_arm_joint_names = map(lambda s: s.replace('lr_', 'l_'), arm_joint_names )
r_arm_joint_names = map(lambda s: s.replace('lr_', 'r_'), arm_joint_names )
if __name__ == '__main__':
rospy.init_node( 'joint_state_viz_node' )
app = wx.PySimpleApp( 0 )
frame = JointStateVizFrame( 'Joint-State-Viz', '/joint_state_viz', '/joint_states' )
app.MainLoop()
| ajibawa-2023/Python-Code-Large/train/row_99261 | 184 | 293 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Import_L3_C0", "label": "matplotlib import matplotlib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.0034, 0, 0.66, 0.0, 75, 0, 1, 0, 0, 75, 0, 0], "semantic": {"name": "matplotlib", "arg_names": [], "import_names": ["matplotlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L4_C0", "label": "interactive()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0137, 0.0034, 0, 0.66, 0.05, 348, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "interactive", "arg_names": [], "import_names": [], "rhs_call_name": "interactive", "annotation": ""}, "snippet": "matplotlib.interactive( True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L5_C0", "label": "use()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0171, 0.0034, 0, 0.66, 0.1, 906, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "use", "arg_names": [], "import_names": [], "rhs_call_name": "use", "annotation": ""}, "snippet": "matplotlib.use( 'WXAgg' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Import_L7_C0", "label": "numpy import np", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0239, 0.0034, 0, 0.66, 0.15, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Import_L8_C0", "label": "wx import wx", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0273, 0.0034, 0, 0.66, 0.2, 666, 0, 1, 0, 0, 666, 0, 0], "semantic": {"name": "wx", "arg_names": [], "import_names": ["wx"], "rhs_call_name": "", "annotation": ""}, "snippet": "import wx"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Import_L9_C0", "label": "sys import sys", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0307, 0.0034, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Import_L11_C0", "label": "roslib import roslib", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0375, 0.0034, 0, 0.66, 0.3, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L12_C0", "label": "load_manifest()", "type": "expression", "loc": [12, 12], "level": 0, "parent": null, "vector": [8, 0, 0.041, 0.0034, 0, 0.66, 0.35, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rospy' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L13_C0", "label": "load_manifest()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0444, 0.0034, 0, 0.66, 0.4, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'sensor_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L14_C0", "label": "load_manifest()", "type": "expression", "loc": [14, 14], "level": 0, "parent": null, "vector": [8, 0, 0.0478, 0.0034, 0, 0.66, 0.45, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'std_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Import_L17_C0", "label": "rospy import rospy", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.058, 0.0034, 0, 0.66, 0.5, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L18_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0614, 0.0034, 0, 0.66, 0.55, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L19_C0", "label": "from std_msgs.msg import Int8", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0648, 0.0034, 0, 0.66, 0.6, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Int8"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Int8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L21_C0", "label": "from threading import Thread, Lock", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0717, 0.0034, 0, 0.66, 0.65, 83, 0, 2, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Thread", "Lock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Thread, Lock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "label": "WXMatPlotLibPanel", "type": "class", "loc": [23, 72], "level": 0, "parent": null, "vector": [3, 0, 0.1621, 0.1706, 0, 0.66, 0.7, 578, 0, 6, 0, 0, 684, 0, 25], "semantic": {"name": "WXMatPlotLibPanel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class WXMatPlotLibPanel( wx.Panel ):\n def __init__( self, parent, color=None, dpi=None, **kwargs ):\n from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg\n from matplotlib.figure import Figure\n\n # initialize Panel\n if 'id' not in kwargs.keys():\n kwargs['id'] = wx.ID_ANY"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "vector": [2, 1, 0.1195, 0.0785, 1, 0.5, 0.0, 555, 0, 5, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "color", "dpi", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, parent, color=None, dpi=None, **kwargs ):\n from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg\n from matplotlib.figure import Figure\n\n # initialize Panel\n if 'id' not in kwargs.keys():\n kwargs['id'] = wx.ID_ANY\n if 'style' not in kwargs.keys():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L25_C8", "label": "from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg", "type": "import", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [1, 2, 0.0853, 0.0034, 2, 0.7, 0.0, 203, 0, 1, 0, 0, 203, 0, 0], "semantic": {"name": "matplotlib.backends.backend_wxagg", "arg_names": [], "import_names": ["FigureCanvasWxAgg"], "rhs_call_name": "", "annotation": ""}, "snippet": " from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L26_C8", "label": "from matplotlib.figure import Figure", "type": "import", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [1, 2, 0.0887, 0.0034, 2, 0.7, 0.0909, 733, 0, 1, 0, 0, 733, 0, 0], "semantic": {"name": "matplotlib.figure", "arg_names": [], "import_names": ["Figure"], "rhs_call_name": "", "annotation": ""}, "snippet": " from matplotlib.figure import Figure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L29_C8", "label": "if", "type": "if", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [4, 2, 0.1007, 0.0068, 2, 0.7, 0.1818, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'id' not in kwargs.keys():\n kwargs['id'] = wx.ID_ANY"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L30_C12", "label": "assign", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L29_C8", "vector": [14, 3, 0.1024, 0.0034, 3, 0.31, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['id'] = wx.ID_ANY"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L31_C8", "label": "if", "type": "if", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [4, 2, 0.1075, 0.0068, 2, 0.7, 0.2727, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'style' not in kwargs.keys():\n kwargs['style'] = wx.NO_FULL_REPAINT_ON_RESIZE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L32_C12", "label": "assign", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L31_C8", "vector": [14, 3, 0.1092, 0.0034, 3, 0.17, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['style'] = wx.NO_FULL_REPAINT_ON_RESIZE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L33_C8", "label": "__init__()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [8, 2, 0.1126, 0.0034, 2, 0.7, 0.3636, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " wx.Panel.__init__( self, parent, **kwargs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L36_C8", "label": "self.figure = Figure()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [14, 2, 0.1229, 0.0034, 2, 0.7, 0.4545, 518, 3, 2, 0, 0, 901, 10, 1], "semantic": {"name": "self.figure", "arg_names": [], "import_names": [], "rhs_call_name": "Figure", "annotation": ""}, "snippet": " self.figure = Figure( None, dpi )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L37_C8", "label": "self.canvas = FigureCanvasWxAgg()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [14, 2, 0.1263, 0.0034, 2, 0.7, 0.5455, 371, 3, 3, 0, 0, 356, 10, 1], "semantic": {"name": "self.canvas", "arg_names": [], "import_names": [], "rhs_call_name": "FigureCanvasWxAgg", "annotation": ""}, "snippet": " self.canvas = FigureCanvasWxAgg( self, -1, self.figure )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L40_C8", "label": "_SetSize()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [8, 2, 0.1365, 0.0034, 2, 0.7, 0.6364, 859, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_SetSize", "arg_names": [], "import_names": [], "rhs_call_name": "_SetSize", "annotation": ""}, "snippet": " self._SetSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L41_C8", "label": "draw()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [8, 2, 0.1399, 0.0034, 2, 0.7, 0.7273, 920, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "draw", "arg_names": [], "import_names": [], "rhs_call_name": "draw", "annotation": ""}, "snippet": " self.draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L43_C8", "label": "self._resizeflag =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [14, 2, 0.1468, 0.0034, 2, 0.7, 0.8182, 156, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._resizeflag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resizeflag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L45_C8", "label": "Bind()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [8, 2, 0.1536, 0.0034, 2, 0.7, 0.9091, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_IDLE, self._onIdle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L46_C8", "label": "Bind()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "vector": [8, 2, 0.157, 0.0034, 2, 0.7, 1.0, 72, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Bind", "arg_names": [], "import_names": [], "rhs_call_name": "Bind", "annotation": ""}, "snippet": " self.Bind(wx.EVT_SIZE, self._onSize)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "label": "SetColor", "type": "function", "loc": [48, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "vector": [2, 1, 0.1758, 0.0273, 1, 0.5, 0.2, 825, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "SetColor", "arg_names": ["self", "rgbtuple"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def SetColor( self, rgbtuple=None ):\n \"\"\"Set figure and canvas colours to be the same.\"\"\"\n if rgbtuple is None:\n rgbtuple = wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ).Get()\n clr = [c/255. for c in rgbtuple]\n self.figure.set_facecolor( clr )\n self.figure.set_edgecolor( clr )\n self.canvas.SetBackgroundColour( wx.Colour( *rgbtuple ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L49_C8", "label": "expression", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "vector": [8, 2, 0.1672, 0.0034, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Set figure and canvas colours to be the same.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L50_C8", "label": "if", "type": "if", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "vector": [4, 2, 0.1724, 0.0068, 2, 0.47, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rgbtuple is None:\n rgbtuple = wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ).Get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L51_C12", "label": "rgbtuple = Get()", "type": "assigned_variable", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L50_C8", "vector": [14, 3, 0.1741, 0.0034, 3, 0.56, 0.0, 664, 3, 0, 0, 0, 922, 10, 2], "semantic": {"name": "rgbtuple", "arg_names": [], "import_names": [], "rhs_call_name": "Get", "annotation": ""}, "snippet": " rgbtuple = wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ).Get()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L52_C8", "label": "clr =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "vector": [14, 2, 0.1775, 0.0034, 2, 0.47, 0.4, 899, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "clr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " clr = [c/255. for c in rgbtuple]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L53_C8", "label": "set_facecolor()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "vector": [8, 2, 0.1809, 0.0034, 2, 0.47, 0.6, 308, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_facecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_facecolor", "annotation": ""}, "snippet": " self.figure.set_facecolor( clr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L54_C8", "label": "set_edgecolor()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "vector": [8, 2, 0.1843, 0.0034, 2, 0.47, 0.8, 264, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_edgecolor", "arg_names": [], "import_names": [], "rhs_call_name": "set_edgecolor", "annotation": ""}, "snippet": " self.figure.set_edgecolor( clr )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L55_C8", "label": "SetBackgroundColour()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "vector": [8, 2, 0.1877, 0.0034, 2, 0.47, 1.0, 501, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "SetBackgroundColour", "arg_names": [], "import_names": [], "rhs_call_name": "SetBackgroundColour", "annotation": ""}, "snippet": " self.canvas.SetBackgroundColour( wx.Colour( *rgbtuple ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L57_C4", "label": "_onSize", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "vector": [2, 1, 0.1962, 0.0068, 1, 0.5, 0.4, 471, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_onSize", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _onSize( self, event ):\n self._resizeflag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L58_C8", "label": "self._resizeflag =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L57_C4", "vector": [14, 2, 0.198, 0.0034, 2, 0.11, 0.0, 156, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._resizeflag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resizeflag = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L60_C4", "label": "_onIdle", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "vector": [2, 1, 0.2099, 0.0137, 1, 0.5, 0.6, 574, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_onIdle", "arg_names": ["self", "evt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _onIdle( self, evt ):\n if self._resizeflag:\n self._resizeflag = False\n self._SetSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L61_C8", "label": "if", "type": "if", "loc": [61, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L60_C4", "vector": [4, 2, 0.2116, 0.0102, 2, 0.74, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._resizeflag:\n self._resizeflag = False\n self._SetSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L62_C12", "label": "self._resizeflag =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L61_C8", "vector": [14, 3, 0.2116, 0.0034, 3, 0.47, 0.0, 156, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._resizeflag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._resizeflag = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L63_C12", "label": "_SetSize()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L61_C8", "vector": [8, 3, 0.215, 0.0034, 3, 0.47, 1.0, 859, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_SetSize", "arg_names": [], "import_names": [], "rhs_call_name": "_SetSize", "annotation": ""}, "snippet": " self._SetSize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "label": "_SetSize", "type": "function", "loc": [65, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "vector": [2, 1, 0.2304, 0.0205, 1, 0.5, 0.8, 859, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "_SetSize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _SetSize( self ):\n pixels = tuple( self.parent.GetClientSize() )\n self.SetSize( pixels )\n self.canvas.SetSize( pixels )\n self.figure.set_size_inches( float( pixels[0] )/self.figure.get_dpi(),\n float( pixels[1] )/self.figure.get_dpi() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L66_C8", "label": "pixels = tuple()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "vector": [14, 2, 0.2253, 0.0034, 2, 0.0, 0.0, 900, 3, 1, 0, 0, 259, 10, 2], "semantic": {"name": "pixels", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " pixels = tuple( self.parent.GetClientSize() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L67_C8", "label": "SetSize()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "vector": [8, 2, 0.2287, 0.0034, 2, 0.0, 0.3333, 36, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetSize", "arg_names": [], "import_names": [], "rhs_call_name": "SetSize", "annotation": ""}, "snippet": " self.SetSize( pixels )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L68_C8", "label": "SetSize()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "vector": [8, 2, 0.2321, 0.0034, 2, 0.0, 0.6667, 36, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetSize", "arg_names": [], "import_names": [], "rhs_call_name": "SetSize", "annotation": ""}, "snippet": " self.canvas.SetSize( pixels )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L69_C8", "label": "set_size_inches()", "type": "expression", "loc": [69, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "vector": [8, 2, 0.2372, 0.0068, 2, 0.0, 1.0, 620, 3, 2, 0, 0, 0, 0, 5], "semantic": {"name": "set_size_inches", "arg_names": [], "import_names": [], "rhs_call_name": "set_size_inches", "annotation": ""}, "snippet": " self.figure.set_size_inches( float( pixels[0] )/self.figure.get_dpi(),\n float( pixels[1] )/self.figure.get_dpi() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L72_C4", "label": "draw", "type": "function", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "vector": [2, 1, 0.2457, 0.0034, 1, 0.5, 1.0, 920, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "draw", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def draw(self): pass # abstract, to be overridden by child classes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "label": "JointStateVizPanel", "type": "class", "loc": [74, 193], "level": 0, "parent": null, "vector": [3, 0, 0.4556, 0.4096, 0, 0.66, 0.75, 604, 0, 5, 0, 0, 578, 0, 51], "semantic": {"name": "JointStateVizPanel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointStateVizPanel( WXMatPlotLibPanel ):\n def __init__( self, parent, **kwargs ):\n self.lock = Lock()\n self.parent = parent\n self.positions = None\n self.velocities = None\n self.efforts = None\n WXMatPlotLibPanel.__init__( self, parent, **kwargs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "label": "__init__", "type": "function", "loc": [75, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "vector": [2, 1, 0.2662, 0.0239, 1, 0.04, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "parent", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, parent, **kwargs ):\n self.lock = Lock()\n self.parent = parent\n self.positions = None\n self.velocities = None\n self.efforts = None\n WXMatPlotLibPanel.__init__( self, parent, **kwargs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L76_C8", "label": "self.lock = Lock()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "vector": [14, 2, 0.2594, 0.0034, 2, 0.55, 0.0, 45, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "self.lock", "arg_names": [], "import_names": [], "rhs_call_name": "Lock", "annotation": ""}, "snippet": " self.lock = Lock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L77_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "vector": [14, 2, 0.2628, 0.0034, 2, 0.55, 0.2, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L78_C8", "label": "self.positions =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "vector": [14, 2, 0.2662, 0.0034, 2, 0.55, 0.4, 157, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.positions = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L79_C8", "label": "self.velocities =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "vector": [14, 2, 0.2696, 0.0034, 2, 0.55, 0.6, 369, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.velocities = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L80_C8", "label": "self.efforts =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "vector": [14, 2, 0.273, 0.0034, 2, 0.55, 0.8, 476, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.efforts = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L81_C8", "label": "__init__()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "vector": [8, 2, 0.2765, 0.0034, 2, 0.55, 1.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " WXMatPlotLibPanel.__init__( self, parent, **kwargs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "label": "init_plots", "type": "function", "loc": [84, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "vector": [2, 1, 0.3942, 0.2184, 1, 0.04, 0.25, 852, 0, 3, 0, 0, 0, 0, 36], "semantic": {"name": "init_plots", "arg_names": ["self", "names", "limits"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_plots( self, names, limits ):\n N = len( names )\n self.axes = []\n self.lines = []\n self.scatter = []\n for j in range( N ):\n axes = self.figure.add_subplot( 3, N, j + 1 )\n axes.set_title( names[j] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L85_C8", "label": "N = len()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [14, 2, 0.2901, 0.0034, 2, 0.12, 0.0, 644, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "N", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " N = len( names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L86_C8", "label": "self.axes =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [14, 2, 0.2935, 0.0034, 2, 0.12, 0.1667, 721, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.axes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L87_C8", "label": "self.lines =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [14, 2, 0.2969, 0.0034, 2, 0.12, 0.3333, 880, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lines = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L88_C8", "label": "self.scatter =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [14, 2, 0.3003, 0.0034, 2, 0.12, 0.5, 30, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.scatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.scatter = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "label": "for j", "type": "for", "loc": [89, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [6, 2, 0.3362, 0.0683, 2, 0.12, 0.6667, 100, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( N ):\n axes = self.figure.add_subplot( 3, N, j + 1 )\n axes.set_title( names[j] )\n upper = -np.pi\n lower = np.pi\n\n if limits[j].has_key( 'upper' ):\n upper = limits[j].get( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L90_C12", "label": "axes = add_subplot()", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [14, 3, 0.3072, 0.0034, 3, 0.17, 0.0, 590, 3, 3, 0, 0, 449, 10, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " axes = self.figure.add_subplot( 3, N, j + 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L91_C12", "label": "set_title()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [8, 3, 0.3106, 0.0034, 3, 0.17, 0.1, 145, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_title", "arg_names": [], "import_names": [], "rhs_call_name": "set_title", "annotation": ""}, "snippet": " axes.set_title( names[j] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L92_C12", "label": "upper =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [14, 3, 0.314, 0.0034, 3, 0.17, 0.2, 347, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "upper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " upper = -np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L93_C12", "label": "lower =", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [14, 3, 0.3174, 0.0034, 3, 0.17, 0.3, 432, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lower", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lower = np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L95_C12", "label": "if", "type": "if", "loc": [95, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [4, 3, 0.3259, 0.0068, 3, 0.17, 0.4, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limits[j].has_key( 'upper' ):\n upper = limits[j].get( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L96_C16", "label": "upper = get()", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L95_C12", "vector": [14, 4, 0.3276, 0.0034, 4, 0.99, 0.0, 347, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "upper", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " upper = limits[j].get( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L98_C12", "label": "if", "type": "if", "loc": [98, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [4, 3, 0.3362, 0.0068, 3, 0.17, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limits[j].has_key( 'lower' ):\n lower = limits[j].get( 'lower' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L99_C16", "label": "lower = get()", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L98_C12", "vector": [14, 4, 0.3379, 0.0034, 4, 0.85, 0.0, 432, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "lower", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " lower = limits[j].get( 'lower' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L101_C12", "label": "set_ylim()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [8, 3, 0.3447, 0.0034, 3, 0.17, 0.6, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " axes.set_ylim( lower, upper )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L102_C12", "label": "set_xticks()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [8, 3, 0.3481, 0.0034, 3, 0.17, 0.7, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_xticks", "arg_names": [], "import_names": [], "rhs_call_name": "set_xticks", "annotation": ""}, "snippet": " axes.set_xticks( [] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L104_C12", "label": "append()", "type": "expression", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [8, 3, 0.3549, 0.0034, 3, 0.17, 0.8, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.lines.append( axes.plot( [0], 'r' )[0] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L106_C12", "label": "autoscale_view()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [8, 3, 0.3618, 0.0034, 3, 0.17, 0.9, 326, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "autoscale_view", "arg_names": [], "import_names": [], "rhs_call_name": "autoscale_view", "annotation": ""}, "snippet": " axes.autoscale_view( scalex = False, scaley = False )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L108_C12", "label": "append()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "vector": [8, 3, 0.3686, 0.0034, 3, 0.17, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.axes.append( axes )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "label": "for j", "type": "for", "loc": [110, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [6, 2, 0.3959, 0.0444, 2, 0.12, 0.8333, 100, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( N ):\n axes = self.figure.add_subplot( 3, N, j + N + 1 )\n effort = 30\n\n if limits[j].has_key( 'effort' ):\n effort = limits[j].get( 'effort' )\n\n axes.set_ylim( -effort, effort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L111_C12", "label": "axes = add_subplot()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [14, 3, 0.3788, 0.0034, 3, 0.87, 0.0, 590, 3, 3, 0, 0, 449, 10, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " axes = self.figure.add_subplot( 3, N, j + N + 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L112_C12", "label": "effort =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [14, 3, 0.3823, 0.0034, 3, 0.87, 0.1667, 708, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "effort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " effort = 30"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L114_C12", "label": "if", "type": "if", "loc": [114, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [4, 3, 0.3908, 0.0068, 3, 0.87, 0.3333, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limits[j].has_key( 'effort' ):\n effort = limits[j].get( 'effort' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L115_C16", "label": "effort = get()", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L114_C12", "vector": [14, 4, 0.3925, 0.0034, 4, 0.67, 0.0, 708, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "effort", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " effort = limits[j].get( 'effort' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L117_C12", "label": "set_ylim()", "type": "expression", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [8, 3, 0.3993, 0.0034, 3, 0.87, 0.5, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " axes.set_ylim( -effort, effort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L118_C12", "label": "set_xticks()", "type": "expression", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [8, 3, 0.4027, 0.0034, 3, 0.87, 0.6667, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_xticks", "arg_names": [], "import_names": [], "rhs_call_name": "set_xticks", "annotation": ""}, "snippet": " axes.set_xticks( [] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L120_C12", "label": "append()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [8, 3, 0.4096, 0.0034, 3, 0.87, 0.8333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.lines.append( axes.plot( [0], 'b' )[0] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L122_C12", "label": "append()", "type": "expression", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "vector": [8, 3, 0.4164, 0.0034, 3, 0.87, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.axes.append( axes )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "label": "for j", "type": "for", "loc": [124, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "vector": [6, 2, 0.4625, 0.0819, 2, 0.12, 1.0, 100, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( N ):\n axes = self.figure.add_subplot( 3, N, j + 2 * N + 1 )\n upper = -2 * np.pi\n lower = 2 * np.pi\n velocity = 2 * np.pi\n\n if limits[j].has_key( 'upper' ):\n upper = limits[j].get( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L125_C12", "label": "axes = add_subplot()", "type": "assigned_variable", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [14, 3, 0.4266, 0.0034, 3, 0.49, 0.0, 590, 3, 3, 0, 0, 449, 10, 1], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "add_subplot", "annotation": ""}, "snippet": " axes = self.figure.add_subplot( 3, N, j + 2 * N + 1 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L126_C12", "label": "upper =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [14, 3, 0.43, 0.0034, 3, 0.49, 0.1, 347, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "upper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " upper = -2 * np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L127_C12", "label": "lower =", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [14, 3, 0.4334, 0.0034, 3, 0.49, 0.2, 432, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lower", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lower = 2 * np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L128_C12", "label": "velocity =", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [14, 3, 0.4369, 0.0034, 3, 0.49, 0.3, 935, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " velocity = 2 * np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L130_C12", "label": "if", "type": "if", "loc": [130, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [4, 3, 0.4454, 0.0068, 3, 0.49, 0.4, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limits[j].has_key( 'upper' ):\n upper = limits[j].get( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L131_C16", "label": "upper = get()", "type": "assigned_variable", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L130_C12", "vector": [14, 4, 0.4471, 0.0034, 4, 0.84, 0.0, 347, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "upper", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " upper = limits[j].get( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L133_C12", "label": "if", "type": "if", "loc": [133, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [4, 3, 0.4556, 0.0068, 3, 0.49, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limits[j].has_key( 'lower' ):\n lower = limits[j].get( 'lower' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L134_C16", "label": "lower = get()", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L133_C12", "vector": [14, 4, 0.4573, 0.0034, 4, 0.23, 0.0, 432, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "lower", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " lower = limits[j].get( 'lower' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L136_C12", "label": "if", "type": "if", "loc": [136, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [4, 3, 0.4659, 0.0068, 3, 0.49, 0.6, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limits[j].has_key( 'velocity' ):\n velocity = limits[j].get( 'velocity' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L137_C16", "label": "velocity = get()", "type": "assigned_variable", "loc": [137, 137], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L136_C12", "vector": [14, 4, 0.4676, 0.0034, 4, 0.39, 0.0, 935, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "velocity", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " velocity = limits[j].get( 'velocity' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L139_C12", "label": "set_ylim()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [8, 3, 0.4744, 0.0034, 3, 0.49, 0.7, 819, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_ylim", "arg_names": [], "import_names": [], "rhs_call_name": "set_ylim", "annotation": ""}, "snippet": " axes.set_ylim( -velocity, velocity )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L140_C12", "label": "set_xlim()", "type": "expression", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [8, 3, 0.4778, 0.0034, 3, 0.49, 0.8, 806, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_xlim", "arg_names": [], "import_names": [], "rhs_call_name": "set_xlim", "annotation": ""}, "snippet": " axes.set_xlim( lower, upper )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L142_C12", "label": "append()", "type": "expression", "loc": [142, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [8, 3, 0.4898, 0.0137, 3, 0.49, 0.9, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.scatter.append( axes.scatter( [0], [0], \n c = 'b',\n s = 2.0,\n marker = 'x') )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L147_C12", "label": "append()", "type": "expression", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "vector": [8, 3, 0.5017, 0.0034, 3, 0.49, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.axes.append( axes )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "label": "update_plots", "type": "function", "loc": [152, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "vector": [2, 1, 0.5683, 0.1024, 1, 0.04, 0.5, 372, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "update_plots", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_plots( self ):\n # self.lock.acquire()\n \n if not hasattr( self, 'axes' ): \n return\n \n if self.positions is None or len( self.positions ) == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L155_C8", "label": "if", "type": "if", "loc": [155, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "vector": [4, 2, 0.5307, 0.0068, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr( self, 'axes' ): \n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L156_C12", "label": "return", "type": "return", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L155_C8", "vector": [13, 3, 0.5324, 0.0034, 3, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L158_C8", "label": "if", "type": "if", "loc": [158, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "vector": [4, 2, 0.541, 0.0068, 2, 0.87, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.positions is None or len( self.positions ) == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L159_C12", "label": "return", "type": "return", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L158_C8", "vector": [13, 3, 0.5427, 0.0034, 3, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L161_C8", "label": "l, N =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "vector": [14, 2, 0.5495, 0.0034, 2, 0.87, 0.4, 32, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l, N", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ( l, N ) = self.positions.shape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "label": "for j", "type": "for", "loc": [163, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "vector": [6, 2, 0.5614, 0.0137, 2, 0.87, 0.6, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( N ):\n axes = self.axes[j]\n axes.lines[0].remove()\n axes.plot( self.positions[:,j], 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L164_C12", "label": "axes =", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "vector": [14, 3, 0.5597, 0.0034, 3, 0.84, 0.0, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes = self.axes[j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L165_C12", "label": "remove()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "vector": [8, 3, 0.5631, 0.0034, 3, 0.84, 0.5, 185, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " axes.lines[0].remove()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L166_C12", "label": "plot()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "vector": [8, 3, 0.5666, 0.0034, 3, 0.84, 1.0, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " axes.plot( self.positions[:,j], 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "label": "for j", "type": "for", "loc": [168, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "vector": [6, 2, 0.5785, 0.0137, 2, 0.87, 0.8, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( N ):\n axes = self.axes[j + N]\n axes.lines[0].remove()\n axes.plot( self.efforts[:,j], 'b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L169_C12", "label": "axes =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "vector": [14, 3, 0.5768, 0.0034, 3, 0.35, 0.0, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes = self.axes[j + N]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L170_C12", "label": "remove()", "type": "expression", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "vector": [8, 3, 0.5802, 0.0034, 3, 0.35, 0.5, 185, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " axes.lines[0].remove()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L171_C12", "label": "plot()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "vector": [8, 3, 0.5836, 0.0034, 3, 0.35, 1.0, 929, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "plot", "arg_names": [], "import_names": [], "rhs_call_name": "plot", "annotation": ""}, "snippet": " axes.plot( self.efforts[:,j], 'b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "label": "for j", "type": "for", "loc": [174, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "vector": [6, 2, 0.6058, 0.0273, 2, 0.87, 1.0, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( N ):\n axes = self.axes[j + N * 2]\n self.scatter[j].remove()\n self.scatter[j] = axes.scatter( self.positions[:,j], \n self.velocities[:,j],\n c = 'b',\n s = 2.0,\n marker = 'x')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L175_C12", "label": "axes =", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "vector": [14, 3, 0.5973, 0.0034, 3, 0.11, 0.0, 590, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "axes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " axes = self.axes[j + N * 2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L176_C12", "label": "remove()", "type": "expression", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "vector": [8, 3, 0.6007, 0.0034, 3, 0.11, 0.5, 185, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " self.scatter[j].remove()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L177_C12", "label": " = scatter()", "type": "assigned_variable", "loc": [177, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "vector": [14, 3, 0.6109, 0.0171, 3, 0.11, 1.0, 0, 3, 5, 0, 0, 990, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "scatter", "annotation": ""}, "snippet": " self.scatter[j] = axes.scatter( self.positions[:,j], \n self.velocities[:,j],\n c = 'b',\n s = 2.0,\n marker = 'x')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L185_C4", "label": "draw", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "vector": [2, 1, 0.6331, 0.0068, 1, 0.04, 0.75, 920, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "draw", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def draw( self ):\n self.update_plots()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L186_C8", "label": "update_plots()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L185_C4", "vector": [8, 2, 0.6348, 0.0034, 2, 0.29, 0.0, 372, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update_plots", "arg_names": [], "import_names": [], "rhs_call_name": "update_plots", "annotation": ""}, "snippet": " self.update_plots()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "label": "setData", "type": "function", "loc": [188, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "vector": [2, 1, 0.6502, 0.0205, 1, 0.04, 1.0, 960, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "setData", "arg_names": ["self", "pos", "vel", "eff", "duration"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setData( self, pos, vel, eff, duration ):\n self.positions = pos\n self.velocities = vel\n self.efforts = eff\n self.duration = duration\n self.draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L189_C8", "label": "self.positions =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "vector": [14, 2, 0.6451, 0.0034, 2, 0.82, 0.0, 157, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.positions = pos"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L190_C8", "label": "self.velocities =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "vector": [14, 2, 0.6485, 0.0034, 2, 0.82, 0.25, 369, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.velocities = vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L191_C8", "label": "self.efforts =", "type": "assigned_variable", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "vector": [14, 2, 0.6519, 0.0034, 2, 0.82, 0.5, 476, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.efforts = eff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L192_C8", "label": "self.duration =", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "vector": [14, 2, 0.6553, 0.0034, 2, 0.82, 0.75, 663, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.duration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.duration = duration"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L193_C8", "label": "draw()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "vector": [8, 2, 0.6587, 0.0034, 2, 0.82, 1.0, 920, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "draw", "arg_names": [], "import_names": [], "rhs_call_name": "draw", "annotation": ""}, "snippet": " self.draw()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "label": "JointStateVizFrame", "type": "class", "loc": [195, 268], "level": 0, "parent": null, "vector": [3, 0, 0.7901, 0.2526, 0, 0.66, 0.8, 926, 0, 5, 0, 0, 610, 0, 32], "semantic": {"name": "JointStateVizFrame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class JointStateVizFrame( wx.Frame ) :\n def __init__( self, title, ns, js_topic ):\n wx.Frame.__init__( self, None, wx.ID_ANY, title, size = (2000, 800) )\n self.CreateStatusBar()\n self.SetStatusText( 'waiting for data on %s ...'%js_topic )\n self.panel = JointStateVizPanel( self )\n self.Show()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "label": "__init__", "type": "function", "loc": [196, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "vector": [2, 1, 0.6962, 0.058, 1, 0.45, 0.0, 555, 0, 4, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self", "title", "ns", "js_topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, title, ns, js_topic ):\n wx.Frame.__init__( self, None, wx.ID_ANY, title, size = (2000, 800) )\n self.CreateStatusBar()\n self.SetStatusText( 'waiting for data on %s ...'%js_topic )\n self.panel = JointStateVizPanel( self )\n self.Show()\n\n self.js_sub = rospy.Subscriber( js_topic, JointState, self.js_callback )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L197_C8", "label": "__init__()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [8, 2, 0.6724, 0.0034, 2, 0.36, 0.0, 555, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " wx.Frame.__init__( self, None, wx.ID_ANY, title, size = (2000, 800) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L198_C8", "label": "CreateStatusBar()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [8, 2, 0.6758, 0.0034, 2, 0.36, 0.1, 943, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "CreateStatusBar", "arg_names": [], "import_names": [], "rhs_call_name": "CreateStatusBar", "annotation": ""}, "snippet": " self.CreateStatusBar()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L199_C8", "label": "SetStatusText()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [8, 2, 0.6792, 0.0034, 2, 0.36, 0.2, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetStatusText", "arg_names": [], "import_names": [], "rhs_call_name": "SetStatusText", "annotation": ""}, "snippet": " self.SetStatusText( 'waiting for data on %s ...'%js_topic )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L200_C8", "label": "self.panel = JointStateVizPanel()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [14, 2, 0.6826, 0.0034, 2, 0.36, 0.3, 126, 3, 1, 0, 0, 604, 10, 1], "semantic": {"name": "self.panel", "arg_names": [], "import_names": [], "rhs_call_name": "JointStateVizPanel", "annotation": ""}, "snippet": " self.panel = JointStateVizPanel( self )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L201_C8", "label": "Show()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [8, 2, 0.686, 0.0034, 2, 0.36, 0.4, 408, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Show", "arg_names": [], "import_names": [], "rhs_call_name": "Show", "annotation": ""}, "snippet": " self.Show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L203_C8", "label": "self.js_sub = Subscriber()", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [14, 2, 0.6928, 0.0034, 2, 0.36, 0.5, 82, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.js_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.js_sub = rospy.Subscriber( js_topic, JointState, self.js_callback )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L204_C8", "label": "self.update_sub = Subscriber()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [14, 2, 0.6962, 0.0034, 2, 0.36, 0.6, 29, 3, 3, 0, 0, 455, 10, 2], "semantic": {"name": "self.update_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.update_sub = rospy.Subscriber( ''.join( (ns, '/update' ) ), Int8, self.update_callback )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L207_C8", "label": " = load_params()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [14, 2, 0.7065, 0.0034, 2, 0.36, 0.7, 0, 3, 1, 0, 0, 648, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "load_params", "annotation": ""}, "snippet": " (self.joint_names, self.limits) = self.load_params( ns )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L209_C8", "label": "self.idx =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [14, 2, 0.7133, 0.0034, 2, 0.36, 0.8, 326, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.idx = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L210_C8", "label": "self.joint_states =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [14, 2, 0.7167, 0.0034, 2, 0.36, 0.9, 334, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_states = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L212_C8", "label": "init_plots()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "vector": [8, 2, 0.7235, 0.0034, 2, 0.36, 1.0, 852, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_plots", "arg_names": [], "import_names": [], "rhs_call_name": "init_plots", "annotation": ""}, "snippet": " self.panel.init_plots( self.joint_names, self.limits )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "label": "load_params", "type": "function", "loc": [214, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "vector": [2, 1, 0.744, 0.0307, 1, 0.45, 0.25, 648, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "load_params", "arg_names": ["self", "ns"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_params( self, ns ):\n params = rospy.get_param( ns )\n joint_names = params.keys()\n\n limits = []\n for joint_name in joint_names:\n limits.append( params.get( joint_name ) )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L215_C8", "label": "params = get_param()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "vector": [14, 2, 0.7338, 0.0034, 2, 0.2, 0.0, 206, 3, 1, 0, 0, 427, 10, 1], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "get_param", "annotation": ""}, "snippet": " params = rospy.get_param( ns )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L216_C8", "label": "joint_names = keys()", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "vector": [14, 2, 0.7372, 0.0034, 2, 0.2, 0.25, 393, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " joint_names = params.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L218_C8", "label": "limits =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "vector": [14, 2, 0.744, 0.0034, 2, 0.2, 0.5, 490, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "limits", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " limits = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L219_C8", "label": "for joint_name", "type": "for", "loc": [219, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "vector": [6, 2, 0.7491, 0.0068, 2, 0.2, 0.75, 337, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "joint_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for joint_name in joint_names:\n limits.append( params.get( joint_name ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L220_C12", "label": "append()", "type": "expression", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L219_C8", "vector": [8, 3, 0.7509, 0.0034, 3, 0.4, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " limits.append( params.get( joint_name ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L222_C8", "label": "return", "type": "return", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "vector": [13, 2, 0.7577, 0.0034, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ( joint_names, limits )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L224_C4", "label": "js_callback", "type": "function", "loc": [224, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "vector": [2, 1, 0.7662, 0.0068, 1, 0.45, 0.5, 567, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "js_callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def js_callback( self, msg ):\n self.joint_states.append( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L225_C8", "label": "append()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L224_C4", "vector": [8, 2, 0.7679, 0.0034, 2, 0.97, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.joint_states.append( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L227_C4", "label": "update_callback", "type": "function", "loc": [227, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "vector": [2, 1, 0.7816, 0.0171, 1, 0.45, 0.75, 323, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_callback", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_callback( self, msg ):\n if msg.data == 0:\n self.joint_states = []\n elif msg.data == 1:\n self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L228_C8", "label": "if", "type": "if", "loc": [228, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L227_C4", "vector": [4, 2, 0.7833, 0.0137, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.data == 0:\n self.joint_states = []\n elif msg.data == 1:\n self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L229_C12", "label": "self.joint_states =", "type": "assigned_variable", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L228_C8", "vector": [14, 3, 0.7816, 0.0034, 3, 0.81, 0.0, 334, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_states = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L230_C8", "label": "if", "type": "if", "loc": [230, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L228_C8", "vector": [4, 3, 0.7867, 0.0068, 3, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif msg.data == 1:\n self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L231_C12", "label": "update()", "type": "expression", "loc": [231, 231], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L230_C8", "vector": [8, 4, 0.7884, 0.0034, 4, 0.86, 0.0, 637, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "label": "update", "type": "function", "loc": [233, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "vector": [2, 1, 0.8549, 0.1229, 1, 0.45, 1.0, 637, 0, 1, 0, 0, 0, 0, 16], "semantic": {"name": "update", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update( self ):\n if self.joint_names is None or len( self.joint_names ) == 0 or len( self.joint_states ) == 0:\n return\n if self.idx is None:\n self.idx = map( self.joint_states[0].name.index, self.joint_names )\n\n positions = []\n velocities = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L234_C8", "label": "if", "type": "if", "loc": [234, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [4, 2, 0.8003, 0.0068, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.joint_names is None or len( self.joint_names ) == 0 or len( self.joint_states ) == 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L235_C12", "label": "return", "type": "return", "loc": [235, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L234_C8", "vector": [13, 3, 0.802, 0.0034, 3, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L236_C8", "label": "if", "type": "if", "loc": [236, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [4, 2, 0.8072, 0.0068, 2, 0.55, 0.0833, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.idx is None:\n self.idx = map( self.joint_states[0].name.index, self.joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L237_C12", "label": "self.idx = map()", "type": "assigned_variable", "loc": [237, 237], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L236_C8", "vector": [14, 3, 0.8089, 0.0034, 3, 0.59, 0.0, 326, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "self.idx", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " self.idx = map( self.joint_states[0].name.index, self.joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L239_C8", "label": "positions =", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.8157, 0.0034, 2, 0.55, 0.1667, 320, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " positions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L240_C8", "label": "velocities =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.8191, 0.0034, 2, 0.55, 0.25, 895, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " velocities = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L241_C8", "label": "efforts =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.8225, 0.0034, 2, 0.55, 0.3333, 254, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " efforts = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "label": "for js", "type": "for", "loc": [243, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [6, 2, 0.8396, 0.0239, 2, 0.55, 0.4167, 62, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "js", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for js in self.joint_states:\n pos = map( lambda x: js.position[x], self.idx )\n vel = map( lambda x: js.velocity[x], self.idx )\n effort = map( lambda x: js.effort[x], self.idx )\n positions.append( pos )\n velocities.append( vel )\n efforts.append( effort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L244_C12", "label": "pos = map()", "type": "assigned_variable", "loc": [244, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "vector": [14, 3, 0.8328, 0.0034, 3, 0.42, 0.0, 627, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " pos = map( lambda x: js.position[x], self.idx )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L245_C12", "label": "vel = map()", "type": "assigned_variable", "loc": [245, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "vector": [14, 3, 0.8362, 0.0034, 3, 0.42, 0.2, 527, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " vel = map( lambda x: js.velocity[x], self.idx )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L246_C12", "label": "effort = map()", "type": "assigned_variable", "loc": [246, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "vector": [14, 3, 0.8396, 0.0034, 3, 0.42, 0.4, 708, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "effort", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " effort = map( lambda x: js.effort[x], self.idx )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L247_C12", "label": "append()", "type": "expression", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "vector": [8, 3, 0.843, 0.0034, 3, 0.42, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " positions.append( pos )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L248_C12", "label": "append()", "type": "expression", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "vector": [8, 3, 0.8464, 0.0034, 3, 0.42, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " velocities.append( vel )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L249_C12", "label": "append()", "type": "expression", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "vector": [8, 3, 0.8498, 0.0034, 3, 0.42, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " efforts.append( effort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L251_C8", "label": "start_time =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.8567, 0.0034, 2, 0.55, 0.5, 511, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_time = self.joint_states[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L252_C8", "label": "stop_time =", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.8601, 0.0034, 2, 0.55, 0.5833, 265, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "stop_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stop_time = self.joint_states[-1].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L253_C8", "label": "duration =", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.8635, 0.0034, 2, 0.55, 0.6667, 242, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "duration", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " duration = stop_time - start_time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L255_C8", "label": "setData()", "type": "expression", "loc": [255, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [8, 2, 0.8754, 0.0137, 2, 0.55, 0.75, 960, 3, 4, 0, 0, 0, 0, 5], "semantic": {"name": "setData", "arg_names": [], "import_names": [], "rhs_call_name": "setData", "annotation": ""}, "snippet": " self.panel.setData( np.asarray( positions ), \n np.asarray( velocities ), \n np.asarray( efforts ),\n duration.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L264_C8", "label": "status =", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.901, 0.0034, 2, 0.55, 0.8333, 699, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " status = 'ros-time: %s, duration: %5.3f sec'%( self.joint_states[0].header.stamp, duration.to_sec() )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L266_C8", "label": "SetStatusText()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [8, 2, 0.9078, 0.0034, 2, 0.55, 0.9167, 939, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SetStatusText", "arg_names": [], "import_names": [], "rhs_call_name": "SetStatusText", "annotation": ""}, "snippet": " self.SetStatusText( status ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L268_C8", "label": "self.joint_states =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "vector": [14, 2, 0.9147, 0.0034, 2, 0.55, 1.0, 334, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_states", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_states = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L273_C0", "label": "arm_joint_names =", "type": "assigned_variable", "loc": [273, 279], "level": 0, "parent": null, "vector": [14, 0, 0.942, 0.0239, 0, 0.66, 0.85, 661, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "arm_joint_names = ['lr_shoulder_pan_joint',\n 'lr_shoulder_lift_joint',\n 'lr_upper_arm_roll_joint',\n 'lr_elbow_flex_joint',\n 'lr_forearm_roll_joint',\n 'lr_wrist_flex_joint',\n 'lr_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L281_C0", "label": "l_arm_joint_names = map()", "type": "assigned_variable", "loc": [281, 281], "level": 0, "parent": null, "vector": [14, 0, 0.959, 0.0034, 0, 0.66, 0.9, 764, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "l_arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "l_arm_joint_names = map(lambda s: s.replace('lr_', 'l_'), arm_joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L282_C0", "label": "r_arm_joint_names = map()", "type": "assigned_variable", "loc": [282, 282], "level": 0, "parent": null, "vector": [14, 0, 0.9625, 0.0034, 0, 0.66, 0.95, 705, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "r_arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "r_arm_joint_names = map(lambda s: s.replace('lr_', 'r_'), arm_joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "label": "if", "type": "if", "loc": [285, 289], "level": 0, "parent": null, "vector": [4, 0, 0.9795, 0.0171, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node( 'joint_state_viz_node' )\n app = wx.PySimpleApp( 0 )\n frame = JointStateVizFrame( 'Joint-State-Viz', '/joint_state_viz', '/joint_states' )\n app.MainLoop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L286_C4", "label": "init_node()", "type": "expression", "loc": [286, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "vector": [8, 1, 0.9761, 0.0034, 1, 0.44, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'joint_state_viz_node' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L287_C4", "label": "app = PySimpleApp()", "type": "assigned_variable", "loc": [287, 287], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "vector": [14, 1, 0.9795, 0.0034, 1, 0.44, 0.3333, 494, 3, 1, 0, 0, 909, 10, 1], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "PySimpleApp", "annotation": ""}, "snippet": " app = wx.PySimpleApp( 0 )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L288_C4", "label": "frame = JointStateVizFrame()", "type": "assigned_variable", "loc": [288, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "vector": [14, 1, 0.9829, 0.0034, 1, 0.44, 0.6667, 313, 3, 3, 0, 0, 926, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "JointStateVizFrame", "annotation": ""}, "snippet": " frame = JointStateVizFrame( 'Joint-State-Viz', '/joint_state_viz', '/joint_states' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L289_C4", "label": "MainLoop()", "type": "expression", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "vector": [8, 1, 0.9863, 0.0034, 1, 0.44, 1.0, 856, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "MainLoop", "arg_names": [], "import_names": [], "rhs_call_name": "MainLoop", "annotation": ""}, "snippet": " app.MainLoop()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:ImportFrom_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L51_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L98_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L114_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L115_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L130_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L136_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L137_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L174_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:ClassDef_L195_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L234_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Return_L235_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L236_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L237_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L244_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L245_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L248_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L286_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Assign_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99261:If_L285_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99261:Expr_L289_C4"}] |
import roslib
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'rosparam' )
roslib.load_manifest( 'actionlib' )
roslib.load_manifest( 'trajectory_msgs' )
roslib.load_manifest( 'pr2_controllers_msgs' )
import rospy
import rosparam
import csv
from actionlib import \
SimpleActionClient
from trajectory_msgs.msg import \
JointTrajectory, JointTrajectoryPoint
from pr2_controllers_msgs.msg import \
JointTrajectoryAction, JointTrajectoryGoal
import numpy as np
from math import fmod, pi
import pickle
#-------------------------------------------------------------------------------
# Trajectory utils
#-------------------------------------------------------------------------------
def wrap_angle( a ):
if a < 0:
return fmod( a - pi, 2 * pi ) + pi
if a > 0:
return fmod( a + pi, 2 * pi ) - pi
def wrap_trajectory( t ):
rospy.loginfo( 'warapping trajectory [#points: %d] ...', len( t ) )
b = 0.1
if len( t ) < 0:
return
last = map( wrap_angle, t[0])
offsets = np.zeros( len( last ) )
for i in range( len( t ) ):
for j in range( len( t[i] ) ):
a = wrap_angle( t[i,j] )
if a > pi - b and last[j] < -pi + b:
offsets[j] -= 2 * pi
if a < -pi + b and last[j] > pi - b:
offsets[j] += 2 * pi
last[j] = a
t[i] += offsets
rospy.loginfo( 'done!' )
def compute_derivative( f, dt ):
rospy.loginfo( 'computing derivative [#points: %d] ...', len( f ) )
f_dot = np.zeros( f.shape )
for i in range( 1, len( f ) - 1 ):
for j in range( len( f[i] ) ):
f_dot[i,j] = (f[i+1,j] - f[i-1,j]) / (2.0 * dt)
f_dot[0,:] = (f[1,:] - f[-1,:]) / (2.0 * dt)
f_dot[-1,:] = (f[0,:] - f[-2,:]) / (2.0 * dt)
rospy.loginfo( 'done!' )
return f_dot
def save_motion( fname, name, time, pos, vel, acc ):
rospy.loginfo( 'save motion \'%s\' to file: %s'%( name, fname ) )
pkl_file = open( fname, 'wb' )
data = ( name, time, pos, vel, acc )
pickle.dump( data, pkl_file )
pkl_file.close()
rospy.loginfo( 'done!' )
def load_motion( fname ):
rospy.loginfo( 'loading motion from file: %s'%fname )
pkl_file = open( fname, 'rb' )
data = pickle.load( pkl_file )
rospy.loginfo( 'done!' )
return data
def load_motion_ascii( fname ):
reader = csv.reader( open( fname, 'rb' ), delimiter="\t" )
t = []
pos = []
vel = []
acc = []
for row in reader:
t.append( float(row[0]) )
pos.append( map( lambda x: float(x), row[1:8] ) )
vel.append( map( lambda x: float(x), row[8:15] ) )
acc.append( map( lambda x: float(x), row[15:22] ) )
return (fname, np.asarray(t), np.asarray(pos), np.asarray(vel), np.asarray(acc))
#-------------------------------------------------------------------------------
# JointTrajectoryAction client interfacing
#-------------------------------------------------------------------------------
def init_jt_client(arm = 'r'):
name = "".join( [ arm, "_arm_controller/joint_trajectory_action" ] )
client = SimpleActionClient(name, JointTrajectoryAction)
rospy.loginfo( 'waiting for action client : %s ...'%name )
client.wait_for_server()
rospy.loginfo( '%s is up and running!'%name )
return client
def get_joint_names( node_name ):
return rosparam.get_param( ''.join( (node_name, '/joints') ) )
def move_arm( positions, time_from_start = 3.0, arm = 'r', client = None ):
if (client == None):
client = init_jt_client(arm)
else:
arm = client.action_client.ns[0:1]; # ignore arm argument
rospy.loginfo( 'move arm \'%s\' to position %s'%( arm, positions ) )
joint_names = get_joint_names( ''.join( ( arm, '_arm_controller' ) ) )
jt = JointTrajectory()
jt.joint_names = joint_names
jt.points = []
jp = JointTrajectoryPoint()
jp.time_from_start = rospy.Time.from_seconds( time_from_start )
jp.positions = positions
jt.points.append( jp )
# push trajectory goal to ActionServer
jt_goal = JointTrajectoryGoal()
jt_goal.trajectory = jt
jt_goal.trajectory.header.stamp = rospy.Time.now() # + rospy.Duration.from_sec( time_from_start )
client.send_goal( jt_goal )
client.wait_for_result()
return client.get_state()
def track_trajectory( pos, vel, acc, time,
arm = 'r', client = None,
stamp = None):
if (acc == None):
acc = np.zeros( pos.shape )
if ( len( pos ) != len( vel ) or len( pos ) != len( time ) ):
rospy.logerr( '[track_trajectory] dimensions do not agree' )
rospy.loginfo( 'arm \'%s\' tracking trajectory with %d points'
%( arm, len( pos ) ) )
if (client == None):
client = init_jt_client(arm)
else:
arm = client.action_client.ns[0:1]; # ignore arm argument
joint_names = get_joint_names( ''.join( ( arm, '_arm_controller' ) ) )
# create trajectory message
jt = JointTrajectory()
jt.joint_names = joint_names
jt.points = []
t = 0
for i in range( len( pos ) ):
jp = JointTrajectoryPoint()
jp.time_from_start = rospy.Time.from_sec( time[i] )
jp.positions = pos[i,:]
jp.velocities = vel[i,:]
jp.accelerations = acc[i,:]
jt.points.append( jp )
t += 1
if ( stamp == None ):
stamp = rospy.Time.now()
# push trajectory goal to ActionServer
jt_goal = JointTrajectoryGoal()
jt_goal.trajectory = jt
jt_goal.trajectory.header.stamp = stamp;
client.send_goal(jt_goal)
| ajibawa-2023/Python-Code-Large/train/row_99262 | 124 | 180 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0056, 0.0056, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L2_C0", "label": "load_manifest()", "type": "expression", "loc": [2, 2], "level": 0, "parent": null, "vector": [8, 0, 0.0111, 0.0056, 0, 0.66, 0.0417, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rospy' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L3_C0", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0167, 0.0056, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rosparam' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0222, 0.0056, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'actionlib' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0278, 0.0056, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'trajectory_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0333, 0.0056, 0, 0.66, 0.2083, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'pr2_controllers_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0444, 0.0056, 0, 0.66, 0.25, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Import_L9_C0", "label": "rosparam import rosparam", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.05, 0.0056, 0, 0.66, 0.2917, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "rosparam", "arg_names": [], "import_names": ["rosparam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosparam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Import_L11_C0", "label": "csv import csv", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0611, 0.0056, 0, 0.66, 0.3333, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:ImportFrom_L13_C0", "label": "from actionlib import SimpleActionClient", "type": "import", "loc": [13, 14], "level": 0, "parent": null, "vector": [1, 0, 0.075, 0.0111, 0, 0.66, 0.375, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["SimpleActionClient"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib import \\\n SimpleActionClient"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:ImportFrom_L15_C0", "label": "from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint", "type": "import", "loc": [15, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0861, 0.0111, 0, 0.66, 0.4167, 485, 0, 2, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectory", "JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import \\\n JointTrajectory, JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:ImportFrom_L17_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal", "type": "import", "loc": [17, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0972, 0.0111, 0, 0.66, 0.4583, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import \\\n JointTrajectoryAction, JointTrajectoryGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Import_L20_C0", "label": "numpy import np", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.0056, 0, 0.66, 0.5, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:ImportFrom_L21_C0", "label": "from math import fmod, pi", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1167, 0.0056, 0, 0.66, 0.5417, 526, 0, 2, 0, 0, 526, 0, 0], "semantic": {"name": "math", "arg_names": [], "import_names": ["fmod", "pi"], "rhs_call_name": "", "annotation": ""}, "snippet": "from math import fmod, pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Import_L22_C0", "label": "pickle import pickle", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1222, 0.0056, 0, 0.66, 0.5833, 848, 0, 1, 0, 0, 848, 0, 0], "semantic": {"name": "pickle", "arg_names": [], "import_names": ["pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L28_C0", "label": "wrap_angle", "type": "function", "loc": [28, 32], "level": 0, "parent": null, "vector": [2, 0, 0.1667, 0.0278, 0, 0.66, 0.625, 488, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "wrap_angle", "arg_names": ["a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wrap_angle( a ):\n if a < 0:\n return fmod( a - pi, 2 * pi ) + pi\n if a > 0:\n return fmod( a + pi, 2 * pi ) - pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L29_C4", "label": "if", "type": "if", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L28_C0", "vector": [4, 1, 0.1639, 0.0111, 1, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if a < 0:\n return fmod( a - pi, 2 * pi ) + pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L29_C4", "vector": [13, 2, 0.1667, 0.0056, 2, 0.49, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fmod( a - pi, 2 * pi ) + pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L31_C4", "label": "if", "type": "if", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L28_C0", "vector": [4, 1, 0.175, 0.0111, 1, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if a > 0:\n return fmod( a + pi, 2 * pi ) - pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L31_C4", "vector": [13, 2, 0.1778, 0.0056, 2, 0.79, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return fmod( a + pi, 2 * pi ) - pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "label": "wrap_trajectory", "type": "function", "loc": [34, 53], "level": 0, "parent": null, "vector": [2, 0, 0.2417, 0.1111, 0, 0.66, 0.6667, 611, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "wrap_trajectory", "arg_names": ["t"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wrap_trajectory( t ):\n rospy.loginfo( 'warapping trajectory [#points: %d] ...', len( t ) )\n b = 0.1\n if len( t ) < 0:\n return\n last = map( wrap_angle, t[0])\n offsets = np.zeros( len( last ) )\n for i in range( len( t ) ):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L35_C4", "label": "loginfo()", "type": "expression", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [8, 1, 0.1944, 0.0056, 1, 0.94, 0.0, 607, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'warapping trajectory [#points: %d] ...', len( t ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L36_C4", "label": "b =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [14, 1, 0.2, 0.0056, 1, 0.94, 0.1667, 756, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " b = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L37_C4", "label": "if", "type": "if", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [4, 1, 0.2083, 0.0111, 1, 0.94, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( t ) < 0:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L37_C4", "vector": [13, 2, 0.2111, 0.0056, 2, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L39_C4", "label": "last = map()", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [14, 1, 0.2167, 0.0056, 1, 0.94, 0.5, 95, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "last", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " last = map( wrap_angle, t[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L40_C4", "label": "offsets = zeros()", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [14, 1, 0.2222, 0.0056, 1, 0.94, 0.6667, 559, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "offsets", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " offsets = np.zeros( len( last ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L41_C4", "label": "for i", "type": "for", "loc": [41, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [6, 1, 0.2583, 0.0667, 1, 0.94, 0.8333, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range( len( t ) ):\n for j in range( len( t[i] ) ):\n a = wrap_angle( t[i,j] )\n \n if a > pi - b and last[j] < -pi + b:\n offsets[j] -= 2 * pi\n if a < -pi + b and last[j] > pi - b:\n offsets[j] += 2 * pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "label": "for j", "type": "for", "loc": [42, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L41_C4", "vector": [6, 2, 0.2556, 0.05, 2, 0.04, 0.0, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( len( t[i] ) ):\n a = wrap_angle( t[i,j] )\n \n if a > pi - b and last[j] < -pi + b:\n offsets[j] -= 2 * pi\n if a < -pi + b and last[j] > pi - b:\n offsets[j] += 2 * pi\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L43_C12", "label": "a = wrap_angle()", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "vector": [14, 3, 0.2389, 0.0056, 3, 0.46, 0.0, 475, 3, 1, 0, 0, 488, 10, 1], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "wrap_angle", "annotation": ""}, "snippet": " a = wrap_angle( t[i,j] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L45_C12", "label": "if", "type": "if", "loc": [45, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "vector": [4, 3, 0.2528, 0.0111, 3, 0.46, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if a > pi - b and last[j] < -pi + b:\n offsets[j] -= 2 * pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L47_C12", "label": "if", "type": "if", "loc": [47, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "vector": [4, 3, 0.2639, 0.0111, 3, 0.46, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if a < -pi + b and last[j] > pi - b:\n offsets[j] += 2 * pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L50_C12", "label": "assign", "type": "assigned_variable", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "vector": [14, 3, 0.2778, 0.0056, 3, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last[j] = a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L53_C4", "label": "loginfo()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "vector": [8, 1, 0.2944, 0.0056, 1, 0.94, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'done!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "label": "compute_derivative", "type": "function", "loc": [55, 64], "level": 0, "parent": null, "vector": [2, 0, 0.3306, 0.0556, 0, 0.66, 0.7083, 983, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "compute_derivative", "arg_names": ["f", "dt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def compute_derivative( f, dt ):\n rospy.loginfo( 'computing derivative [#points: %d] ...', len( f ) )\n f_dot = np.zeros( f.shape )\n for i in range( 1, len( f ) - 1 ): \n for j in range( len( f[i] ) ):\n f_dot[i,j] = (f[i+1,j] - f[i-1,j]) / (2.0 * dt)\n f_dot[0,:] = (f[1,:] - f[-1,:]) / (2.0 * dt)\n f_dot[-1,:] = (f[0,:] - f[-2,:]) / (2.0 * dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L56_C4", "label": "loginfo()", "type": "expression", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [8, 1, 0.3111, 0.0056, 1, 0.39, 0.0, 607, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'computing derivative [#points: %d] ...', len( f ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L57_C4", "label": "f_dot = zeros()", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [14, 1, 0.3167, 0.0056, 1, 0.39, 0.1667, 924, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "f_dot", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " f_dot = np.zeros( f.shape )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L58_C4", "label": "for i", "type": "for", "loc": [58, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [6, 1, 0.3278, 0.0167, 1, 0.39, 0.3333, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range( 1, len( f ) - 1 ): \n for j in range( len( f[i] ) ):\n f_dot[i,j] = (f[i+1,j] - f[i-1,j]) / (2.0 * dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L59_C8", "label": "for j", "type": "for", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L58_C4", "vector": [6, 2, 0.3306, 0.0111, 2, 0.8, 0.0, 100, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range( len( f[i] ) ):\n f_dot[i,j] = (f[i+1,j] - f[i-1,j]) / (2.0 * dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L60_C12", "label": "assign", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L59_C8", "vector": [14, 3, 0.3333, 0.0056, 3, 0.43, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_dot[i,j] = (f[i+1,j] - f[i-1,j]) / (2.0 * dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L61_C4", "label": "assign", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [14, 1, 0.3389, 0.0056, 1, 0.39, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_dot[0,:] = (f[1,:] - f[-1,:]) / (2.0 * dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L62_C4", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [14, 1, 0.3444, 0.0056, 1, 0.39, 0.6667, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f_dot[-1,:] = (f[0,:] - f[-2,:]) / (2.0 * dt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L63_C4", "label": "loginfo()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [8, 1, 0.35, 0.0056, 1, 0.39, 0.8333, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'done!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L64_C4", "label": "return", "type": "return", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "vector": [13, 1, 0.3556, 0.0056, 1, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f_dot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "label": "save_motion", "type": "function", "loc": [66, 72], "level": 0, "parent": null, "vector": [2, 0, 0.3833, 0.0389, 0, 0.66, 0.75, 579, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "save_motion", "arg_names": ["fname", "name", "time", "pos", "vel", "acc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def save_motion( fname, name, time, pos, vel, acc ):\n rospy.loginfo( 'save motion \\'%s\\' to file: %s'%( name, fname ) )\n pkl_file = open( fname, 'wb' )\n data = ( name, time, pos, vel, acc )\n pickle.dump( data, pkl_file )\n pkl_file.close()\n rospy.loginfo( 'done!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L67_C4", "label": "loginfo()", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "vector": [8, 1, 0.3722, 0.0056, 1, 0.96, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'save motion \\'%s\\' to file: %s'%( name, fname ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L68_C4", "label": "pkl_file = open()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "vector": [14, 1, 0.3778, 0.0056, 1, 0.96, 0.2, 255, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "pkl_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " pkl_file = open( fname, 'wb' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L69_C4", "label": "data =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "vector": [14, 1, 0.3833, 0.0056, 1, 0.96, 0.4, 929, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = ( name, time, pos, vel, acc )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L70_C4", "label": "dump()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "vector": [8, 1, 0.3889, 0.0056, 1, 0.96, 0.6, 952, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " pickle.dump( data, pkl_file )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L71_C4", "label": "close()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "vector": [8, 1, 0.3944, 0.0056, 1, 0.96, 0.8, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " pkl_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L72_C4", "label": "loginfo()", "type": "expression", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "vector": [8, 1, 0.4, 0.0056, 1, 0.96, 1.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'done!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "label": "load_motion", "type": "function", "loc": [74, 79], "level": 0, "parent": null, "vector": [2, 0, 0.425, 0.0333, 0, 0.66, 0.7917, 440, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "load_motion", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_motion( fname ):\n rospy.loginfo( 'loading motion from file: %s'%fname )\n pkl_file = open( fname, 'rb' )\n data = pickle.load( pkl_file )\n rospy.loginfo( 'done!' )\n return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L75_C4", "label": "loginfo()", "type": "expression", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "vector": [8, 1, 0.4167, 0.0056, 1, 0.59, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'loading motion from file: %s'%fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L76_C4", "label": "pkl_file = open()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "vector": [14, 1, 0.4222, 0.0056, 1, 0.59, 0.25, 255, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "pkl_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " pkl_file = open( fname, 'rb' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L77_C4", "label": "data = load()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "vector": [14, 1, 0.4278, 0.0056, 1, 0.59, 0.5, 929, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": " data = pickle.load( pkl_file )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L78_C4", "label": "loginfo()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "vector": [8, 1, 0.4333, 0.0056, 1, 0.59, 0.75, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'done!' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L79_C4", "label": "return", "type": "return", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "vector": [13, 1, 0.4389, 0.0056, 1, 0.59, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "label": "load_motion_ascii", "type": "function", "loc": [81, 92], "level": 0, "parent": null, "vector": [2, 0, 0.4806, 0.0667, 0, 0.66, 0.8333, 301, 0, 1, 1, 0, 0, 0, 17], "semantic": {"name": "load_motion_ascii", "arg_names": ["fname"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_motion_ascii( fname ):\n reader = csv.reader( open( fname, 'rb' ), delimiter=\"\\t\" )\n t = []\n pos = []\n vel = []\n acc = []\n for row in reader:\n t.append( float(row[0]) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L82_C4", "label": "reader = reader()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [14, 1, 0.4556, 0.0056, 1, 0.19, 0.0, 548, 3, 2, 0, 0, 548, 10, 2], "semantic": {"name": "reader", "arg_names": [], "import_names": [], "rhs_call_name": "reader", "annotation": ""}, "snippet": " reader = csv.reader( open( fname, 'rb' ), delimiter=\"\\t\" )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L83_C4", "label": "t =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [14, 1, 0.4611, 0.0056, 1, 0.19, 0.1667, 15, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L84_C4", "label": "pos =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [14, 1, 0.4667, 0.0056, 1, 0.19, 0.3333, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pos = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L85_C4", "label": "vel =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [14, 1, 0.4722, 0.0056, 1, 0.19, 0.5, 527, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L86_C4", "label": "acc =", "type": "assigned_variable", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [14, 1, 0.4778, 0.0056, 1, 0.19, 0.6667, 928, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "acc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "label": "for row", "type": "for", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [6, 1, 0.4944, 0.0278, 1, 0.19, 0.8333, 767, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in reader:\n t.append( float(row[0]) )\n pos.append( map( lambda x: float(x), row[1:8] ) )\n vel.append( map( lambda x: float(x), row[8:15] ) )\n acc.append( map( lambda x: float(x), row[15:22] ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L88_C8", "label": "append()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "vector": [8, 2, 0.4889, 0.0056, 2, 0.56, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " t.append( float(row[0]) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L89_C8", "label": "append()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "vector": [8, 2, 0.4944, 0.0056, 2, 0.56, 0.3333, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pos.append( map( lambda x: float(x), row[1:8] ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L90_C8", "label": "append()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "vector": [8, 2, 0.5, 0.0056, 2, 0.56, 0.6667, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " vel.append( map( lambda x: float(x), row[8:15] ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L91_C8", "label": "append()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "vector": [8, 2, 0.5056, 0.0056, 2, 0.56, 1.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " acc.append( map( lambda x: float(x), row[15:22] ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L92_C4", "label": "return", "type": "return", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "vector": [13, 1, 0.5111, 0.0056, 1, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 8, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (fname, np.asarray(t), np.asarray(pos), np.asarray(vel), np.asarray(acc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "label": "init_jt_client", "type": "function", "loc": [98, 104], "level": 0, "parent": null, "vector": [2, 0, 0.5611, 0.0389, 0, 0.66, 0.875, 301, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "init_jt_client", "arg_names": ["arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def init_jt_client(arm = 'r'):\n name = \"\".join( [ arm, \"_arm_controller/joint_trajectory_action\" ] )\n client = SimpleActionClient(name, JointTrajectoryAction)\n rospy.loginfo( 'waiting for action client : %s ...'%name )\n client.wait_for_server()\n rospy.loginfo( '%s is up and running!'%name )\n return client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L99_C4", "label": "name = join()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "vector": [14, 1, 0.55, 0.0056, 1, 0.75, 0.0, 57, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " name = \"\".join( [ arm, \"_arm_controller/joint_trajectory_action\" ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L100_C4", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "vector": [14, 1, 0.5556, 0.0056, 1, 0.75, 0.2, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = SimpleActionClient(name, JointTrajectoryAction)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L101_C4", "label": "loginfo()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "vector": [8, 1, 0.5611, 0.0056, 1, 0.75, 0.4, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'waiting for action client : %s ...'%name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L102_C4", "label": "wait_for_server()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "vector": [8, 1, 0.5667, 0.0056, 1, 0.75, 0.6, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L103_C4", "label": "loginfo()", "type": "expression", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "vector": [8, 1, 0.5722, 0.0056, 1, 0.75, 0.8, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( '%s is up and running!'%name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L104_C4", "label": "return", "type": "return", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "vector": [13, 1, 0.5778, 0.0056, 1, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return client"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L106_C0", "label": "get_joint_names", "type": "function", "loc": [106, 107], "level": 0, "parent": null, "vector": [2, 0, 0.5917, 0.0111, 0, 0.66, 0.9167, 427, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_names", "arg_names": ["node_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_joint_names( node_name ):\n return rosparam.get_param( ''.join( (node_name, '/joints') ) ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L107_C4", "label": "return", "type": "return", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L106_C0", "vector": [13, 1, 0.5944, 0.0056, 1, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rosparam.get_param( ''.join( (node_name, '/joints') ) ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "label": "move_arm", "type": "function", "loc": [109, 134], "level": 0, "parent": null, "vector": [2, 0, 0.675, 0.1444, 0, 0.66, 0.9583, 236, 0, 4, 1, 0, 0, 0, 13], "semantic": {"name": "move_arm", "arg_names": ["positions", "time_from_start", "arm", "client"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def move_arm( positions, time_from_start = 3.0, arm = 'r', client = None ):\n\n if (client == None):\n client = init_jt_client(arm)\n else:\n arm = client.action_client.ns[0:1]; # ignore arm argument\n\n rospy.loginfo( 'move arm \\'%s\\' to position %s'%( arm, positions ) ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L111_C4", "label": "if", "type": "if", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [4, 1, 0.625, 0.0222, 1, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (client == None):\n client = init_jt_client(arm)\n else:\n arm = client.action_client.ns[0:1]; # ignore arm argument"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L112_C8", "label": "client = init_jt_client()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L111_C4", "vector": [14, 2, 0.6222, 0.0056, 2, 0.77, 0.0, 608, 3, 1, 0, 0, 301, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "init_jt_client", "annotation": ""}, "snippet": " client = init_jt_client(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L114_C8", "label": "arm =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L111_C4", "vector": [14, 2, 0.6333, 0.0056, 2, 0.77, 1.0, 413, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = client.action_client.ns[0:1]; # ignore arm argument"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L116_C4", "label": "loginfo()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [8, 1, 0.6444, 0.0056, 1, 0.7, 0.0667, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'move arm \\'%s\\' to position %s'%( arm, positions ) ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L118_C4", "label": "joint_names = get_joint_names()", "type": "assigned_variable", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6556, 0.0056, 1, 0.7, 0.1333, 393, 3, 1, 0, 0, 427, 10, 2], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_names", "annotation": ""}, "snippet": " joint_names = get_joint_names( ''.join( ( arm, '_arm_controller' ) ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L120_C4", "label": "jt = JointTrajectory()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6667, 0.0056, 1, 0.7, 0.2, 61, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jt", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " jt = JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L121_C4", "label": "jt.joint_names =", "type": "assigned_variable", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6722, 0.0056, 1, 0.7, 0.2667, 350, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.joint_names = joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L122_C4", "label": "jt.points =", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6778, 0.0056, 1, 0.7, 0.3333, 737, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jt.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L123_C4", "label": "jp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6833, 0.0056, 1, 0.7, 0.4, 507, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L124_C4", "label": "jp.time_from_start = from_seconds()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6889, 0.0056, 1, 0.7, 0.4667, 186, 3, 1, 0, 0, 866, 10, 1], "semantic": {"name": "jp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "from_seconds", "annotation": ""}, "snippet": " jp.time_from_start = rospy.Time.from_seconds( time_from_start )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L125_C4", "label": "jp.positions =", "type": "assigned_variable", "loc": [125, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.6944, 0.0056, 1, 0.7, 0.5333, 297, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.positions = positions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L126_C4", "label": "append()", "type": "expression", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [8, 1, 0.7, 0.0056, 1, 0.7, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L129_C4", "label": "jt_goal = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.7167, 0.0056, 1, 0.7, 0.6667, 426, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "jt_goal", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " jt_goal = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L130_C4", "label": "jt_goal.trajectory =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.7222, 0.0056, 1, 0.7, 0.7333, 235, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt_goal.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt_goal.trajectory = jt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L131_C4", "label": "jt_goal.trajectory.header.stamp = now()", "type": "assigned_variable", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [14, 1, 0.7278, 0.0056, 1, 0.7, 0.8, 163, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "jt_goal.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " jt_goal.trajectory.header.stamp = rospy.Time.now() # + rospy.Duration.from_sec( time_from_start )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L132_C4", "label": "send_goal()", "type": "expression", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [8, 1, 0.7333, 0.0056, 1, 0.7, 0.8667, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal( jt_goal )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L133_C4", "label": "wait_for_result()", "type": "expression", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [8, 1, 0.7389, 0.0056, 1, 0.7, 0.9333, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " client.wait_for_result() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L134_C4", "label": "return", "type": "return", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "vector": [13, 1, 0.7444, 0.0056, 1, 0.7, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return client.get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "label": "track_trajectory", "type": "function", "loc": [137, 179], "level": 0, "parent": null, "vector": [2, 0, 0.8778, 0.2389, 0, 0.66, 1.0, 876, 0, 7, 0, 0, 0, 0, 20], "semantic": {"name": "track_trajectory", "arg_names": ["pos", "vel", "acc", "time", "arm", "client", "stamp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def track_trajectory( pos, vel, acc, time, \n arm = 'r', client = None,\n stamp = None):\n\n if (acc == None):\n acc = np.zeros( pos.shape )\n\n if ( len( pos ) != len( vel ) or len( pos ) != len( time ) ):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L141_C4", "label": "if", "type": "if", "loc": [141, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [4, 1, 0.7861, 0.0111, 1, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (acc == None):\n acc = np.zeros( pos.shape )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L142_C8", "label": "acc = zeros()", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L141_C4", "vector": [14, 2, 0.7889, 0.0056, 2, 0.58, 0.0, 928, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "acc", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " acc = np.zeros( pos.shape )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L144_C4", "label": "if", "type": "if", "loc": [144, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [4, 1, 0.8028, 0.0111, 1, 0.08, 0.0714, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ( len( pos ) != len( vel ) or len( pos ) != len( time ) ):\n rospy.logerr( '[track_trajectory] dimensions do not agree' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L145_C8", "label": "logerr()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L144_C4", "vector": [8, 2, 0.8056, 0.0056, 2, 0.15, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr( '[track_trajectory] dimensions do not agree' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L147_C4", "label": "loginfo()", "type": "expression", "loc": [147, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [8, 1, 0.8194, 0.0111, 1, 0.08, 0.1429, 607, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'arm \\'%s\\' tracking trajectory with %d points'\n %( arm, len( pos ) ) ) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L150_C4", "label": "if", "type": "if", "loc": [150, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [4, 1, 0.8417, 0.0222, 1, 0.08, 0.2143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (client == None):\n client = init_jt_client(arm)\n else:\n arm = client.action_client.ns[0:1]; # ignore arm argument"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L151_C8", "label": "client = init_jt_client()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L150_C4", "vector": [14, 2, 0.8389, 0.0056, 2, 0.49, 0.0, 608, 3, 1, 0, 0, 301, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "init_jt_client", "annotation": ""}, "snippet": " client = init_jt_client(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L153_C8", "label": "arm =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L150_C4", "vector": [14, 2, 0.85, 0.0056, 2, 0.49, 1.0, 413, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = client.action_client.ns[0:1]; # ignore arm argument"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L155_C4", "label": "joint_names = get_joint_names()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.8611, 0.0056, 1, 0.08, 0.2857, 393, 3, 1, 0, 0, 427, 10, 2], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_names", "annotation": ""}, "snippet": " joint_names = get_joint_names( ''.join( ( arm, '_arm_controller' ) ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L158_C4", "label": "jt = JointTrajectory()", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.8778, 0.0056, 1, 0.08, 0.3571, 61, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jt", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " jt = JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L159_C4", "label": "jt.joint_names =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.8833, 0.0056, 1, 0.08, 0.4286, 350, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.joint_names = joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L160_C4", "label": "jt.points =", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.8889, 0.0056, 1, 0.08, 0.5, 737, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jt.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L162_C4", "label": "t =", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.9, 0.0056, 1, 0.08, 0.5714, 15, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "label": "for i", "type": "for", "loc": [163, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [6, 1, 0.925, 0.0444, 1, 0.08, 0.6429, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range( len( pos ) ):\n jp = JointTrajectoryPoint()\n jp.time_from_start = rospy.Time.from_sec( time[i] )\n jp.positions = pos[i,:]\n jp.velocities = vel[i,:]\n jp.accelerations = acc[i,:]\n jt.points.append( jp )\n t += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L164_C8", "label": "jp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "vector": [14, 2, 0.9111, 0.0056, 2, 0.31, 0.0, 507, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L165_C8", "label": "jp.time_from_start = from_sec()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "vector": [14, 2, 0.9167, 0.0056, 2, 0.31, 0.2, 186, 3, 1, 0, 0, 334, 10, 1], "semantic": {"name": "jp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "from_sec", "annotation": ""}, "snippet": " jp.time_from_start = rospy.Time.from_sec( time[i] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L166_C8", "label": "jp.positions =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "vector": [14, 2, 0.9222, 0.0056, 2, 0.31, 0.4, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.positions = pos[i,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L167_C8", "label": "jp.velocities =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "vector": [14, 2, 0.9278, 0.0056, 2, 0.31, 0.6, 907, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.velocities = vel[i,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L168_C8", "label": "jp.accelerations =", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "vector": [14, 2, 0.9333, 0.0056, 2, 0.31, 0.8, 836, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.accelerations = acc[i,:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L169_C8", "label": "append()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "vector": [8, 2, 0.9389, 0.0056, 2, 0.31, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L172_C4", "label": "if", "type": "if", "loc": [172, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [4, 1, 0.9583, 0.0111, 1, 0.08, 0.7143, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ( stamp == None ):\n stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L173_C8", "label": "stamp = now()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L172_C4", "vector": [14, 2, 0.9611, 0.0056, 2, 0.12, 0.0, 897, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L176_C4", "label": "jt_goal = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.9778, 0.0056, 1, 0.08, 0.7857, 426, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "jt_goal", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " jt_goal = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L177_C4", "label": "jt_goal.trajectory =", "type": "assigned_variable", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.9833, 0.0056, 1, 0.08, 0.8571, 235, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt_goal.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt_goal.trajectory = jt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L178_C4", "label": "jt_goal.trajectory.header.stamp =", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [14, 1, 0.9889, 0.0056, 1, 0.08, 0.9286, 163, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt_goal.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt_goal.trajectory.header.stamp = stamp;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L179_C4", "label": "send_goal()", "type": "expression", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "vector": [8, 1, 0.9944, 0.0056, 1, 0.08, 1.0, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal(jt_goal)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Return_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:For_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:If_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99262:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99262:Expr_L179_C4"}] |
#!/usr/bin/env python
import roslib
roslib.load_manifest( 'rospy' )
import rospy
import sys
import numpy as np
import dynamics_utils as dynutils
if __name__== '__main__':
if ( len( sys.argv ) != 2 ):
rospy.logerr( 'no filename passed to play_motion.py' )
exit(-1)
fname = sys.argv[1];
node_name = "play_motion"
rospy.loginfo( 'register node %s ...'%node_name )
rospy.init_node( node_name )
rospy.loginfo( 'node %s up and running!'%node_name )
print dynutils.get_joint_names( 'l_arm_controller' )
# move right arm out of the way
dynutils.move_arm( [ -np.pi / 3,
np.pi / 3,
0,
-3 * np.pi/4,
0,
0,
0], arm = 'r' )
# load motion
( name, time, pos, vel, acc ) = dynutils.load_motion( fname );
dt = time[1] - time[0]
total_time = dt * len( time )
# start client for left arm
l_jt_client = dynutils.init_jt_client(arm = 'l')
# move left arm to starting posiiton
dynutils.move_arm( pos[0,:],
time_from_start = 3.0,
client = l_jt_client ) # left arm goes to first pos of trajectory
rospy.loginfo( 'playing \'%s\' motion ...'%name )
# initial call
last_call = rospy.Time().now() + rospy.Duration().from_sec( .5 );
dynutils.track_trajectory(pos, vel, acc, time, arm = 'l', client = l_jt_client, stamp = last_call )
# loop
while ( not rospy.is_shutdown() ):
dur = rospy.Time().now() - last_call;
if ( dur.to_sec() > total_time - (total_time / 2.0) ):
last_call += rospy.Duration().from_sec( total_time );
dynutils.track_trajectory(pos, vel, acc, time, arm = 'l', client = l_jt_client, stamp = last_call )
| ajibawa-2023/Python-Code-Large/train/row_99263 | 29 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0164, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0656, 0.0164, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rospy' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Import_L6_C0", "label": "rospy import rospy", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0164, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1311, 0.0164, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Import_L9_C0", "label": "numpy import np", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1475, 0.0164, 0, 0.66, 0.6667, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Import_L10_C0", "label": "dynamics_utils import dynutils", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1639, 0.0164, 0, 0.66, 0.8333, 318, 0, 1, 0, 0, 318, 0, 0], "semantic": {"name": "dynamics_utils", "arg_names": [], "import_names": ["dynutils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamics_utils as dynutils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "label": "if", "type": "if", "loc": [12, 61], "level": 0, "parent": null, "vector": [4, 0, 0.5984, 0.8197, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__== '__main__':\n\n if ( len( sys.argv ) != 2 ):\n rospy.logerr( 'no filename passed to play_motion.py' )\n exit(-1)\n \n fname = sys.argv[1];\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L14_C4", "label": "if", "type": "if", "loc": [14, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [4, 1, 0.2459, 0.0492, 1, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ( len( sys.argv ) != 2 ):\n rospy.logerr( 'no filename passed to play_motion.py' )\n exit(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L15_C8", "label": "logerr()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L14_C4", "vector": [8, 2, 0.2459, 0.0164, 2, 0.97, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr( 'no filename passed to play_motion.py' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L16_C8", "label": "exit()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L14_C4", "vector": [8, 2, 0.2623, 0.0164, 2, 0.97, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L18_C4", "label": "fname =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.2951, 0.0164, 1, 0.25, 0.0625, 190, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fname = sys.argv[1];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L20_C4", "label": "node_name =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.3279, 0.0164, 1, 0.25, 0.125, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node_name = \"play_motion\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L21_C4", "label": "loginfo()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.3443, 0.0164, 1, 0.25, 0.1875, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'register node %s ...'%node_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L22_C4", "label": "init_node()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.3607, 0.0164, 1, 0.25, 0.25, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( node_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L23_C4", "label": "loginfo()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.377, 0.0164, 1, 0.25, 0.3125, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'node %s up and running!'%node_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L25_C4", "label": "print()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.4098, 0.0164, 1, 0.25, 0.375, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(dynutils.get_joint_names( 'l_arm_controller' ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L28_C4", "label": "move_arm()", "type": "expression", "loc": [28, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.5082, 0.1148, 1, 0.25, 0.4375, 236, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm", "annotation": ""}, "snippet": " dynutils.move_arm( [ -np.pi / 3, \n np.pi / 3, \n 0,\n -3 * np.pi/4,\n 0, \n 0, \n 0], arm = 'r' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L37_C4", "label": "name, time, pos, vel, acc = load_motion()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.6066, 0.0164, 1, 0.25, 0.5, 700, 3, 1, 0, 0, 440, 10, 1], "semantic": {"name": "name, time, pos, vel, acc", "arg_names": [], "import_names": [], "rhs_call_name": "load_motion", "annotation": ""}, "snippet": " ( name, time, pos, vel, acc ) = dynutils.load_motion( fname );"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L38_C4", "label": "dt =", "type": "assigned_variable", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.623, 0.0164, 1, 0.25, 0.5625, 455, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dt = time[1] - time[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L39_C4", "label": "total_time =", "type": "assigned_variable", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.6393, 0.0164, 1, 0.25, 0.625, 875, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "total_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total_time = dt * len( time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L43_C4", "label": "l_jt_client = init_jt_client()", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.7049, 0.0164, 1, 0.25, 0.6875, 500, 3, 1, 0, 0, 301, 10, 1], "semantic": {"name": "l_jt_client", "arg_names": [], "import_names": [], "rhs_call_name": "init_jt_client", "annotation": ""}, "snippet": " l_jt_client = dynutils.init_jt_client(arm = 'l')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L46_C4", "label": "move_arm()", "type": "expression", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.7705, 0.0492, 1, 0.25, 0.75, 236, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm", "annotation": ""}, "snippet": " dynutils.move_arm( pos[0,:], \n time_from_start = 3.0, \n client = l_jt_client ) # left arm goes to first pos of trajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L50_C4", "label": "loginfo()", "type": "expression", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.8197, 0.0164, 1, 0.25, 0.8125, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo( 'playing \\'%s\\' motion ...'%name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L53_C4", "label": "last_call =", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [14, 1, 0.8689, 0.0164, 1, 0.25, 0.875, 867, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "last_call", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_call = rospy.Time().now() + rospy.Duration().from_sec( .5 );"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L54_C4", "label": "track_trajectory()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [8, 1, 0.8852, 0.0164, 1, 0.25, 0.9375, 876, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "track_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "track_trajectory", "annotation": ""}, "snippet": " dynutils.track_trajectory(pos, vel, acc, time, arm = 'l', client = l_jt_client, stamp = last_call )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:While_L57_C4", "label": "while", "type": "while", "loc": [57, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "vector": [5, 1, 0.9672, 0.082, 1, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while ( not rospy.is_shutdown() ):\n dur = rospy.Time().now() - last_call;\n if ( dur.to_sec() > total_time - (total_time / 2.0) ):\n last_call += rospy.Duration().from_sec( total_time );\n dynutils.track_trajectory(pos, vel, acc, time, arm = 'l', client = l_jt_client, stamp = last_call )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L58_C8", "label": "dur =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:While_L57_C4", "vector": [14, 2, 0.9508, 0.0164, 2, 0.62, 0.0, 45, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dur = rospy.Time().now() - last_call;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L59_C8", "label": "if", "type": "if", "loc": [59, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:While_L57_C4", "vector": [4, 2, 0.9836, 0.0492, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ( dur.to_sec() > total_time - (total_time / 2.0) ):\n last_call += rospy.Duration().from_sec( total_time );\n dynutils.track_trajectory(pos, vel, acc, time, arm = 'l', client = l_jt_client, stamp = last_call )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L61_C12", "label": "track_trajectory()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L59_C8", "vector": [8, 3, 1.0, 0.0164, 3, 0.32, 0.0, 876, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "track_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "track_trajectory", "annotation": ""}, "snippet": " dynutils.track_trajectory(pos, vel, acc, time, arm = 'l', client = l_jt_client, stamp = last_call )"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:While_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:While_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:While_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99263:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99263:Expr_L61_C12"}] |
#!/usr/bin/env python
""" Provides tools to compute root mean squared error for each joint in JointTrajectoryControllerState messages, either on-line by listening to a speciefied topic - or offline by reading a bag file."""
import numpy as np
import sys
import roslib
roslib.load_manifest( 'gpr_controller' )
import rospy
import rosbag
from pr2_controllers_msgs.msg import JointTrajectoryControllerState
__author__ = "Daniel Hennes"
class RMSEListener():
error_sum = None
num_msg = 0
def __init__( self, topic ):
np.set_printoptions( precision=3 ) # , suppress=True )
rospy.init_node( 'rsme_joint_states' )
rospy.Subscriber( topic, JointTrajectoryControllerState,
self.cb_controller_state )
rospy.spin()
def cb_controller_state( self, msg ):
if self.error_sum is None:
self.error_sum = np.asarray( msg.error.positions ) ** 2
else:
self.error_sum += np.asarray ( msg.error.positions ) ** 2
self.num_msg += 1
RMSE = np.sqrt( self.error_sum / self.num_msg )
print RMSE
class RMSEBagReader():
def __init__( self, fname = 'test.bag', topic = 'r_arm_controller/state' ):
msgs = self.read_file( fname, topic )
print self.rmse ( msgs )
def read_file( self, fname, topic ):
bag = rosbag.Bag( fname )
msgs = []
for topic, msg, t in bag.read_messages( topics = [topic] ):
msgs.append( msg )
bag.close()
return msgs
def rmse( self, msgs ):
error_sum = None
num_msg = 0
for msg in msgs:
if error_sum is None:
error_sum = np.asarray( msg.error.positions ) ** 2
else:
error_sum += np.asarray ( msg.error.positions ) ** 2
num_msg += 1
if error_sum is None:
return None
else:
return np.sqrt( error_sum / num_msg )
if __name__ == '__main__':
args = sys.argv
args.pop(0)
if len( args ) == 2 and args[0] == 'listen':
RMSEListener( args[1] )
elif len( args ) == 3 and args[0] == 'read':
RMSEBagReader( args[1], args[2] )
else:
print "Usage: rmse <subcommand> [args]\n"
print "Available subcommands:"
print "\tlisten [topic]"
print "\tread [filename] [topic]"
| ajibawa-2023/Python-Code-Large/train/row_99264 | 53 | 76 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0395, 0.0132, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\" Provides tools to compute root mean squared error for each joint in JointTrajectoryControllerState messages, either on-line by listening to a speciefied topic - or offline by reading a bag file.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Import_L5_C0", "label": "numpy import np", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0658, 0.0132, 0, 0.66, 0.0909, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Import_L6_C0", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0132, 0, 0.66, 0.1818, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Import_L8_C0", "label": "roslib import roslib", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0132, 0, 0.66, 0.2727, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.1184, 0.0132, 0, 0.66, 0.3636, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'gpr_controller' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1316, 0.0132, 0, 0.66, 0.4545, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Import_L11_C0", "label": "rosbag import rosbag", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1447, 0.0132, 0, 0.66, 0.5455, 243, 0, 1, 0, 0, 243, 0, 0], "semantic": {"name": "rosbag", "arg_names": [], "import_names": ["rosbag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosbag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:ImportFrom_L12_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryControllerState", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1579, 0.0132, 0, 0.66, 0.6364, 457, 0, 1, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L14_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1842, 0.0132, 0, 0.66, 0.7273, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = \"Daniel Hennes\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "label": "RMSEListener", "type": "class", "loc": [16, 35], "level": 0, "parent": null, "vector": [3, 0, 0.3355, 0.2632, 0, 0.66, 0.8182, 52, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "RMSEListener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RMSEListener():\n error_sum = None\n num_msg = 0\n\n def __init__( self, topic ):\n np.set_printoptions( precision=3 ) # , suppress=True )\n\n rospy.init_node( 'rsme_joint_states' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L17_C4", "label": "error_sum =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "vector": [14, 1, 0.2237, 0.0132, 1, 0.09, 0.0, 344, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "error_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_sum = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L18_C4", "label": "num_msg =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "vector": [14, 1, 0.2368, 0.0132, 1, 0.09, 0.3333, 427, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_msg = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "vector": [2, 1, 0.3026, 0.0921, 1, 0.09, 0.6667, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, topic ):\n np.set_printoptions( precision=3 ) # , suppress=True )\n\n rospy.init_node( 'rsme_joint_states' )\n rospy.Subscriber( topic, JointTrajectoryControllerState, \n self.cb_controller_state )\n rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L21_C8", "label": "set_printoptions()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "vector": [8, 2, 0.2763, 0.0132, 2, 0.36, 0.0, 763, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_printoptions", "arg_names": [], "import_names": [], "rhs_call_name": "set_printoptions", "annotation": ""}, "snippet": " np.set_printoptions( precision=3 ) # , suppress=True )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L23_C8", "label": "init_node()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "vector": [8, 2, 0.3026, 0.0132, 2, 0.36, 0.3333, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'rsme_joint_states' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L24_C8", "label": "Subscriber()", "type": "expression", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "vector": [8, 2, 0.3224, 0.0263, 2, 0.36, 0.6667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber( topic, JointTrajectoryControllerState, \n self.cb_controller_state )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L26_C8", "label": "spin()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "vector": [8, 2, 0.3421, 0.0132, 2, 0.36, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "label": "cb_controller_state", "type": "function", "loc": [28, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "vector": [2, 1, 0.4145, 0.1053, 1, 0.09, 1.0, 350, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "cb_controller_state", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cb_controller_state( self, msg ):\n if self.error_sum is None:\n self.error_sum = np.asarray( msg.error.positions ) ** 2\n else:\n self.error_sum += np.asarray ( msg.error.positions ) ** 2 \n self.num_msg += 1\n RMSE = np.sqrt( self.error_sum / self.num_msg )\n print(RMSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L29_C8", "label": "if", "type": "if", "loc": [29, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "vector": [4, 2, 0.4013, 0.0526, 2, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.error_sum is None:\n self.error_sum = np.asarray( msg.error.positions ) ** 2\n else:\n self.error_sum += np.asarray ( msg.error.positions ) ** 2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L30_C12", "label": "self.error_sum =", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L29_C8", "vector": [14, 3, 0.3947, 0.0132, 3, 0.65, 0.0, 989, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.error_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.error_sum = np.asarray( msg.error.positions ) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L34_C8", "label": "RMSE = sqrt()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "vector": [14, 2, 0.4474, 0.0132, 2, 0.27, 0.5, 897, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "RMSE", "arg_names": [], "import_names": [], "rhs_call_name": "sqrt", "annotation": ""}, "snippet": " RMSE = np.sqrt( self.error_sum / self.num_msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L35_C8", "label": "print()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "vector": [8, 2, 0.4605, 0.0132, 2, 0.27, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(RMSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "label": "RMSEBagReader", "type": "class", "loc": [37, 62], "level": 0, "parent": null, "vector": [3, 0, 0.6513, 0.3421, 0, 0.66, 0.9091, 884, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "RMSEBagReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RMSEBagReader():\n def __init__( self, fname = 'test.bag', topic = 'r_arm_controller/state' ):\n msgs = self.read_file( fname, topic )\n print(self.rmse ( msgs ))\n\n def read_file( self, fname, topic ):\n bag = rosbag.Bag( fname )\n msgs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L38_C4", "label": "__init__", "type": "function", "loc": [38, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "vector": [2, 1, 0.5132, 0.0395, 1, 0.63, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "fname", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__( self, fname = 'test.bag', topic = 'r_arm_controller/state' ):\n msgs = self.read_file( fname, topic )\n print(self.rmse ( msgs ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L39_C8", "label": "msgs = read_file()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L38_C4", "vector": [14, 2, 0.5132, 0.0132, 2, 0.39, 0.0, 211, 3, 2, 0, 0, 542, 10, 1], "semantic": {"name": "msgs", "arg_names": [], "import_names": [], "rhs_call_name": "read_file", "annotation": ""}, "snippet": " msgs = self.read_file( fname, topic )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L40_C8", "label": "print()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L38_C4", "vector": [8, 2, 0.5263, 0.0132, 2, 0.39, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self.rmse ( msgs ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "label": "read_file", "type": "function", "loc": [42, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "vector": [2, 1, 0.5921, 0.0921, 1, 0.63, 0.5, 542, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "read_file", "arg_names": ["self", "fname", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read_file( self, fname, topic ):\n bag = rosbag.Bag( fname )\n msgs = []\n for topic, msg, t in bag.read_messages( topics = [topic] ):\n msgs.append( msg )\n bag.close()\n return msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L43_C8", "label": "bag = Bag()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "vector": [14, 2, 0.5658, 0.0132, 2, 0.26, 0.0, 117, 3, 1, 0, 0, 568, 10, 1], "semantic": {"name": "bag", "arg_names": [], "import_names": [], "rhs_call_name": "Bag", "annotation": ""}, "snippet": " bag = rosbag.Bag( fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L44_C8", "label": "msgs =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "vector": [14, 2, 0.5789, 0.0132, 2, 0.26, 0.25, 211, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "msgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msgs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L45_C8", "label": "for topic, msg, t", "type": "for", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "vector": [6, 2, 0.5987, 0.0263, 2, 0.26, 0.5, 35, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "topic, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic, msg, t in bag.read_messages( topics = [topic] ):\n msgs.append( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L46_C12", "label": "append()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L45_C8", "vector": [8, 3, 0.6053, 0.0132, 3, 0.21, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " msgs.append( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L47_C8", "label": "close()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "vector": [8, 2, 0.6184, 0.0132, 2, 0.26, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " bag.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "vector": [13, 2, 0.6316, 0.0132, 2, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return msgs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "label": "rmse", "type": "function", "loc": [50, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "vector": [2, 1, 0.7368, 0.1711, 1, 0.63, 1.0, 458, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "rmse", "arg_names": ["self", "msgs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def rmse( self, msgs ):\n error_sum = None\n num_msg = 0\n for msg in msgs:\n if error_sum is None:\n error_sum = np.asarray( msg.error.positions ) ** 2\n else:\n error_sum += np.asarray ( msg.error.positions ) ** 2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L51_C8", "label": "error_sum =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "vector": [14, 2, 0.6711, 0.0132, 2, 0.02, 0.0, 344, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "error_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_sum = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L52_C8", "label": "num_msg =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "vector": [14, 2, 0.6842, 0.0132, 2, 0.02, 0.3333, 427, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "num_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_msg = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L53_C8", "label": "for msg", "type": "for", "loc": [53, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "vector": [6, 2, 0.7303, 0.0789, 2, 0.02, 0.6667, 712, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for msg in msgs:\n if error_sum is None:\n error_sum = np.asarray( msg.error.positions ) ** 2\n else:\n error_sum += np.asarray ( msg.error.positions ) ** 2 \n num_msg += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L54_C12", "label": "if", "type": "if", "loc": [54, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L53_C8", "vector": [4, 3, 0.7303, 0.0526, 3, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if error_sum is None:\n error_sum = np.asarray( msg.error.positions ) ** 2\n else:\n error_sum += np.asarray ( msg.error.positions ) ** 2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L55_C16", "label": "error_sum =", "type": "assigned_variable", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L54_C12", "vector": [14, 4, 0.7237, 0.0132, 4, 0.08, 0.0, 344, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "error_sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_sum = np.asarray( msg.error.positions ) ** 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L59_C8", "label": "if", "type": "if", "loc": [59, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "vector": [4, 2, 0.7961, 0.0526, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if error_sum is None:\n return None\n else:\n return np.sqrt( error_sum / num_msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Return_L60_C12", "label": "return", "type": "return", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L59_C8", "vector": [13, 3, 0.7895, 0.0132, 3, 0.64, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Return_L62_C12", "label": "return", "type": "return", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L59_C8", "vector": [13, 3, 0.8158, 0.0132, 3, 0.64, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.sqrt( error_sum / num_msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "label": "if", "type": "if", "loc": [64, 75], "level": 0, "parent": null, "vector": [4, 0, 0.9145, 0.1579, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n args = sys.argv\n args.pop(0)\n if len( args ) == 2 and args[0] == 'listen':\n RMSEListener( args[1] )\n elif len( args ) == 3 and args[0] == 'read':\n RMSEBagReader( args[1], args[2] )\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L65_C4", "label": "args =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "vector": [14, 1, 0.8553, 0.0132, 1, 0.68, 0.0, 805, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = sys.argv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L66_C4", "label": "pop()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "vector": [8, 1, 0.8684, 0.0132, 1, 0.68, 0.5, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " args.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L67_C4", "label": "if", "type": "if", "loc": [67, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "vector": [4, 1, 0.9342, 0.1184, 1, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( args ) == 2 and args[0] == 'listen':\n RMSEListener( args[1] )\n elif len( args ) == 3 and args[0] == 'read':\n RMSEBagReader( args[1], args[2] )\n else:\n print(\"Usage: rmse <subcommand> [args]\\n\")\n print(\"Available subcommands:\")\n print(\"\\tlisten [topic]\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L68_C8", "label": "RMSEListener()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L67_C4", "vector": [8, 2, 0.8947, 0.0132, 2, 0.82, 0.0, 52, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "RMSEListener", "arg_names": [], "import_names": [], "rhs_call_name": "RMSEListener", "annotation": ""}, "snippet": " RMSEListener( args[1] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "label": "if", "type": "if", "loc": [69, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L67_C4", "vector": [4, 2, 0.9474, 0.0921, 2, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len( args ) == 3 and args[0] == 'read':\n RMSEBagReader( args[1], args[2] )\n else:\n print(\"Usage: rmse <subcommand> [args]\\n\")\n print(\"Available subcommands:\")\n print(\"\\tlisten [topic]\")\n print(\"\\tread [filename] [topic]\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L70_C8", "label": "RMSEBagReader()", "type": "expression", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "vector": [8, 3, 0.9211, 0.0132, 3, 0.61, 0.0, 884, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "RMSEBagReader", "arg_names": [], "import_names": [], "rhs_call_name": "RMSEBagReader", "annotation": ""}, "snippet": " RMSEBagReader( args[1], args[2] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L72_C8", "label": "print()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "vector": [8, 3, 0.9474, 0.0132, 3, 0.61, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Usage: rmse <subcommand> [args]\\n\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L73_C8", "label": "print()", "type": "expression", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "vector": [8, 3, 0.9605, 0.0132, 3, 0.61, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Available subcommands:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L74_C8", "label": "print()", "type": "expression", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "vector": [8, 3, 0.9737, 0.0132, 3, 0.61, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"\\tlisten [topic]\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L75_C8", "label": "print()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "vector": [8, 3, 0.9868, 0.0132, 3, 0.61, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"\\tread [filename] [topic]\")"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:ClassDef_L37_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:For_L53_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Return_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Return_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99264:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99264:Expr_L75_C8"}] |
#!/usr/bin/env python
import roslib
roslib.load_manifest( 'rospy' )
import rospy
roslib.load_manifest( 'rosbag' )
import rosbag
import numpy as np
import csv
import sys
def read_file( fname, topic ):
bag = rosbag.Bag( fname )
time = rospy.Time.from_sec(0.0)
msgs = []
for topic, msg, t in bag.read_messages( topics = [topic] ):
if time > t:
print( 'ERROR messages out of order' )
return None
time = t
msgs.append( msg )
bag.close()
return np.asarray( msgs )
arm_joint_names = ['lr_shoulder_pan_joint',
'lr_shoulder_lift_joint',
'lr_upper_arm_roll_joint',
'lr_elbow_flex_joint',
'lr_forearm_roll_joint',
'lr_wrist_flex_joint',
'lr_wrist_roll_joint']
l_arm_joint_names = map(lambda s: s.replace('lr_', 'l_'), arm_joint_names )
r_arm_joint_names = map(lambda s: s.replace('lr_', 'r_'), arm_joint_names )
joint_names = [];
if len( sys.argv ) < 4:
print( 'usage:\n\t rosbagtocsv in.bag out.csv [-r] [-l] [-j joint_name]' );
sys.exit()
in_fname = sys.argv[1];
out_fname = sys.argv[2];
if sys.argv[3] == '-r':
joint_names = r_arm_joint_names
elif sys.argv[3] == '-l':
joint_names = l_arm_joint_names
elif sys.argv[3] == '-j':
joint_names.append( sys.argv[4] )
print( 'searching for %s in %s ...'%(joint_names, in_fname) )
joint_states = read_file( in_fname, '/joint_states' )
if joint_states is None or not len( joint_states ) > 0:
exit
print len( joint_states )
print joint_states[0].name
idx = map( joint_states[0].name.index, joint_names )
writer = csv.writer( open( out_fname, 'wb' ), delimiter = ',', quotechar = '|' )
print( 'writing %d rows to %s ...'%( len( joint_states ), out_fname) )
if len( joint_states ) < 1:
print('bag file doesn not contain joint_states messages.')
sys.exit(-1)
last_time = joint_states[0].header.stamp
for js in joint_states:
pos = map( lambda x: js.position[x], idx )
vel = map( lambda x: js.velocity[x], idx )
effort = map( lambda x: js.effort[x], idx )
time = (js.header.stamp - last_time).to_sec()
row = sum( [[time], pos, vel, effort], [] )
writer.writerow( row )
print( 'done!' )
| ajibawa-2023/Python-Code-Large/train/row_99265 | 56 | 84 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0119, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0476, 0.0119, 0, 0.66, 0.0357, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rospy' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Import_L5_C0", "label": "rospy import rospy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0595, 0.0119, 0, 0.66, 0.0714, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0714, 0.0119, 0, 0.66, 0.1071, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'rosbag' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Import_L7_C0", "label": "rosbag import rosbag", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0119, 0, 0.66, 0.1429, 243, 0, 1, 0, 0, 243, 0, 0], "semantic": {"name": "rosbag", "arg_names": [], "import_names": ["rosbag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosbag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0952, 0.0119, 0, 0.66, 0.1786, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Import_L9_C0", "label": "csv import csv", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1071, 0.0119, 0, 0.66, 0.2143, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.119, 0.0119, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "label": "read_file", "type": "function", "loc": [12, 23], "level": 0, "parent": null, "vector": [2, 0, 0.2083, 0.1429, 0, 0.66, 0.2857, 542, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "read_file", "arg_names": ["fname", "topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def read_file( fname, topic ):\n bag = rosbag.Bag( fname )\n time = rospy.Time.from_sec(0.0)\n msgs = []\n for topic, msg, t in bag.read_messages( topics = [topic] ):\n if time > t:\n print( 'ERROR messages out of order' )\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L13_C4", "label": "bag = Bag()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "vector": [14, 1, 0.1548, 0.0119, 1, 0.78, 0.0, 117, 3, 1, 0, 0, 568, 10, 1], "semantic": {"name": "bag", "arg_names": [], "import_names": [], "rhs_call_name": "Bag", "annotation": ""}, "snippet": " bag = rosbag.Bag( fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L14_C4", "label": "time = from_sec()", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "vector": [14, 1, 0.1667, 0.0119, 1, 0.78, 0.2, 654, 3, 1, 0, 0, 334, 10, 1], "semantic": {"name": "time", "arg_names": [], "import_names": [], "rhs_call_name": "from_sec", "annotation": ""}, "snippet": " time = rospy.Time.from_sec(0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L15_C4", "label": "msgs =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "vector": [14, 1, 0.1786, 0.0119, 1, 0.78, 0.4, 211, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "msgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msgs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "label": "for topic, msg, t", "type": "for", "loc": [16, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "vector": [6, 1, 0.2202, 0.0714, 1, 0.78, 0.6, 35, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "topic, msg, t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for topic, msg, t in bag.read_messages( topics = [topic] ):\n if time > t:\n print( 'ERROR messages out of order' )\n return None\n time = t\n msgs.append( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L17_C8", "label": "if", "type": "if", "loc": [17, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "vector": [4, 2, 0.2143, 0.0357, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time > t:\n print( 'ERROR messages out of order' )\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L18_C12", "label": "print()", "type": "expression", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L17_C8", "vector": [8, 3, 0.2143, 0.0119, 3, 0.3, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( 'ERROR messages out of order' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Return_L19_C12", "label": "return", "type": "return", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L17_C8", "vector": [13, 3, 0.2262, 0.0119, 3, 0.3, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L20_C8", "label": "time =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "vector": [14, 2, 0.2381, 0.0119, 2, 0.87, 0.5, 654, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L21_C8", "label": "append()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "vector": [8, 2, 0.25, 0.0119, 2, 0.87, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " msgs.append( msg )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L22_C4", "label": "close()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "vector": [8, 1, 0.2619, 0.0119, 1, 0.78, 0.8, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " bag.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "vector": [13, 1, 0.2738, 0.0119, 1, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.asarray( msgs )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L25_C0", "label": "arm_joint_names =", "type": "assigned_variable", "loc": [25, 31], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0833, 0, 0.66, 0.3214, 661, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "arm_joint_names = ['lr_shoulder_pan_joint',\n 'lr_shoulder_lift_joint',\n 'lr_upper_arm_roll_joint',\n 'lr_elbow_flex_joint',\n 'lr_forearm_roll_joint',\n 'lr_wrist_flex_joint',\n 'lr_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L34_C0", "label": "l_arm_joint_names = map()", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.4048, 0.0119, 0, 0.66, 0.3571, 764, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "l_arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "l_arm_joint_names = map(lambda s: s.replace('lr_', 'l_'), arm_joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L35_C0", "label": "r_arm_joint_names = map()", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.4167, 0.0119, 0, 0.66, 0.3929, 705, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "r_arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "r_arm_joint_names = map(lambda s: s.replace('lr_', 'r_'), arm_joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L37_C0", "label": "joint_names =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.4405, 0.0119, 0, 0.66, 0.4286, 393, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "joint_names = [];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L39_C0", "label": "if", "type": "if", "loc": [39, 41], "level": 0, "parent": null, "vector": [4, 0, 0.4762, 0.0357, 0, 0.66, 0.4643, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if len( sys.argv ) < 4:\n print( 'usage:\\n\\t rosbagtocsv in.bag out.csv [-r] [-l] [-j joint_name]' );\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L40_C4", "label": "print()", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L39_C0", "vector": [8, 1, 0.4762, 0.0119, 1, 0.77, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( 'usage:\\n\\t rosbagtocsv in.bag out.csv [-r] [-l] [-j joint_name]' );"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L41_C4", "label": "exit()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L39_C0", "vector": [8, 1, 0.4881, 0.0119, 1, 0.77, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L43_C0", "label": "in_fname =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.5119, 0.0119, 0, 0.66, 0.5, 734, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "in_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "in_fname = sys.argv[1];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L44_C0", "label": "out_fname =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.5238, 0.0119, 0, 0.66, 0.5357, 329, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "out_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "out_fname = sys.argv[2];"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L46_C0", "label": "if", "type": "if", "loc": [46, 51], "level": 0, "parent": null, "vector": [4, 0, 0.5774, 0.0714, 0, 0.66, 0.5714, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if sys.argv[3] == '-r':\n joint_names = r_arm_joint_names\nelif sys.argv[3] == '-l':\n joint_names = l_arm_joint_names\nelif sys.argv[3] == '-j':\n joint_names.append( sys.argv[4] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L47_C4", "label": "joint_names =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L46_C0", "vector": [14, 1, 0.5595, 0.0119, 1, 0.17, 0.0, 393, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names = r_arm_joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L48_C0", "label": "if", "type": "if", "loc": [48, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L46_C0", "vector": [4, 1, 0.5893, 0.0476, 1, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "elif sys.argv[3] == '-l':\n joint_names = l_arm_joint_names\nelif sys.argv[3] == '-j':\n joint_names.append( sys.argv[4] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L49_C4", "label": "joint_names =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L48_C0", "vector": [14, 2, 0.5833, 0.0119, 2, 0.76, 0.0, 393, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names = l_arm_joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L50_C0", "label": "if", "type": "if", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L48_C0", "vector": [4, 2, 0.6012, 0.0238, 2, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "elif sys.argv[3] == '-j':\n joint_names.append( sys.argv[4] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L51_C4", "label": "append()", "type": "expression", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L50_C0", "vector": [8, 3, 0.6071, 0.0119, 3, 0.13, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " joint_names.append( sys.argv[4] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L53_C0", "label": "print()", "type": "expression", "loc": [53, 53], "level": 0, "parent": null, "vector": [8, 0, 0.631, 0.0119, 0, 0.66, 0.6071, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print( 'searching for %s in %s ...'%(joint_names, in_fname) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L55_C0", "label": "joint_states = read_file()", "type": "assigned_variable", "loc": [55, 55], "level": 0, "parent": null, "vector": [14, 0, 0.6548, 0.0119, 0, 0.66, 0.6429, 368, 3, 2, 0, 0, 542, 10, 1], "semantic": {"name": "joint_states", "arg_names": [], "import_names": [], "rhs_call_name": "read_file", "annotation": ""}, "snippet": "joint_states = read_file( in_fname, '/joint_states' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L57_C0", "label": "if", "type": "if", "loc": [57, 58], "level": 0, "parent": null, "vector": [4, 0, 0.6845, 0.0238, 0, 0.66, 0.6786, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if joint_states is None or not len( joint_states ) > 0:\n exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L58_C4", "label": "expression", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L57_C0", "vector": [8, 1, 0.6905, 0.0119, 1, 0.63, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L60_C0", "label": "print()", "type": "expression", "loc": [60, 60], "level": 0, "parent": null, "vector": [8, 0, 0.7143, 0.0119, 0, 0.66, 0.7143, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(len( joint_states ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L61_C0", "label": "print()", "type": "expression", "loc": [61, 61], "level": 0, "parent": null, "vector": [8, 0, 0.7262, 0.0119, 0, 0.66, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(joint_states[0].name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L63_C0", "label": "idx = map()", "type": "assigned_variable", "loc": [63, 63], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0119, 0, 0.66, 0.7857, 187, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "idx = map( joint_states[0].name.index, joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L65_C0", "label": "writer = writer()", "type": "assigned_variable", "loc": [65, 65], "level": 0, "parent": null, "vector": [14, 0, 0.7738, 0.0119, 0, 0.66, 0.8214, 614, 3, 3, 0, 0, 614, 10, 2], "semantic": {"name": "writer", "arg_names": [], "import_names": [], "rhs_call_name": "writer", "annotation": ""}, "snippet": "writer = csv.writer( open( out_fname, 'wb' ), delimiter = ',', quotechar = '|' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L67_C0", "label": "print()", "type": "expression", "loc": [67, 67], "level": 0, "parent": null, "vector": [8, 0, 0.7976, 0.0119, 0, 0.66, 0.8571, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print( 'writing %d rows to %s ...'%( len( joint_states ), out_fname) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L69_C0", "label": "if", "type": "if", "loc": [69, 71], "level": 0, "parent": null, "vector": [4, 0, 0.8333, 0.0357, 0, 0.66, 0.8929, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if len( joint_states ) < 1:\n print('bag file doesn not contain joint_states messages.')\n sys.exit(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L70_C4", "label": "print()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L69_C0", "vector": [8, 1, 0.8333, 0.0119, 1, 0.63, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('bag file doesn not contain joint_states messages.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L71_C4", "label": "exit()", "type": "expression", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L69_C0", "vector": [8, 1, 0.8452, 0.0119, 1, 0.63, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L73_C0", "label": "last_time =", "type": "assigned_variable", "loc": [73, 73], "level": 0, "parent": null, "vector": [14, 0, 0.869, 0.0119, 0, 0.66, 0.9286, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "last_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "last_time = joint_states[0].header.stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "label": "for js", "type": "for", "loc": [75, 81], "level": 0, "parent": null, "vector": [6, 0, 0.9286, 0.0833, 0, 0.66, 0.9643, 62, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "js", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for js in joint_states:\n pos = map( lambda x: js.position[x], idx )\n vel = map( lambda x: js.velocity[x], idx )\n effort = map( lambda x: js.effort[x], idx )\n time = (js.header.stamp - last_time).to_sec()\n row = sum( [[time], pos, vel, effort], [] )\n writer.writerow( row )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L76_C4", "label": "pos = map()", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "vector": [14, 1, 0.9048, 0.0119, 1, 0.63, 0.0, 627, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " pos = map( lambda x: js.position[x], idx )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L77_C4", "label": "vel = map()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "vector": [14, 1, 0.9167, 0.0119, 1, 0.63, 0.2, 527, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " vel = map( lambda x: js.velocity[x], idx )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L78_C4", "label": "effort = map()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "vector": [14, 1, 0.9286, 0.0119, 1, 0.63, 0.4, 708, 3, 2, 0, 0, 53, 10, 1], "semantic": {"name": "effort", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " effort = map( lambda x: js.effort[x], idx )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L79_C4", "label": "time = to_sec()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "vector": [14, 1, 0.9405, 0.0119, 1, 0.63, 0.6, 654, 3, 0, 0, 0, 750, 10, 1], "semantic": {"name": "time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " time = (js.header.stamp - last_time).to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L80_C4", "label": "row = sum()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "vector": [14, 1, 0.9524, 0.0119, 1, 0.63, 0.8, 767, 3, 2, 0, 0, 824, 10, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " row = sum( [[time], pos, vel, effort], [] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L81_C4", "label": "writerow()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "vector": [8, 1, 0.9643, 0.0119, 1, 0.63, 1.0, 941, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "writerow", "arg_names": [], "import_names": [], "rhs_call_name": "writerow", "annotation": ""}, "snippet": " writer.writerow( row )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L83_C0", "label": "print()", "type": "expression", "loc": [83, 83], "level": 0, "parent": null, "vector": [8, 0, 0.9881, 0.0119, 0, 0.66, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print( 'done!' )"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L18_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L17_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Return_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Return_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L48_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L50_C0"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:If_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99265:For_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99265:Expr_L81_C4"}] |
#!/usr/bin/env python
from xml.dom import minidom
arm_joint_names = ['lr_shoulder_pan_joint',
'lr_shoulder_lift_joint',
'lr_upper_arm_roll_joint',
'lr_elbow_flex_joint',
'lr_forearm_roll_joint',
'lr_wrist_flex_joint',
'lr_wrist_roll_joint']
l_arm_joint_names = map(lambda s: s.replace('lr_', 'l_'), arm_joint_names )
r_arm_joint_names = map(lambda s: s.replace('lr_', 'r_'), arm_joint_names )
urdf_fname = '../config/pr2.urdf'
yaml_fname = '../config/r_arm_joint_limits.yaml'
joint_names = r_arm_joint_names
print( 'parsing %s ...'%urdf_fname )
xmldoc = minidom.parse( urdf_fname )
joint_nodes = xmldoc.getElementsByTagName('joint')
print( 'found %d joints'%len( joint_nodes ) )
print( 'writin to %s '%yaml_fname )
yaml_file = open( yaml_fname, 'w')
for node in joint_nodes:
if not node.hasAttribute( 'name' ):
continue
joint_name = node.getAttribute( 'name' )
if joint_name not in joint_names:
continue
print( 'found joint %s'%joint_name )
limit_nodes = node.getElementsByTagName( 'limit' )
if len( limit_nodes ) == 0:
print( '\t no limit tag -> ignored' )
continue
if len( limit_nodes ) > 1:
print( '\t more than one limit tag -> ignored' )
continue
effort = None
velocity = None
upper = None
lower = None
limit_node = limit_nodes[0]
if limit_node.hasAttribute( 'effort' ):
effort = limit_node.getAttribute( 'effort' )
if limit_node.hasAttribute( 'velocity' ):
velocity = limit_node.getAttribute( 'velocity' )
if limit_node.hasAttribute( 'upper' ):
upper = limit_node.getAttribute( 'upper' )
if limit_node.hasAttribute( 'lower' ):
lower = limit_node.getAttribute( 'lower' )
safety_nodes = node.getElementsByTagName( 'safety_controller' )
if len( safety_nodes ) == 0:
print( '\t no safety_controller tag -> ignored' )
continue
if len( safety_nodes ) > 1:
print( '\t more than one safety_controller tag -> ignored' )
continue
soft_lower_limit = None
soft_upper_limit = None
safety_node = safety_nodes[0]
if safety_node.hasAttribute( 'soft_upper_limit' ):
soft_upper_limit = safety_node.getAttribute( 'soft_upper_limit' )
if safety_node.hasAttribute( 'soft_lower_limit' ):
soft_lower_limit = safety_node.getAttribute( 'soft_lower_limit' )
print( '%s:\n\teffort: %s\n\tvelocity: %s\n\tupper: %s\n\tlower: %s\n\tsoft_upper: %s\n\tsoft_lower: %s'%( joint_name, effort, velocity, upper, lower, soft_upper_limit, soft_lower_limit ) )
yaml_file.write( '%s:\n'%joint_name )
if not effort is None:
yaml_file.write( ' effort: %s\n'%effort )
if not velocity is None:
yaml_file.write( ' velocity: %s\n'%velocity )
if not upper is None:
yaml_file.write( ' upper: %s\n'%upper )
if not lower is None:
yaml_file.write( ' lower: %s\n'%lower )
if not soft_upper_limit is None:
yaml_file.write( ' soft_upper_limit: %s\n'%soft_upper_limit )
if not soft_lower_limit is None:
yaml_file.write( ' soft_lower_limit: %s\n'%soft_lower_limit )
yaml_file.close()
| ajibawa-2023/Python-Code-Large/train/row_99267 | 63 | 100 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99267:ImportFrom_L3_C0", "label": "from xml.dom import minidom", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.03, 0.01, 0, 0.66, 0.0, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["minidom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom import minidom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L5_C0", "label": "arm_joint_names =", "type": "assigned_variable", "loc": [5, 11], "level": 0, "parent": null, "vector": [14, 0, 0.08, 0.07, 0, 0.66, 0.0714, 661, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "arm_joint_names = ['lr_shoulder_pan_joint',\n 'lr_shoulder_lift_joint',\n 'lr_upper_arm_roll_joint',\n 'lr_elbow_flex_joint',\n 'lr_forearm_roll_joint',\n 'lr_wrist_flex_joint',\n 'lr_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L13_C0", "label": "l_arm_joint_names = map()", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.13, 0.01, 0, 0.66, 0.1429, 764, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "l_arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "l_arm_joint_names = map(lambda s: s.replace('lr_', 'l_'), arm_joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L14_C0", "label": "r_arm_joint_names = map()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.14, 0.01, 0, 0.66, 0.2143, 705, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "r_arm_joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": "r_arm_joint_names = map(lambda s: s.replace('lr_', 'r_'), arm_joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L16_C0", "label": "urdf_fname =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.16, 0.01, 0, 0.66, 0.2857, 731, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "urdf_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "urdf_fname = '../config/pr2.urdf'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L17_C0", "label": "yaml_fname =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.17, 0.01, 0, 0.66, 0.3571, 590, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "yaml_fname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "yaml_fname = '../config/r_arm_joint_limits.yaml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L18_C0", "label": "joint_names =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.18, 0.01, 0, 0.66, 0.4286, 393, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "joint_names = r_arm_joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L20_C0", "label": "print()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.2, 0.01, 0, 0.66, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print( 'parsing %s ...'%urdf_fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L21_C0", "label": "xmldoc = parse()", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.21, 0.01, 0, 0.66, 0.5714, 833, 3, 1, 0, 0, 678, 10, 1], "semantic": {"name": "xmldoc", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": "xmldoc = minidom.parse( urdf_fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L22_C0", "label": "joint_nodes = getElementsByTagName()", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.22, 0.01, 0, 0.66, 0.6429, 639, 3, 1, 0, 0, 989, 10, 1], "semantic": {"name": "joint_nodes", "arg_names": [], "import_names": [], "rhs_call_name": "getElementsByTagName", "annotation": ""}, "snippet": "joint_nodes = xmldoc.getElementsByTagName('joint')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L23_C0", "label": "print()", "type": "expression", "loc": [23, 23], "level": 0, "parent": null, "vector": [8, 0, 0.23, 0.01, 0, 0.66, 0.7143, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print( 'found %d joints'%len( joint_nodes ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L25_C0", "label": "print()", "type": "expression", "loc": [25, 25], "level": 0, "parent": null, "vector": [8, 0, 0.25, 0.01, 0, 0.66, 0.7857, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print( 'writin to %s '%yaml_fname )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L26_C0", "label": "yaml_file = open()", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.26, 0.01, 0, 0.66, 0.8571, 561, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "yaml_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "yaml_file = open( yaml_fname, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "label": "for node", "type": "for", "loc": [28, 92], "level": 0, "parent": null, "vector": [6, 0, 0.6, 0.65, 0, 0.66, 0.9286, 772, 2, 0, 0, 0, 0, 0, 33], "semantic": {"name": "node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for node in joint_nodes:\n if not node.hasAttribute( 'name' ):\n continue\n joint_name = node.getAttribute( 'name' )\n if joint_name not in joint_names:\n continue\n print( 'found joint %s'%joint_name )\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L29_C4", "label": "if", "type": "if", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.295, 0.02, 1, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not node.hasAttribute( 'name' ):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L31_C4", "label": "joint_name = getAttribute()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.31, 0.01, 1, 0.67, 0.0323, 337, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "joint_name", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " joint_name = node.getAttribute( 'name' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L32_C4", "label": "if", "type": "if", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.325, 0.02, 1, 0.67, 0.0645, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if joint_name not in joint_names:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L34_C4", "label": "print()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [8, 1, 0.34, 0.01, 1, 0.67, 0.0968, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( 'found joint %s'%joint_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L36_C4", "label": "limit_nodes = getElementsByTagName()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.36, 0.01, 1, 0.67, 0.129, 993, 3, 1, 0, 0, 989, 10, 1], "semantic": {"name": "limit_nodes", "arg_names": [], "import_names": [], "rhs_call_name": "getElementsByTagName", "annotation": ""}, "snippet": " limit_nodes = node.getElementsByTagName( 'limit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L37_C4", "label": "if", "type": "if", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.38, 0.03, 1, 0.67, 0.1613, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( limit_nodes ) == 0:\n print( '\\t no limit tag -> ignored' )\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L38_C8", "label": "print()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L37_C4", "vector": [8, 2, 0.38, 0.01, 2, 0.22, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( '\\t no limit tag -> ignored' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L41_C4", "label": "if", "type": "if", "loc": [41, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.42, 0.03, 1, 0.67, 0.1935, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( limit_nodes ) > 1:\n print( '\\t more than one limit tag -> ignored' )\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L42_C8", "label": "print()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L41_C4", "vector": [8, 2, 0.42, 0.01, 2, 0.26, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( '\\t more than one limit tag -> ignored' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L45_C4", "label": "effort =", "type": "assigned_variable", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.45, 0.01, 1, 0.67, 0.2258, 708, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "effort", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " effort = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L46_C4", "label": "velocity =", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.46, 0.01, 1, 0.67, 0.2581, 935, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "velocity", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " velocity = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L47_C4", "label": "upper =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.47, 0.01, 1, 0.67, 0.2903, 347, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "upper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " upper = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L48_C4", "label": "lower =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.48, 0.01, 1, 0.67, 0.3226, 432, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "lower", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lower = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L50_C4", "label": "limit_node =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.5, 0.01, 1, 0.67, 0.3548, 20, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "limit_node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " limit_node = limit_nodes[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L51_C4", "label": "if", "type": "if", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.515, 0.02, 1, 0.67, 0.3871, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limit_node.hasAttribute( 'effort' ):\n effort = limit_node.getAttribute( 'effort' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L52_C8", "label": "effort = getAttribute()", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L51_C4", "vector": [14, 2, 0.52, 0.01, 2, 0.56, 0.0, 708, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "effort", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " effort = limit_node.getAttribute( 'effort' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L53_C4", "label": "if", "type": "if", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.535, 0.02, 1, 0.67, 0.4194, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limit_node.hasAttribute( 'velocity' ):\n velocity = limit_node.getAttribute( 'velocity' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L54_C8", "label": "velocity = getAttribute()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L53_C4", "vector": [14, 2, 0.54, 0.01, 2, 0.81, 0.0, 935, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "velocity", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " velocity = limit_node.getAttribute( 'velocity' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L55_C4", "label": "if", "type": "if", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.555, 0.02, 1, 0.67, 0.4516, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limit_node.hasAttribute( 'upper' ):\n upper = limit_node.getAttribute( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L56_C8", "label": "upper = getAttribute()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L55_C4", "vector": [14, 2, 0.56, 0.01, 2, 0.69, 0.0, 347, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "upper", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " upper = limit_node.getAttribute( 'upper' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L57_C4", "label": "if", "type": "if", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.575, 0.02, 1, 0.67, 0.4839, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limit_node.hasAttribute( 'lower' ):\n lower = limit_node.getAttribute( 'lower' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L58_C8", "label": "lower = getAttribute()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L57_C4", "vector": [14, 2, 0.58, 0.01, 2, 0.36, 0.0, 432, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "lower", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " lower = limit_node.getAttribute( 'lower' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L60_C4", "label": "safety_nodes = getElementsByTagName()", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.6, 0.01, 1, 0.67, 0.5161, 569, 3, 1, 0, 0, 989, 10, 1], "semantic": {"name": "safety_nodes", "arg_names": [], "import_names": [], "rhs_call_name": "getElementsByTagName", "annotation": ""}, "snippet": " safety_nodes = node.getElementsByTagName( 'safety_controller' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L61_C4", "label": "if", "type": "if", "loc": [61, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.62, 0.03, 1, 0.67, 0.5484, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( safety_nodes ) == 0:\n print( '\\t no safety_controller tag -> ignored' )\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L62_C8", "label": "print()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L61_C4", "vector": [8, 2, 0.62, 0.01, 2, 0.9, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( '\\t no safety_controller tag -> ignored' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L65_C4", "label": "if", "type": "if", "loc": [65, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.66, 0.03, 1, 0.67, 0.5806, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len( safety_nodes ) > 1:\n print( '\\t more than one safety_controller tag -> ignored' )\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L66_C8", "label": "print()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L65_C4", "vector": [8, 2, 0.66, 0.01, 2, 0.36, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( '\\t more than one safety_controller tag -> ignored' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L69_C4", "label": "soft_lower_limit =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.69, 0.01, 1, 0.67, 0.6129, 170, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "soft_lower_limit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " soft_lower_limit = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L70_C4", "label": "soft_upper_limit =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.7, 0.01, 1, 0.67, 0.6452, 621, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "soft_upper_limit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " soft_upper_limit = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L72_C4", "label": "safety_node =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [14, 1, 0.72, 0.01, 1, 0.67, 0.6774, 423, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "safety_node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " safety_node = safety_nodes[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L73_C4", "label": "if", "type": "if", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.735, 0.02, 1, 0.67, 0.7097, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if safety_node.hasAttribute( 'soft_upper_limit' ):\n soft_upper_limit = safety_node.getAttribute( 'soft_upper_limit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L74_C8", "label": "soft_upper_limit = getAttribute()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L73_C4", "vector": [14, 2, 0.74, 0.01, 2, 0.02, 0.0, 621, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "soft_upper_limit", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " soft_upper_limit = safety_node.getAttribute( 'soft_upper_limit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L75_C4", "label": "if", "type": "if", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.755, 0.02, 1, 0.67, 0.7419, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if safety_node.hasAttribute( 'soft_lower_limit' ):\n soft_lower_limit = safety_node.getAttribute( 'soft_lower_limit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L76_C8", "label": "soft_lower_limit = getAttribute()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L75_C4", "vector": [14, 2, 0.76, 0.01, 2, 0.26, 0.0, 170, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "soft_lower_limit", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " soft_lower_limit = safety_node.getAttribute( 'soft_lower_limit' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L78_C4", "label": "print()", "type": "expression", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [8, 1, 0.78, 0.01, 1, 0.67, 0.7742, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print( '%s:\\n\\teffort: %s\\n\\tvelocity: %s\\n\\tupper: %s\\n\\tlower: %s\\n\\tsoft_upper: %s\\n\\tsoft_lower: %s'%( joint_name, effort, velocity, upper, lower, soft_upper_limit, soft_lower_limit ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L80_C4", "label": "write()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [8, 1, 0.8, 0.01, 1, 0.67, 0.8065, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( '%s:\\n'%joint_name )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L81_C4", "label": "if", "type": "if", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.815, 0.02, 1, 0.67, 0.8387, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not effort is None:\n yaml_file.write( ' effort: %s\\n'%effort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L82_C8", "label": "write()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L81_C4", "vector": [8, 2, 0.82, 0.01, 2, 0.98, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( ' effort: %s\\n'%effort )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L83_C4", "label": "if", "type": "if", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.835, 0.02, 1, 0.67, 0.871, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not velocity is None:\n yaml_file.write( ' velocity: %s\\n'%velocity )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L84_C8", "label": "write()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L83_C4", "vector": [8, 2, 0.84, 0.01, 2, 0.07, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( ' velocity: %s\\n'%velocity )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L85_C4", "label": "if", "type": "if", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.855, 0.02, 1, 0.67, 0.9032, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not upper is None:\n yaml_file.write( ' upper: %s\\n'%upper )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L86_C8", "label": "write()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L85_C4", "vector": [8, 2, 0.86, 0.01, 2, 0.94, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( ' upper: %s\\n'%upper )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L87_C4", "label": "if", "type": "if", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.875, 0.02, 1, 0.67, 0.9355, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not lower is None:\n yaml_file.write( ' lower: %s\\n'%lower )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L88_C8", "label": "write()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L87_C4", "vector": [8, 2, 0.88, 0.01, 2, 0.36, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( ' lower: %s\\n'%lower )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L89_C4", "label": "if", "type": "if", "loc": [89, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.895, 0.02, 1, 0.67, 0.9677, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not soft_upper_limit is None:\n yaml_file.write( ' soft_upper_limit: %s\\n'%soft_upper_limit )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L90_C8", "label": "write()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L89_C4", "vector": [8, 2, 0.9, 0.01, 2, 0.0, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( ' soft_upper_limit: %s\\n'%soft_upper_limit )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L91_C4", "label": "if", "type": "if", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "vector": [4, 1, 0.915, 0.02, 1, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not soft_lower_limit is None:\n yaml_file.write( ' soft_lower_limit: %s\\n'%soft_lower_limit )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L92_C8", "label": "write()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L91_C4", "vector": [8, 2, 0.92, 0.01, 2, 0.7, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " yaml_file.write( ' soft_lower_limit: %s\\n'%soft_lower_limit )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L94_C0", "label": "close()", "type": "expression", "loc": [94, 94], "level": 0, "parent": null, "vector": [8, 0, 0.94, 0.01, 0, 0.66, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "yaml_file.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:For_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99267:If_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99267:Expr_L92_C8"}] |
#!/usr/bin/env python
import dynamics_utils as dynutils
(name, time, pos, vel, acc) = dynutils.load_motion_ascii("/u/dhennes/Desktop/reaching.txt")
dynutils.save_motion("../motions/reaching.pkl", name, time, pos, vel, acc)
| ajibawa-2023/Python-Code-Large/train/row_99268 | 3 | 7 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99268:Import_L3_C0", "label": "dynamics_utils import dynutils", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.4286, 0.1429, 0, 0.66, 0.0, 318, 0, 1, 0, 0, 318, 0, 0], "semantic": {"name": "dynamics_utils", "arg_names": [], "import_names": ["dynutils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamics_utils as dynutils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99268:Assign_L6_C0", "label": "name, time, pos, vel, acc = load_motion_ascii()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.8571, 0.1429, 0, 0.66, 0.5, 700, 3, 1, 0, 0, 301, 10, 1], "semantic": {"name": "name, time, pos, vel, acc", "arg_names": [], "import_names": [], "rhs_call_name": "load_motion_ascii", "annotation": ""}, "snippet": "(name, time, pos, vel, acc) = dynutils.load_motion_ascii(\"/u/dhennes/Desktop/reaching.txt\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99268:Expr_L7_C0", "label": "save_motion()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.1429, 0, 0.66, 1.0, 579, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "save_motion", "arg_names": [], "import_names": [], "rhs_call_name": "save_motion", "annotation": ""}, "snippet": "dynutils.save_motion(\"../motions/reaching.pkl\", name, time, pos, vel, acc)"}] | [] |
#!/usr/bin/python
from scipy import pi, sin, cos, array, asarray, linspace, zeros, ones, sqrt
import matplotlib.pyplot as plt
import roslib
roslib.load_manifest( 'pr2_controllers_msgs' )
roslib.load_manifest( 'trajectory_msgs' )
roslib.load_manifest( 'actionlib' )
import rospy
from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
import actionlib
def main():
joint_names = ['l_shoulder_pan_joint',
'l_shoulder_lift_joint',
'l_upper_arm_roll_joint',
'l_elbow_flex_joint',
'l_forearm_roll_joint',
'l_wrist_flex_joint',
'l_wrist_roll_joint']
N = len( joint_names )
# lower_limit = asarray( [-2.13, -0.35, -3.75, -2.32, -2.0 * pi, -2.09, -2.0 * pi ] )
# upper_limit = asarray( [ 0.56,
# 0.8, #1.29,
# 0.65, 0.0, 2.0 * pi, 0.0, 2.0 * pi ] )
lower_limit = asarray( [2.13,
-0.35,
-0.5, #3.75,
-2.0, #-2.32,
-2.0 * pi,
-2.09,
-2.0 * pi ] )
upper_limit = asarray( [-0.56,
0.6, #1.29,
2, #0.65,
0.0,
2.0 * pi,
0.0,
2.0 * pi ] )
A = (lower_limit - upper_limit) * 1/4
f = 0.1
f1 = asarray([f * sqrt(2),
f * sqrt(2),
f * sqrt(2),
f * sqrt(9),
f * sqrt(7),
f * sqrt(1),
f * sqrt(7)])
f2 = asarray([0.4,
0.4,
0.6,
0.9,
1.1,
0.3,
0.9])
start_time = 0.0
dt = 0.001
max_time = 60.0
t = linspace( 0.0, max_time - dt, int( max_time / dt ) )
q = zeros( (N, len( t )))
dq = zeros( (N, len( t )))
ddq = zeros( (N, len( t )))
# start_pos = [ 0, 0, 0, 0, 0, 0, 0 ]
# joint = 2;
for i in range(N):
#if i == joint:
q[i,:] = A[i] * sin( 2.0 * pi * f1[i] * t ) \
+ A[i]/3.0 * sin( 2.0 * pi * f2[i] * t ) + ( upper_limit[i] + lower_limit[i]) / 2.0
dq[i,:] = 2.0 * pi * f1[i] * A[i] * cos( 2.0 * pi * f1[i] * t ) \
+ 2.0/3.0 * pi * f2[i] * A[i] * cos( 2.0 * pi * f2[i] * t )
ddq[i,:] = - 4.0 * pi ** 2 * f1[i] ** 2 * A[i] * sin( 2.0 * pi * f1[i] * t ) \
- 4.0/3.0 * pi ** 2 * f2[i] ** 2 * A[i] * sin( 2.0 * pi * f2[i] * t )
#else:
# q[i,:] = ones( (1, len( t )) ) * start_pos[i]
# plt.subplot( 3, 1, 1);
# plt.plot( q[joint,:] )
# plt.subplot( 3, 1, 2);
# plt.plot( dq[joint,:] )
# plt.subplot( 3, 1, 3);
# plt.plot( ddq[joint,:] )
# plt.show()
rospy.init_node( 'gpr_controller_trajectory_generator' )
client = actionlib.SimpleActionClient( 'l_arm_controller/joint_trajectory_action',
JointTrajectoryAction )
client.wait_for_server()
jt = JointTrajectory()
jt.joint_names = joint_names
jt.points = []
# start at neutral position
jp = JointTrajectoryPoint()
jp.time_from_start = rospy.Time.from_seconds( start_time )
jp.positions = q[:,0]
jp.velocities = [0] * len( joint_names )
jp.accelerations = [0] * len( joint_names )
jt.points.append( jp )
# add precomputed trajectory
for i in range( len( t ) ):
jp = JointTrajectoryPoint()
jp.time_from_start = rospy.Time.from_seconds( t[i] + start_time )
jp.positions = q[:,i]
jp.velocities = dq[:,i]
jp.accelerations = ddq[:,i]
jt.points.append( jp )
# push trajectory goal to ActionServer
goal = JointTrajectoryGoal()
goal.trajectory = jt
goal.trajectory.header.stamp = rospy.Time.now() + rospy.Duration(4.0)
client.send_goal(goal)
client.wait_for_result()
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99270 | 56 | 136 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99270:ImportFrom_L3_C0", "label": "from scipy import pi, sin, cos\u2026", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0221, 0.0074, 0, 0.66, 0.0, 265, 0, 9, 0, 0, 265, 0, 0], "semantic": {"name": "scipy", "arg_names": [], "import_names": ["pi", "sin", "cos", "array", "asarray", "linspace", "zeros", "ones", "sqrt"], "rhs_call_name": "", "annotation": ""}, "snippet": "from scipy import pi, sin, cos, array, asarray, linspace, zeros, ones, sqrt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Import_L4_C0", "label": "matplotlib.pyplot import plt", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0074, 0, 0.66, 0.0909, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "matplotlib.pyplot", "arg_names": [], "import_names": ["plt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import matplotlib.pyplot as plt "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0074, 0, 0.66, 0.1818, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0515, 0.0074, 0, 0.66, 0.2727, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'pr2_controllers_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0074, 0, 0.66, 0.3636, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'trajectory_msgs' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0662, 0.0074, 0, 0.66, 0.4545, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest( 'actionlib' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0735, 0.0074, 0, 0.66, 0.5455, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:ImportFrom_L11_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0809, 0.0074, 0, 0.66, 0.6364, 457, 0, 2, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:ImportFrom_L12_C0", "label": "from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0074, 0, 0.66, 0.7273, 485, 0, 2, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectory", "JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Import_L13_C0", "label": "actionlib import actionlib", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0956, 0.0074, 0, 0.66, 0.8182, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "label": "main", "type": "function", "loc": [16, 132], "level": 0, "parent": null, "vector": [2, 0, 0.5441, 0.8603, 0, 0.66, 0.9091, 624, 0, 0, 0, 0, 0, 0, 46], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n joint_names = ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint',\n 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint',\n 'l_forearm_roll_joint',\n 'l_wrist_flex_joint',\n 'l_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L17_C4", "label": "joint_names =", "type": "assigned_variable", "loc": [17, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.1471, 0.0515, 1, 0.35, 0.0, 393, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " joint_names = ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint',\n 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint',\n 'l_forearm_roll_joint',\n 'l_wrist_flex_joint',\n 'l_wrist_roll_joint']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L25_C4", "label": "N = len()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.1838, 0.0074, 1, 0.35, 0.0303, 644, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "N", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " N = len( joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L32_C4", "label": "lower_limit = asarray()", "type": "assigned_variable", "loc": [32, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.2574, 0.0515, 1, 0.35, 0.0606, 445, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "lower_limit", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " lower_limit = asarray( [2.13,\n -0.35,\n -0.5, #3.75,\n -2.0, #-2.32,\n -2.0 * pi,\n -2.09,\n -2.0 * pi ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L39_C4", "label": "upper_limit = asarray()", "type": "assigned_variable", "loc": [39, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.3088, 0.0515, 1, 0.35, 0.0909, 119, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "upper_limit", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " upper_limit = asarray( [-0.56, \n 0.6, #1.29, \n 2, #0.65,\n 0.0,\n 2.0 * pi,\n 0.0,\n 2.0 * pi ] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L47_C4", "label": "A =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.3456, 0.0074, 1, 0.35, 0.1212, 429, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "A", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " A = (lower_limit - upper_limit) * 1/4 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L49_C4", "label": "f =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.3603, 0.0074, 1, 0.35, 0.1515, 899, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L51_C4", "label": "f1 = asarray()", "type": "assigned_variable", "loc": [51, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.3971, 0.0515, 1, 0.35, 0.1818, 282, 3, 1, 0, 0, 43, 10, 8], "semantic": {"name": "f1", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " f1 = asarray([f * sqrt(2), \n f * sqrt(2), \n f * sqrt(2), \n f * sqrt(9), \n f * sqrt(7),\n f * sqrt(1),\n f * sqrt(7)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L59_C4", "label": "f2 = asarray()", "type": "assigned_variable", "loc": [59, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.4559, 0.0515, 1, 0.35, 0.2121, 833, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "f2", "arg_names": [], "import_names": [], "rhs_call_name": "asarray", "annotation": ""}, "snippet": " f2 = asarray([0.4, \n 0.4, \n 0.6, \n 0.9, \n 1.1, \n 0.3, \n 0.9])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L67_C4", "label": "start_time =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.4926, 0.0074, 1, 0.35, 0.2424, 511, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start_time = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L68_C4", "label": "dt =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.5, 0.0074, 1, 0.35, 0.2727, 455, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "dt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dt = 0.001"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L69_C4", "label": "max_time =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.5074, 0.0074, 1, 0.35, 0.303, 334, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "max_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_time = 60.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L70_C4", "label": "t = linspace()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.5147, 0.0074, 1, 0.35, 0.3333, 15, 3, 3, 0, 0, 119, 10, 2], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " t = linspace( 0.0, max_time - dt, int( max_time / dt ) )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L72_C4", "label": "q = zeros()", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.5294, 0.0074, 1, 0.35, 0.3636, 516, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " q = zeros( (N, len( t )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L73_C4", "label": "dq = zeros()", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.5368, 0.0074, 1, 0.35, 0.3939, 387, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "dq", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " dq = zeros( (N, len( t )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L74_C4", "label": "ddq = zeros()", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.5441, 0.0074, 1, 0.35, 0.4242, 812, 3, 1, 0, 0, 213, 10, 2], "semantic": {"name": "ddq", "arg_names": [], "import_names": [], "rhs_call_name": "zeros", "annotation": ""}, "snippet": " ddq = zeros( (N, len( t )))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "label": "for i", "type": "for", "loc": [79, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [6, 1, 0.6066, 0.0588, 1, 0.35, 0.4545, 826, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(N):\n #if i == joint:\n q[i,:] = A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n + A[i]/3.0 * sin( 2.0 * pi * f2[i] * t ) + ( upper_limit[i] + lower_limit[i]) / 2.0\n dq[i,:] = 2.0 * pi * f1[i] * A[i] * cos( 2.0 * pi * f1[i] * t ) \\\n + 2.0/3.0 * pi * f2[i] * A[i] * cos( 2.0 * pi * f2[i] * t )\n ddq[i,:] = - 4.0 * pi ** 2 * f1[i] ** 2 * A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n - 4.0/3.0 * pi ** 2 * f2[i] ** 2 * A[i] * sin( 2.0 * pi * f2[i] * t )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L81_C12", "label": "assign", "type": "assigned_variable", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "vector": [14, 2, 0.5993, 0.0147, 2, 0.97, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q[i,:] = A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n + A[i]/3.0 * sin( 2.0 * pi * f2[i] * t ) + ( upper_limit[i] + lower_limit[i]) / 2.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L83_C12", "label": "assign", "type": "assigned_variable", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "vector": [14, 2, 0.614, 0.0147, 2, 0.97, 0.5, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dq[i,:] = 2.0 * pi * f1[i] * A[i] * cos( 2.0 * pi * f1[i] * t ) \\\n + 2.0/3.0 * pi * f2[i] * A[i] * cos( 2.0 * pi * f2[i] * t )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L85_C12", "label": "assign", "type": "assigned_variable", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "vector": [14, 2, 0.6287, 0.0147, 2, 0.97, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ddq[i,:] = - 4.0 * pi ** 2 * f1[i] ** 2 * A[i] * sin( 2.0 * pi * f1[i] * t ) \\\n - 4.0/3.0 * pi ** 2 * f2[i] ** 2 * A[i] * sin( 2.0 * pi * f2[i] * t )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L99_C4", "label": "init_node()", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [8, 1, 0.7279, 0.0074, 1, 0.35, 0.4848, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node( 'gpr_controller_trajectory_generator' )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L102_C4", "label": "client = SimpleActionClient()", "type": "assigned_variable", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.7537, 0.0147, 1, 0.35, 0.5152, 608, 3, 2, 0, 0, 230, 10, 1], "semantic": {"name": "client", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleActionClient", "annotation": ""}, "snippet": " client = actionlib.SimpleActionClient( 'l_arm_controller/joint_trajectory_action', \n JointTrajectoryAction )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L104_C4", "label": "wait_for_server()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [8, 1, 0.7647, 0.0074, 1, 0.35, 0.5455, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " client.wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L106_C4", "label": "jt = JointTrajectory()", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.7794, 0.0074, 1, 0.35, 0.5758, 61, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jt", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectory", "annotation": ""}, "snippet": " jt = JointTrajectory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L107_C4", "label": "jt.joint_names =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.7868, 0.0074, 1, 0.35, 0.6061, 350, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jt.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.joint_names = joint_names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L108_C4", "label": "jt.points =", "type": "assigned_variable", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.7941, 0.0074, 1, 0.35, 0.6364, 737, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "jt.points", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jt.points = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L111_C4", "label": "jp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.8162, 0.0074, 1, 0.35, 0.6667, 507, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L112_C4", "label": "jp.time_from_start = from_seconds()", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.8235, 0.0074, 1, 0.35, 0.697, 186, 3, 1, 0, 0, 866, 10, 1], "semantic": {"name": "jp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "from_seconds", "annotation": ""}, "snippet": " jp.time_from_start = rospy.Time.from_seconds( start_time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L113_C4", "label": "jp.positions =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.8309, 0.0074, 1, 0.35, 0.7273, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.positions = q[:,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L114_C4", "label": "jp.velocities =", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.8382, 0.0074, 1, 0.35, 0.7576, 907, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "jp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.velocities = [0] * len( joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L115_C4", "label": "jp.accelerations =", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.8456, 0.0074, 1, 0.35, 0.7879, 836, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "jp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.accelerations = [0] * len( joint_names )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L116_C4", "label": "append()", "type": "expression", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [8, 1, 0.8529, 0.0074, 1, 0.35, 0.8182, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "label": "for i", "type": "for", "loc": [119, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [6, 1, 0.8971, 0.0515, 1, 0.35, 0.8485, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range( len( t ) ):\n jp = JointTrajectoryPoint()\n jp.time_from_start = rospy.Time.from_seconds( t[i] + start_time )\n jp.positions = q[:,i]\n jp.velocities = dq[:,i]\n jp.accelerations = ddq[:,i]\n jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L120_C8", "label": "jp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "vector": [14, 2, 0.8824, 0.0074, 2, 0.44, 0.0, 507, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L121_C8", "label": "jp.time_from_start = from_seconds()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "vector": [14, 2, 0.8897, 0.0074, 2, 0.44, 0.2, 186, 3, 1, 0, 0, 866, 10, 1], "semantic": {"name": "jp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "from_seconds", "annotation": ""}, "snippet": " jp.time_from_start = rospy.Time.from_seconds( t[i] + start_time )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L122_C8", "label": "jp.positions =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "vector": [14, 2, 0.8971, 0.0074, 2, 0.44, 0.4, 297, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.positions = q[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L123_C8", "label": "jp.velocities =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "vector": [14, 2, 0.9044, 0.0074, 2, 0.44, 0.6, 907, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.velocities = dq[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L124_C8", "label": "jp.accelerations =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "vector": [14, 2, 0.9118, 0.0074, 2, 0.44, 0.8, 836, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jp.accelerations = ddq[:,i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L125_C8", "label": "append()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "vector": [8, 2, 0.9191, 0.0074, 2, 0.44, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jt.points.append( jp )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L128_C4", "label": "goal = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.9412, 0.0074, 1, 0.35, 0.8788, 914, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "goal", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " goal = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L129_C4", "label": "goal.trajectory =", "type": "assigned_variable", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.9485, 0.0074, 1, 0.35, 0.9091, 772, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "goal.trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.trajectory = jt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L130_C4", "label": "goal.trajectory.header.stamp =", "type": "assigned_variable", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [14, 1, 0.9559, 0.0074, 1, 0.35, 0.9394, 841, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "goal.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " goal.trajectory.header.stamp = rospy.Time.now() + rospy.Duration(4.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L131_C4", "label": "send_goal()", "type": "expression", "loc": [131, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [8, 1, 0.9632, 0.0074, 1, 0.35, 0.9697, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " client.send_goal(goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L132_C4", "label": "wait_for_result()", "type": "expression", "loc": [132, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "vector": [8, 1, 0.9706, 0.0074, 1, 0.35, 1.0, 328, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_result", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_result", "annotation": ""}, "snippet": " client.wait_for_result()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:If_L135_C0", "label": "if", "type": "if", "loc": [135, 136], "level": 0, "parent": null, "vector": [4, 0, 0.9963, 0.0147, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L136_C4", "label": "main()", "type": "expression", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99270:If_L135_C0", "vector": [8, 1, 1.0, 0.0074, 1, 0.81, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:For_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:FunctionDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99270:If_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99270:Expr_L136_C4"}] |
#!/usr/bin/env python
import roslib
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'kinematics_msgs' )
roslib.load_manifest( 'geometry_msgs' )
import rospy
from kinematics_msgs.srv import \
GetPositionIK, GetPositionIKRequest
from geometry_msgs.msg import \
Pose, Point, Quaternion
import numpy as np
import dynamics_utils as dynutils
#-------------------------------------------------------------------------------
# Main
#-------------------------------------------------------------------------------
if __name__== '__main__':
node_name = "wave_arm"
rospy.loginfo( 'register node %s ...'%node_name )
rospy.init_node( node_name )
rospy.loginfo( 'node %s up and running!'%node_name )
joint_names = dynutils.get_joint_names( 'l_arm_controller' )
ik_service_name = 'pr2_left_arm_kinematics/get_ik'
rospy.loginfo( 'wait for service %s ...'%ik_service_name )
rospy.wait_for_service( ik_service_name )
ik_service = rospy.ServiceProxy( ik_service_name, GetPositionIK )
rospy.loginfo( 'ik service %s is up and running!'%ik_service_name )
# trajectory in cartesian space
time = 10.0; # trajectory time in sec
n = int(time * 200)
dt = time / n;
alphas = np.linspace( 0, 2 * np.pi, n + 1 )
alphas = alphas[0:-1]
ys = np.cos( alphas ) * 0.4
zs = -np.sin( 2 * alphas ) * 0.2
# creating trajectory in joint space
rospy.loginfo( 'creating trajectory ...' )
trajectory = []
req = GetPositionIKRequest()
req.timeout = rospy.Duration(5.0)
req.ik_request.ik_link_name = "l_wrist_roll_link"
req.ik_request.pose_stamped.header.frame_id = "torso_lift_link"
req.ik_request.ik_seed_state.joint_state.name = joint_names
req.ik_request.ik_seed_state.joint_state.position = [0.61309537, 0.45494851, 0.03, -1.03480809, 2.23232079, -0.79696399, -2.44271129]
joint_positions = []
for (y, z) in zip( ys, zs ):
pose = Pose( position = Point( 0.6, 0.20 + y, 0.0 + z ),
orientation = Quaternion( 0.0, 0.0, 0.0, 1.0 ) )
req.ik_request.pose_stamped.pose = pose
# make the call
try:
# print "send request :" #, req
res = ik_service( req )
if res.error_code.val == res.error_code.SUCCESS:
joint_positions = np.asarray( res.solution.joint_state.position )
else:
print "IK failed, error code : ", res.error_code.val
break
except rospy.ServiceException, e:
print "service call failed: %s"%e
break
trajectory.append( joint_positions )
req.ik_request.ik_seed_state.joint_state.position = joint_positions
rospy.loginfo( 'done!' )
pos = np.asarray( trajectory )
dynutils.wrap_trajectory( pos )
vel = dynutils.compute_derivative( pos, dt )
acc = dynutils.compute_derivative( vel, dt )
# plt.plot( acc )
# plt.show()
# move_arms to neutral positions
dynutils.move_arm( [ -np.pi / 3,
np.pi / 3,
0,
-3 * np.pi/4,
0,
0,
0], arm = 'r' )
l_jt_client = dynutils.init_jt_client(arm = 'l')
dynutils.move_arm( pos[0,:],
time_from_start = 5.0,
client = l_jt_client ) # left arm goes to first pos of trajectory
# loop
last_call = rospy.Time().now() + rospy.Duration().from_sec( .5 );
dynutils.track_trajectory(pos, vel, acc, dt, arm = 'l', client = l_jt_client, stamp = last_call )
while ( not rospy.is_shutdown() ):
dur = rospy.Time().now() - last_call;
if ( dur.to_sec() > time - (time / 2.0) ):
last_call += rospy.Duration().from_sec( time );
dynutils.track_trajectory(pos, vel, acc, dt, arm = 'l', client = l_jt_client, stamp = last_call )
| ajibawa-2023/Python-Code-Large/train/row_99271 | 6 | 10 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99271:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99271:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99271:ImportFrom_L3_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest", "type": "import", "loc": [3, 4], "level": 0, "parent": null, "vector": [1, 0, 0.35, 0.2, 0, 0.66, 0.4, 247, 0, 2, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import \\\n GetPositionIK, GetPositionIKRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99271:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Pose, Point, Quaternion", "type": "import", "loc": [5, 6], "level": 0, "parent": null, "vector": [1, 0, 0.55, 0.2, 0, 0.66, 0.6, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose", "Point", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import \\\n Pose, Point, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99271:Import_L8_C0", "label": "numpy import np", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.8, 0.1, 0, 0.66, 0.8, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99271:Import_L9_C0", "label": "dynamics_utils import dynutils", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.9, 0.1, 0, 0.66, 1.0, 318, 0, 1, 0, 0, 318, 0, 0], "semantic": {"name": "dynamics_utils", "arg_names": [], "import_names": ["dynutils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamics_utils as dynutils"}] | [] |
#!/usr/bin/env python
import roslib
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'rospy' )
roslib.load_manifest( 'kinematics_msgs' )
roslib.load_manifest( 'geometry_msgs' )
import rospy
from kinematics_msgs.srv import \
GetPositionIK, GetPositionIKRequest
from geometry_msgs.msg import \
Pose, Point, Quaternion
import numpy as np
import dynamics_utils as dynutils
if __name__== '__main__':
node_name = "figure_8"
rospy.loginfo( 'register node %s ...'%node_name )
rospy.init_node( node_name )
rospy.loginfo( 'node %s up and running!'%node_name )
joint_names = dynutils.get_joint_names( 'l_arm_controller' )
ik_service_name = 'pr2_left_arm_kinematics/get_ik'
rospy.loginfo( 'wait for service %s ...'%ik_service_name )
rospy.wait_for_service( ik_service_name )
ik_service = rospy.ServiceProxy( ik_service_name, GetPositionIK )
rospy.loginfo( 'ik service %s is up and running!'%ik_service_name )
# trajectory in cartesian space
time = 10.0; # trajectory time in sec
n = int(time * 200)
dt = time / n;
alphas = np.linspace( 0, 2 * np.pi, n + 1 )
alphas = alphas[0:-1]
ys = np.cos( alphas ) * 0.4
zs = -np.sin( 2 * alphas ) * 0.2
# creating trajectory in joint space
rospy.loginfo( 'creating trajectory ...' )
trajectory = []
req = GetPositionIKRequest()
req.timeout = rospy.Duration(5.0)
req.ik_request.ik_link_name = "l_wrist_roll_link"
req.ik_request.pose_stamped.header.frame_id = "torso_lift_link"
req.ik_request.ik_seed_state.joint_state.name = joint_names
req.ik_request.ik_seed_state.joint_state.position = [0.61309537, 0.45494851, 0.03, -1.03480809, 2.23232079, -0.79696399, -2.44271129]
joint_positions = []
for (y, z) in zip( ys, zs ):
pose = Pose( position = Point( 0.6, 0.20 + y, 0.0 + z ),
orientation = Quaternion( 0.0, 0.0, 0.0, 1.0 ) )
req.ik_request.pose_stamped.pose = pose
# make the call
try:
# print "send request :" #, req
res = ik_service( req )
if res.error_code.val == res.error_code.SUCCESS:
joint_positions = np.asarray( res.solution.joint_state.position )
else:
print "IK failed, error code : ", res.error_code.val
break
except rospy.ServiceException, e:
print "service call failed: %s"%e
break
trajectory.append( joint_positions )
req.ik_request.ik_seed_state.joint_state.position = joint_positions
rospy.loginfo( 'done!' )
t = np.cumsum( [dt] * n ) - dt
pos = np.asarray( trajectory )
dynutils.wrap_trajectory( pos )
vel = dynutils.compute_derivative( pos, dt )
acc = dynutils.compute_derivative( vel, dt )
dynutils.save_motion( 'figure8.pkl', 'figure8', t, pos, vel, acc )
| ajibawa-2023/Python-Code-Large/train/row_99273 | 6 | 12 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99273:Import_L1_C0", "label": "roslib import roslib", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0833, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99273:Import_L2_C0", "label": "rospy import rospy", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0833, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99273:ImportFrom_L3_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest", "type": "import", "loc": [3, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2917, 0.1667, 0, 0.66, 0.4, 247, 0, 2, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import \\\n GetPositionIK, GetPositionIKRequest"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99273:ImportFrom_L5_C0", "label": "from geometry_msgs.msg import Pose, Point, Quaternion", "type": "import", "loc": [5, 6], "level": 0, "parent": null, "vector": [1, 0, 0.4583, 0.1667, 0, 0.66, 0.6, 951, 0, 3, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Pose", "Point", "Quaternion"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import \\\n Pose, Point, Quaternion"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99273:Import_L10_C0", "label": "numpy import np", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.8333, 0.0833, 0, 0.66, 0.8, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99273:Import_L11_C0", "label": "dynamics_utils import dynutils", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.9167, 0.0833, 0, 0.66, 1.0, 318, 0, 1, 0, 0, 318, 0, 0], "semantic": {"name": "dynamics_utils", "arg_names": [], "import_names": ["dynutils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import dynamics_utils as dynutils"}] | [] |
#! /usr/bin/python
import numpy as np
import sys
from collections import deque
import roslib
roslib.load_manifest('hrl_pr2_arms')
roslib.load_manifest('ar_pose')
roslib.load_manifest('visualization_msgs')
roslib.load_manifest('pykdl_utils')
import rospy
import tf.transformations as tf_trans
from geometry_msgs.msg import Twist
from std_msgs.msg import Float32MultiArray
from visualization_msgs.msg import Marker
from std_msgs.msg import ColorRGBA
from hrl_generic_arms.pose_converter import PoseConverter
from hrl_generic_arms.controllers import PIDController
from pykdl_utils.pr2_kin import kin_from_param
from ar_pose.msg import ARMarker
class ServoKalmanFilter(object):
# TODO tune these parameters properly
def __init__(self, delta_t, sigma_z=0.02*0.001, P_init=[0.0, 0.0], sigma_a=0.02):
self.P_init = P_init
self.delta_t = delta_t
self.F = np.mat([[1, delta_t], [0, 1]])
self.Q = np.mat([[delta_t**4/4, delta_t**3/2], [delta_t**3/2, delta_t**2]]) * sigma_a**2
self.H = np.mat([1, 0])
self.R = np.mat([sigma_z])
self.x_cur = None
self.resid_q_len = int(1./delta_t)
self.resid_sigma_reject = 3.
self.min_reject = 0.1
self.resid_queue = deque()
self.unreli_q_len = 1 * int(1./delta_t)
self.unreli_queue = deque()
self.unreli_weights = np.linspace(2, 0, self.unreli_q_len)
def update(self, z_obs, new_obs=True):
is_unreli = False
if new_obs:
if self.x_cur is None:
self.x_cur = np.mat([z_obs, 0]).T
self.P_cur = np.mat(np.diag(self.P_init))
# predict
x_pred = self.F * self.x_cur # predicted state
P_pred = self.F * self.P_cur * self.F.T + self.Q # predicted covariance
# update
y_resi = z_obs - self.H * x_pred # measurement residual
S_resi = self.H * P_pred * self.H.T + self.R # residual covariance
K_gain = P_pred * self.H.T * S_resi**-1 # Kalman gain
# check residual to be consistent with recent residuals
if (len(self.resid_queue) == self.resid_q_len and
np.fabs(y_resi) > max(self.min_reject,
self.resid_sigma_reject * np.std(self.resid_queue))):
# we have determined this observation to be unreliable
print "INCONSISTENT", self.resid_queue
is_unreli = True
else:
self.x_cur = x_pred + K_gain * y_resi # update state estimate
self.P_cur = (np.mat(np.eye(2)) - K_gain * self.H) * P_pred
# record residual
if len(self.resid_queue) == self.resid_q_len:
self.resid_queue.popleft()
self.resid_queue.append(y_resi)
else:
print "NOT NEW"
is_unreli = True
# record is_unreli
if len(self.unreli_queue) == self.unreli_q_len:
self.unreli_queue.popleft()
self.unreli_queue.append(is_unreli)
# find the unreli level
# this value [0, 1] is a record of the values which have been determined to be unreli
# in the pase few seconds filtered with linear weights
# a value of 0 means there are no unreliable estimates,
# 1 means there is no reliable state estimate
if len(self.unreli_queue) == self.unreli_q_len:
unreli_level = np.sum(self.unreli_weights * self.unreli_queue) / self.unreli_q_len
else:
unreli_level = 0.
return self.x_cur, self.P_cur, unreli_level
def homo_mat_from_2d(x, y, rot):
mat2d = np.mat(tf_trans.euler_matrix(0, 0, rot))
mat2d[0,3] = x
mat2d[1,3] = y
return mat2d
def homo_mat_to_2d(mat):
rot = tf_trans.euler_from_matrix(mat)[2]
return mat[0,3], mat[1,3], rot
def create_base_marker(pose, id, color):
marker = Marker()
marker.header.frame_id = "base_link"
marker.header.stamp = rospy.Time.now()
marker.ns = "ar_servo"
marker.id = id
marker.pose = PoseConverter.to_pose_msg(pose)
marker.color = ColorRGBA(*(color + (1.0,)))
marker.scale.x = 0.7; marker.scale.y = 0.7; marker.scale.z = 0.2
return marker
class PR2VisualServoAR(object):
def __init__(self, ar_topic):
self.ar_sub = rospy.Subscriber(ar_topic, ARMarker, self.ar_sub)
self.mkr_pub = rospy.Publisher("visualization_marker", Marker)
self.cur_ar_pose = None
self.kin_arm = None
self.ar_pose_updated = False
self.base_pub = rospy.Publisher("/base_controller/command", Twist)
self.preempt_requested = False
def ar_sub(self, msg):
if self.kin_arm == None:
self.kin_arm = kin_from_param(base_link="base_link",
end_link=msg.header.frame_id)
base_B_camera = self.kin_arm.forward_filled()
camera_B_tag = PoseConverter.to_homo_mat(msg.pose.pose)
cur_ar_pose = base_B_camera * camera_B_tag
# check to see if the tag is in front of the robot
if cur_ar_pose[0,3] < 0.:
#rospy.logwarn("Strange AR toolkit bug!")
return
self.cur_ar_pose = cur_ar_pose
self.ar_pose_updated = True
def request_preempt(self):
self.preempt_requested = True
def save_ar_goal(self):
r = rospy.Rate(10)
while not rospy.is_shutdown():
if self.cur_ar_pose is not None:
ar_goal = homo_mat_to_2d(self.cur_ar_pose)
print ar_goal
r.sleep()
def test_move(self):
rospy.sleep(0)
base_twist = Twist()
base_twist.linear.x = 0.0 #x_ctrl
base_twist.linear.y = 0.0 #y_ctrl
base_twist.angular.z = 0.4 #r_ctrl
r = rospy.Rate(20.)
while not rospy.is_shutdown():
self.base_pub.publish(base_twist)
r.sleep()
self.base_pub.publish(Twist())
def find_ar_tag(self, timeout=None):
rate = 20.
ar_2d_q_len = 10
sigma_thresh = [0.005, 0.001, 0.01]
no_mean_thresh = 0.5
r = rospy.Rate(rate)
ar_2d_queue = deque()
new_obs_queue = deque()
start_time = rospy.get_time()
while True:
if timeout is not None and rospy.get_time() - start_time > timeout:
rospy.logwarn("[pr2_viz_servo] find_ar_tag timed out, current ar_sigma: " +
str(np.std(ar_2d_queue, 0)) +
" sigma_thresh: " +
str(sigma_thresh))
return None, 'timeout'
if self.preempt_requested:
self.preempt_requested = False
return None, 'preempted'
if rospy.is_shutdown():
return None, 'aborted'
if self.cur_ar_pose is not None:
# make sure we have a new observation
new_obs = self.ar_pose_updated
self.ar_pose_updated = False
if new_obs:
if len(ar_2d_queue) == ar_2d_q_len:
ar_2d_queue.popleft()
ar_2d = homo_mat_to_2d(self.cur_ar_pose)
ar_2d_queue.append(ar_2d)
if len(new_obs_queue) == ar_2d_q_len:
new_obs_queue.popleft()
new_obs_queue.append(new_obs)
# see if we have a low variance tag
if len(ar_2d_queue) == ar_2d_q_len:
ar_sigma = np.std(ar_2d_queue, 0)
no_mean = np.mean(new_obs_queue, 0)
print ar_sigma, no_mean
if np.all(ar_sigma < sigma_thresh) and no_mean >= no_mean_thresh:
return np.mean(ar_2d_queue, 0), 'found_tag'
r.sleep()
def servo_to_tag(self, pose_goal, goal_error=[0.03, 0.03, 0.1], initial_ar_pose=None):
lost_tag_thresh = 0.6 #0.4
# TODO REMOVE
err_pub = rospy.Publisher("servo_err", Float32MultiArray)
if False:
self.test_move()
return "aborted"
#######################
goal_ar_pose = homo_mat_from_2d(*pose_goal)
rate = 20.
kf_x = ServoKalmanFilter(delta_t=1./rate)
kf_y = ServoKalmanFilter(delta_t=1./rate)
kf_r = ServoKalmanFilter(delta_t=1./rate)
if initial_ar_pose is not None:
ar_err = homo_mat_to_2d(homo_mat_from_2d(*initial_ar_pose) * goal_ar_pose**-1)
kf_x.update(ar_err[0])
kf_y.update(ar_err[1])
kf_r.update(ar_err[2])
print "initial_ar_pose", initial_ar_pose
pid_x = PIDController(k_p=0.5, rate=rate, saturation=0.05)
pid_y = PIDController(k_p=0.5, rate=rate, saturation=0.05)
pid_r = PIDController(k_p=0.5, rate=rate, saturation=0.08)
r = rospy.Rate(rate)
while True:
if rospy.is_shutdown():
self.base_pub.publish(Twist())
return 'aborted'
if self.preempt_requested:
self.preempt_requested = False
self.base_pub.publish(Twist())
return 'preempted'
goal_mkr = create_base_marker(goal_ar_pose, 0, (0., 1., 0.))
self.mkr_pub.publish(goal_mkr)
if self.cur_ar_pose is not None:
# make sure we have a new observation
new_obs = self.ar_pose_updated
self.ar_pose_updated = False
# find the error between the AR tag and goal pose
print "self.cur_ar_pose", self.cur_ar_pose
cur_ar_pose_2d = homo_mat_from_2d(*homo_mat_to_2d(self.cur_ar_pose))
print "cur_ar_pose_2d", cur_ar_pose_2d
ar_mkr = create_base_marker(cur_ar_pose_2d, 1, (1., 0., 0.))
self.mkr_pub.publish(ar_mkr)
ar_err = homo_mat_to_2d(cur_ar_pose_2d * goal_ar_pose**-1)
print "ar_err", ar_err
print "goal_ar_pose", goal_ar_pose
# filter this error using a Kalman filter
x_filt_err, x_filt_cov, x_unreli = kf_x.update(ar_err[0], new_obs=new_obs)
y_filt_err, y_filt_cov, y_unreli = kf_y.update(ar_err[1], new_obs=new_obs)
r_filt_err, r_filt_cov, r_unreli = kf_r.update(ar_err[2], new_obs=new_obs)
if np.any(np.array([x_unreli, y_unreli, r_unreli]) > [lost_tag_thresh]*3):
self.base_pub.publish(Twist())
return 'lost_tag'
print "Noise:", x_unreli, y_unreli, r_unreli
# TODO REMOVE
ma = Float32MultiArray()
ma.data = [x_filt_err[0,0], x_filt_err[1,0], ar_err[0],
x_unreli, y_unreli, r_unreli]
err_pub.publish(ma)
print "xerr"
print x_filt_err
print x_filt_cov
print "Cov", x_filt_cov[0,0], y_filt_cov[0,0], r_filt_cov[0,0]
x_ctrl = pid_x.update_state(x_filt_err[0,0])
y_ctrl = pid_y.update_state(y_filt_err[0,0])
r_ctrl = pid_r.update_state(r_filt_err[0,0])
base_twist = Twist()
base_twist.linear.x = x_ctrl
base_twist.linear.y = y_ctrl
base_twist.angular.z = r_ctrl
cur_filt_err = np.array([x_filt_err[0,0], y_filt_err[0,0], r_filt_err[0,0]])
print "err", ar_err
print "Err filt", cur_filt_err
print "Twist:", base_twist
if np.all(np.fabs(cur_filt_err) < goal_error):
self.base_pub.publish(Twist())
return 'succeeded'
self.base_pub.publish(base_twist)
r.sleep()
def main():
rospy.init_node("pr2_viz_servo")
assert(sys.argv[1] in ['r', 'l'])
if sys.argv[1] == 'r':
viz_servo = PR2VisualServoAR("/r_pr2_ar_pose_marker")
else:
viz_servo = PR2VisualServoAR("/l_pr2_ar_pose_marker")
if False:
viz_servo.save_ar_goal()
elif False:
viz_servo.servo_to_tag((0.55761498778404717, -0.28816809195738824, 1.5722787397126308))
else:
print viz_servo.find_ar_tag(5)
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99274 | 241 | 318 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0031, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0126, 0.0031, 0, 0.66, 0.0417, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L5_C0", "label": "from collections import deque", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0157, 0.0031, 0, 0.66, 0.0833, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.022, 0.0031, 0, 0.66, 0.125, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0252, 0.0031, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_pr2_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0283, 0.0031, 0, 0.66, 0.2083, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('ar_pose')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.0314, 0.0031, 0, 0.66, 0.25, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('visualization_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.0346, 0.0031, 0, 0.66, 0.2917, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('pykdl_utils')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Import_L13_C0", "label": "rospy import rospy", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0409, 0.0031, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Import_L14_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.044, 0.0031, 0, 0.66, 0.375, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tf_trans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L15_C0", "label": "from geometry_msgs.msg import Twist", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0472, 0.0031, 0, 0.66, 0.4167, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Twist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Twist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L16_C0", "label": "from std_msgs.msg import Float32MultiArray", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0503, 0.0031, 0, 0.66, 0.4583, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float32MultiArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float32MultiArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L17_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0535, 0.0031, 0, 0.66, 0.5, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L18_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0566, 0.0031, 0, 0.66, 0.5417, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L20_C0", "label": "from hrl_generic_arms.pose_converter import PoseConverter", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0629, 0.0031, 0, 0.66, 0.5833, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "hrl_generic_arms.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L21_C0", "label": "from hrl_generic_arms.controllers import PIDController", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.066, 0.0031, 0, 0.66, 0.625, 492, 0, 1, 0, 0, 492, 0, 0], "semantic": {"name": "hrl_generic_arms.controllers", "arg_names": [], "import_names": ["PIDController"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.controllers import PIDController"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L22_C0", "label": "from pykdl_utils.pr2_kin import kin_from_param", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0692, 0.0031, 0, 0.66, 0.6667, 772, 0, 1, 0, 0, 772, 0, 0], "semantic": {"name": "pykdl_utils.pr2_kin", "arg_names": [], "import_names": ["kin_from_param"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pykdl_utils.pr2_kin import kin_from_param"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ImportFrom_L24_C0", "label": "from ar_pose.msg import ARMarker", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0755, 0.0031, 0, 0.66, 0.7083, 554, 0, 1, 0, 0, 554, 0, 0], "semantic": {"name": "ar_pose.msg", "arg_names": [], "import_names": ["ARMarker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ar_pose.msg import ARMarker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L26_C0", "label": "ServoKalmanFilter", "type": "class", "loc": [26, 96], "level": 0, "parent": null, "vector": [3, 0, 0.1918, 0.2233, 0, 0.66, 0.75, 425, 0, 2, 0, 0, 186, 0, 28], "semantic": {"name": "ServoKalmanFilter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ServoKalmanFilter(object):\n # TODO tune these parameters properly\n def __init__(self, delta_t, sigma_z=0.02*0.001, P_init=[0.0, 0.0], sigma_a=0.02):\n self.P_init = P_init\n self.delta_t = delta_t\n self.F = np.mat([[1, delta_t], [0, 1]])\n self.Q = np.mat([[delta_t**4/4, delta_t**3/2], [delta_t**3/2, delta_t**2]]) * sigma_a**2\n self.H = np.mat([1, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L26_C0", "vector": [2, 1, 0.1132, 0.0535, 1, 0.12, 0.0, 555, 0, 5, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "delta_t", "sigma_z", "P_init", "sigma_a"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, delta_t, sigma_z=0.02*0.001, P_init=[0.0, 0.0], sigma_a=0.02):\n self.P_init = P_init\n self.delta_t = delta_t\n self.F = np.mat([[1, delta_t], [0, 1]])\n self.Q = np.mat([[delta_t**4/4, delta_t**3/2], [delta_t**3/2, delta_t**2]]) * sigma_a**2\n self.H = np.mat([1, 0])\n self.R = np.mat([sigma_z])\n self.x_cur = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L29_C8", "label": "self.P_init =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.0912, 0.0031, 2, 0.49, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.P_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_init = P_init"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L30_C8", "label": "self.delta_t =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.0943, 0.0031, 2, 0.49, 0.0769, 719, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.delta_t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.delta_t = delta_t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L31_C8", "label": "self.F = mat()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.0975, 0.0031, 2, 0.49, 0.1538, 635, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "self.F", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.F = np.mat([[1, delta_t], [0, 1]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L32_C8", "label": "self.Q =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1006, 0.0031, 2, 0.49, 0.2308, 913, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.Q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.Q = np.mat([[delta_t**4/4, delta_t**3/2], [delta_t**3/2, delta_t**2]]) * sigma_a**2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L33_C8", "label": "self.H = mat()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1038, 0.0031, 2, 0.49, 0.3077, 102, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "self.H", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.H = np.mat([1, 0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L34_C8", "label": "self.R = mat()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1069, 0.0031, 2, 0.49, 0.3846, 333, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "self.R", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.R = np.mat([sigma_z])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L35_C8", "label": "self.x_cur =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1101, 0.0031, 2, 0.49, 0.4615, 820, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.x_cur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x_cur = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L37_C8", "label": "self.resid_q_len = int()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1164, 0.0031, 2, 0.49, 0.5385, 947, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self.resid_q_len", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self.resid_q_len = int(1./delta_t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L38_C8", "label": "self.resid_sigma_reject =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1195, 0.0031, 2, 0.49, 0.6154, 699, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.resid_sigma_reject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.resid_sigma_reject = 3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L39_C8", "label": "self.min_reject =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1226, 0.0031, 2, 0.49, 0.6923, 151, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.min_reject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.min_reject = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L40_C8", "label": "self.resid_queue = deque()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1258, 0.0031, 2, 0.49, 0.7692, 719, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.resid_queue", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.resid_queue = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L42_C8", "label": "self.unreli_q_len =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1321, 0.0031, 2, 0.49, 0.8462, 678, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.unreli_q_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.unreli_q_len = 1 * int(1./delta_t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L43_C8", "label": "self.unreli_queue = deque()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1352, 0.0031, 2, 0.49, 0.9231, 163, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.unreli_queue", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " self.unreli_queue = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L44_C8", "label": "self.unreli_weights = linspace()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "vector": [14, 2, 0.1384, 0.0031, 2, 0.49, 1.0, 448, 3, 3, 0, 0, 119, 10, 1], "semantic": {"name": "self.unreli_weights", "arg_names": [], "import_names": [], "rhs_call_name": "linspace", "annotation": ""}, "snippet": " self.unreli_weights = np.linspace(2, 0, self.unreli_q_len)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "label": "update", "type": "function", "loc": [46, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L26_C0", "vector": [2, 1, 0.2233, 0.1604, 1, 0.12, 1.0, 637, 0, 3, 1, 0, 0, 0, 19], "semantic": {"name": "update", "arg_names": ["self", "z_obs", "new_obs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, z_obs, new_obs=True):\n is_unreli = False\n if new_obs:\n if self.x_cur is None:\n self.x_cur = np.mat([z_obs, 0]).T\n self.P_cur = np.mat(np.diag(self.P_init))\n # predict\n x_pred = self.F * self.x_cur # predicted state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L47_C8", "label": "is_unreli =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "vector": [14, 2, 0.1478, 0.0031, 2, 0.48, 0.0, 248, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_unreli", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_unreli = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "label": "if", "type": "if", "loc": [48, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "vector": [4, 2, 0.1997, 0.1006, 2, 0.48, 0.2, 0, 2, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_obs:\n if self.x_cur is None:\n self.x_cur = np.mat([z_obs, 0]).T\n self.P_cur = np.mat(np.diag(self.P_init))\n # predict\n x_pred = self.F * self.x_cur # predicted state\n P_pred = self.F * self.P_cur * self.F.T + self.Q # predicted covariance\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L49_C12", "label": "if", "type": "if", "loc": [49, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [4, 3, 0.1572, 0.0094, 3, 0.65, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.x_cur is None:\n self.x_cur = np.mat([z_obs, 0]).T\n self.P_cur = np.mat(np.diag(self.P_init))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L50_C16", "label": "self.x_cur =", "type": "assigned_variable", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L49_C12", "vector": [14, 4, 0.1572, 0.0031, 4, 0.63, 0.0, 820, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.x_cur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x_cur = np.mat([z_obs, 0]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L51_C16", "label": "self.P_cur = mat()", "type": "assigned_variable", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L49_C12", "vector": [14, 4, 0.1604, 0.0031, 4, 0.63, 1.0, 236, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "self.P_cur", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " self.P_cur = np.mat(np.diag(self.P_init))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L53_C12", "label": "x_pred =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [14, 3, 0.1667, 0.0031, 3, 0.65, 0.1, 558, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x_pred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x_pred = self.F * self.x_cur # predicted state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L54_C12", "label": "P_pred =", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [14, 3, 0.1698, 0.0031, 3, 0.65, 0.2, 862, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "P_pred", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " P_pred = self.F * self.P_cur * self.F.T + self.Q # predicted covariance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L57_C12", "label": "y_resi =", "type": "assigned_variable", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [14, 3, 0.1792, 0.0031, 3, 0.65, 0.3, 334, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y_resi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y_resi = z_obs - self.H * x_pred # measurement residual"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L58_C12", "label": "S_resi =", "type": "assigned_variable", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [14, 3, 0.1824, 0.0031, 3, 0.65, 0.4, 491, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "S_resi", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " S_resi = self.H * P_pred * self.H.T + self.R # residual covariance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L59_C12", "label": "K_gain =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [14, 3, 0.1855, 0.0031, 3, 0.65, 0.5, 351, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "K_gain", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " K_gain = P_pred * self.H.T * S_resi**-1 # Kalman gain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "label": "if", "type": "if", "loc": [62, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [4, 3, 0.2091, 0.0314, 3, 0.65, 0.6, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(self.resid_queue) == self.resid_q_len and\n np.fabs(y_resi) > max(self.min_reject, \n self.resid_sigma_reject * np.std(self.resid_queue))):\n # we have determined this observation to be unreliable\n print(\"INCONSISTENT\", self.resid_queue)\n is_unreli = True\n\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L66_C16", "label": "print()", "type": "expression", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "vector": [8, 4, 0.2075, 0.0031, 4, 0.06, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"INCONSISTENT\", self.resid_queue)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L67_C16", "label": "is_unreli =", "type": "assigned_variable", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "vector": [14, 4, 0.2107, 0.0031, 4, 0.06, 0.3333, 248, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_unreli", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_unreli = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L70_C16", "label": "self.x_cur =", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "vector": [14, 4, 0.2201, 0.0031, 4, 0.06, 0.6667, 820, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.x_cur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.x_cur = x_pred + K_gain * y_resi # update state estimate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L71_C16", "label": "self.P_cur =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "vector": [14, 4, 0.2233, 0.0031, 4, 0.06, 1.0, 236, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.P_cur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.P_cur = (np.mat(np.eye(2)) - K_gain * self.H) * P_pred"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L74_C12", "label": "if", "type": "if", "loc": [74, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [4, 3, 0.2343, 0.0063, 3, 0.65, 0.7, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.resid_queue) == self.resid_q_len:\n self.resid_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L75_C16", "label": "popleft()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L74_C12", "vector": [8, 4, 0.2358, 0.0031, 4, 0.81, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " self.resid_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L76_C12", "label": "append()", "type": "expression", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [8, 3, 0.239, 0.0031, 3, 0.65, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.resid_queue.append(y_resi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L78_C12", "label": "print()", "type": "expression", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [8, 3, 0.2453, 0.0031, 3, 0.65, 0.9, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"NOT NEW\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L79_C12", "label": "is_unreli =", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "vector": [14, 3, 0.2484, 0.0031, 3, 0.65, 1.0, 248, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_unreli", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_unreli = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "vector": [4, 2, 0.2594, 0.0063, 2, 0.48, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.unreli_queue) == self.unreli_q_len:\n self.unreli_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L83_C12", "label": "popleft()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L82_C8", "vector": [8, 3, 0.261, 0.0031, 3, 0.06, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " self.unreli_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L84_C8", "label": "append()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "vector": [8, 2, 0.2642, 0.0031, 2, 0.48, 0.6, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.unreli_queue.append(is_unreli)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L91_C8", "label": "if", "type": "if", "loc": [91, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "vector": [4, 2, 0.2909, 0.0126, 2, 0.48, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.unreli_queue) == self.unreli_q_len:\n unreli_level = np.sum(self.unreli_weights * self.unreli_queue) / self.unreli_q_len\n else:\n unreli_level = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L92_C12", "label": "unreli_level =", "type": "assigned_variable", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L91_C8", "vector": [14, 3, 0.2893, 0.0031, 3, 0.85, 0.0, 365, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unreli_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unreli_level = np.sum(self.unreli_weights * self.unreli_queue) / self.unreli_q_len"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L94_C12", "label": "unreli_level =", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L91_C8", "vector": [14, 3, 0.2956, 0.0031, 3, 0.85, 1.0, 365, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "unreli_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unreli_level = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "vector": [13, 2, 0.3019, 0.0031, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.x_cur, self.P_cur, unreli_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "label": "homo_mat_from_2d", "type": "function", "loc": [98, 102], "level": 0, "parent": null, "vector": [2, 0, 0.3145, 0.0157, 0, 0.66, 0.7917, 191, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "homo_mat_from_2d", "arg_names": ["x", "y", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def homo_mat_from_2d(x, y, rot):\n mat2d = np.mat(tf_trans.euler_matrix(0, 0, rot))\n mat2d[0,3] = x\n mat2d[1,3] = y\n return mat2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L99_C4", "label": "mat2d = mat()", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "vector": [14, 1, 0.3113, 0.0031, 1, 0.05, 0.0, 662, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "mat2d", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " mat2d = np.mat(tf_trans.euler_matrix(0, 0, rot))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L100_C4", "label": "assign", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "vector": [14, 1, 0.3145, 0.0031, 1, 0.05, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat2d[0,3] = x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L101_C4", "label": "assign", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "vector": [14, 1, 0.3176, 0.0031, 1, 0.05, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat2d[1,3] = y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L102_C4", "label": "return", "type": "return", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "vector": [13, 1, 0.3208, 0.0031, 1, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mat2d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L104_C0", "label": "homo_mat_to_2d", "type": "function", "loc": [104, 106], "level": 0, "parent": null, "vector": [2, 0, 0.3302, 0.0094, 0, 0.66, 0.8333, 550, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "homo_mat_to_2d", "arg_names": ["mat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def homo_mat_to_2d(mat):\n rot = tf_trans.euler_from_matrix(mat)[2]\n return mat[0,3], mat[1,3], rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L105_C4", "label": "rot =", "type": "assigned_variable", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L104_C0", "vector": [14, 1, 0.3302, 0.0031, 1, 0.24, 0.0, 812, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = tf_trans.euler_from_matrix(mat)[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L106_C4", "label": "return", "type": "return", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L104_C0", "vector": [13, 1, 0.3333, 0.0031, 1, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mat[0,3], mat[1,3], rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "label": "create_base_marker", "type": "function", "loc": [108, 117], "level": 0, "parent": null, "vector": [2, 0, 0.3538, 0.0314, 0, 0.66, 0.875, 210, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "create_base_marker", "arg_names": ["pose", "id", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_base_marker(pose, id, color):\n marker = Marker()\n marker.header.frame_id = \"base_link\"\n marker.header.stamp = rospy.Time.now()\n marker.ns = \"ar_servo\"\n marker.id = id\n marker.pose = PoseConverter.to_pose_msg(pose)\n marker.color = ColorRGBA(*(color + (1.0,)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L109_C4", "label": "marker = Marker()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3428, 0.0031, 1, 0.01, 0.0, 864, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L110_C4", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3459, 0.0031, 1, 0.01, 0.1, 22, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.frame_id = \"base_link\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L111_C4", "label": "marker.header.stamp = now()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3491, 0.0031, 1, 0.01, 0.2, 625, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " marker.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L112_C4", "label": "marker.ns =", "type": "assigned_variable", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3522, 0.0031, 1, 0.01, 0.3, 748, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = \"ar_servo\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L113_C4", "label": "marker.id =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3553, 0.0031, 1, 0.01, 0.4, 570, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L114_C4", "label": "marker.pose = to_pose_msg()", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3585, 0.0031, 1, 0.01, 0.5, 483, 3, 1, 0, 0, 814, 10, 1], "semantic": {"name": "marker.pose", "arg_names": [], "import_names": [], "rhs_call_name": "to_pose_msg", "annotation": ""}, "snippet": " marker.pose = PoseConverter.to_pose_msg(pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L115_C4", "label": "marker.color = ColorRGBA()", "type": "assigned_variable", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3616, 0.0031, 1, 0.01, 0.6, 248, 3, 1, 0, 0, 927, 10, 1], "semantic": {"name": "marker.color", "arg_names": [], "import_names": [], "rhs_call_name": "ColorRGBA", "annotation": ""}, "snippet": " marker.color = ColorRGBA(*(color + (1.0,)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L116_C4", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3648, 0.0031, 1, 0.01, 0.7, 887, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = 0.7; marker.scale.y = 0.7; marker.scale.z = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L116_C26", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3648, 0.0031, 1, 0.01, 0.8, 730, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = 0.7; marker.scale.y = 0.7; marker.scale.z = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L116_C48", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [14, 1, 0.3648, 0.0031, 1, 0.01, 0.9, 969, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = 0.7; marker.scale.y = 0.7; marker.scale.z = 0.2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L117_C4", "label": "return", "type": "return", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "vector": [13, 1, 0.3679, 0.0031, 1, 0.01, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "label": "PR2VisualServoAR", "type": "class", "loc": [119, 301], "level": 0, "parent": null, "vector": [3, 0, 0.6604, 0.5755, 0, 0.66, 0.9167, 968, 0, 7, 0, 0, 186, 0, 99], "semantic": {"name": "PR2VisualServoAR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2VisualServoAR(object):\n def __init__(self, ar_topic):\n self.ar_sub = rospy.Subscriber(ar_topic, ARMarker, self.ar_sub)\n self.mkr_pub = rospy.Publisher(\"visualization_marker\", Marker)\n\n self.cur_ar_pose = None\n self.kin_arm = None\n self.ar_pose_updated = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "label": "__init__", "type": "function", "loc": [120, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.3899, 0.0283, 1, 0.08, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "ar_topic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, ar_topic):\n self.ar_sub = rospy.Subscriber(ar_topic, ARMarker, self.ar_sub)\n self.mkr_pub = rospy.Publisher(\"visualization_marker\", Marker)\n\n self.cur_ar_pose = None\n self.kin_arm = None\n self.ar_pose_updated = False\n self.base_pub = rospy.Publisher(\"/base_controller/command\", Twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L121_C8", "label": "self.ar_sub = Subscriber()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.3805, 0.0031, 2, 0.37, 0.0, 432, 3, 3, 0, 0, 455, 10, 1], "semantic": {"name": "self.ar_sub", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " self.ar_sub = rospy.Subscriber(ar_topic, ARMarker, self.ar_sub)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L122_C8", "label": "self.mkr_pub = Publisher()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.3836, 0.0031, 2, 0.37, 0.1667, 918, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.mkr_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.mkr_pub = rospy.Publisher(\"visualization_marker\", Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L124_C8", "label": "self.cur_ar_pose =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.3899, 0.0031, 2, 0.37, 0.3333, 430, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.cur_ar_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_ar_pose = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L125_C8", "label": "self.kin_arm =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.3931, 0.0031, 2, 0.37, 0.5, 894, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.kin_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.kin_arm = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L126_C8", "label": "self.ar_pose_updated =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.3962, 0.0031, 2, 0.37, 0.6667, 65, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.ar_pose_updated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ar_pose_updated = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L127_C8", "label": "self.base_pub = Publisher()", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.3994, 0.0031, 2, 0.37, 0.8333, 648, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.base_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.base_pub = rospy.Publisher(\"/base_controller/command\", Twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L128_C8", "label": "self.preempt_requested =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "vector": [14, 2, 0.4025, 0.0031, 2, 0.37, 1.0, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.preempt_requested", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.preempt_requested = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "label": "ar_sub", "type": "function", "loc": [130, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.4277, 0.0409, 1, 0.08, 0.1667, 310, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "ar_sub", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ar_sub(self, msg):\n if self.kin_arm == None:\n self.kin_arm = kin_from_param(base_link=\"base_link\", \n end_link=msg.header.frame_id)\n base_B_camera = self.kin_arm.forward_filled()\n camera_B_tag = PoseConverter.to_homo_mat(msg.pose.pose)\n cur_ar_pose = base_B_camera * camera_B_tag\n # check to see if the tag is in front of the robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L131_C8", "label": "if", "type": "if", "loc": [131, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [4, 2, 0.4151, 0.0094, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.kin_arm == None:\n self.kin_arm = kin_from_param(base_link=\"base_link\", \n end_link=msg.header.frame_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L132_C12", "label": "self.kin_arm = kin_from_param()", "type": "assigned_variable", "loc": [132, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L131_C8", "vector": [14, 3, 0.4167, 0.0063, 3, 0.62, 0.0, 894, 3, 2, 0, 0, 187, 10, 1], "semantic": {"name": "self.kin_arm", "arg_names": [], "import_names": [], "rhs_call_name": "kin_from_param", "annotation": ""}, "snippet": " self.kin_arm = kin_from_param(base_link=\"base_link\", \n end_link=msg.header.frame_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L134_C8", "label": "base_B_camera = forward_filled()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [14, 2, 0.4214, 0.0031, 2, 0.29, 0.1667, 262, 3, 0, 0, 0, 869, 10, 1], "semantic": {"name": "base_B_camera", "arg_names": [], "import_names": [], "rhs_call_name": "forward_filled", "annotation": ""}, "snippet": " base_B_camera = self.kin_arm.forward_filled()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L135_C8", "label": "camera_B_tag = to_homo_mat()", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [14, 2, 0.4245, 0.0031, 2, 0.29, 0.3333, 880, 3, 1, 0, 0, 32, 10, 1], "semantic": {"name": "camera_B_tag", "arg_names": [], "import_names": [], "rhs_call_name": "to_homo_mat", "annotation": ""}, "snippet": " camera_B_tag = PoseConverter.to_homo_mat(msg.pose.pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L136_C8", "label": "cur_ar_pose =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [14, 2, 0.4277, 0.0031, 2, 0.29, 0.5, 444, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_ar_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_ar_pose = base_B_camera * camera_B_tag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L138_C8", "label": "if", "type": "if", "loc": [138, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [4, 2, 0.4371, 0.0094, 2, 0.29, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cur_ar_pose[0,3] < 0.:\n #rospy.logwarn(\"Strange AR toolkit bug!\")\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L140_C12", "label": "return", "type": "return", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L138_C8", "vector": [13, 3, 0.4403, 0.0031, 3, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L141_C8", "label": "self.cur_ar_pose =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [14, 2, 0.4434, 0.0031, 2, 0.29, 0.8333, 430, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cur_ar_pose", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_ar_pose = cur_ar_pose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L142_C8", "label": "self.ar_pose_updated =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "vector": [14, 2, 0.4465, 0.0031, 2, 0.29, 1.0, 65, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.ar_pose_updated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ar_pose_updated = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L144_C4", "label": "request_preempt", "type": "function", "loc": [144, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.4544, 0.0063, 1, 0.08, 0.3333, 186, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "request_preempt", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def request_preempt(self):\n self.preempt_requested = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L145_C8", "label": "self.preempt_requested =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L144_C4", "vector": [14, 2, 0.456, 0.0031, 2, 0.59, 0.0, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.preempt_requested", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.preempt_requested = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L147_C4", "label": "save_ar_goal", "type": "function", "loc": [147, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.4717, 0.022, 1, 0.08, 0.5, 118, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "save_ar_goal", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_ar_goal(self):\n r = rospy.Rate(10)\n while not rospy.is_shutdown():\n if self.cur_ar_pose is not None:\n ar_goal = homo_mat_to_2d(self.cur_ar_pose)\n print(ar_goal)\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L148_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L147_C4", "vector": [14, 2, 0.4654, 0.0031, 2, 0.92, 0.0, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L149_C8", "label": "while", "type": "while", "loc": [149, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L147_C4", "vector": [5, 2, 0.4748, 0.0157, 2, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n if self.cur_ar_pose is not None:\n ar_goal = homo_mat_to_2d(self.cur_ar_pose)\n print(ar_goal)\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L150_C12", "label": "if", "type": "if", "loc": [150, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L149_C8", "vector": [4, 3, 0.4748, 0.0094, 3, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_ar_pose is not None:\n ar_goal = homo_mat_to_2d(self.cur_ar_pose)\n print(ar_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L151_C16", "label": "ar_goal = homo_mat_to_2d()", "type": "assigned_variable", "loc": [151, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L150_C12", "vector": [14, 4, 0.4748, 0.0031, 4, 0.89, 0.0, 733, 3, 1, 0, 0, 550, 10, 1], "semantic": {"name": "ar_goal", "arg_names": [], "import_names": [], "rhs_call_name": "homo_mat_to_2d", "annotation": ""}, "snippet": " ar_goal = homo_mat_to_2d(self.cur_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L152_C16", "label": "print()", "type": "expression", "loc": [152, 152], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L150_C12", "vector": [8, 4, 0.478, 0.0031, 4, 0.89, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ar_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L153_C12", "label": "sleep()", "type": "expression", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L149_C8", "vector": [8, 3, 0.4811, 0.0031, 3, 0.2, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "label": "test_move", "type": "function", "loc": [155, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.5031, 0.0346, 1, 0.08, 0.6667, 560, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "test_move", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_move(self):\n rospy.sleep(0)\n base_twist = Twist()\n base_twist.linear.x = 0.0 #x_ctrl\n base_twist.linear.y = 0.0 #y_ctrl\n base_twist.angular.z = 0.4 #r_ctrl\n r = rospy.Rate(20.)\n while not rospy.is_shutdown():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L156_C8", "label": "sleep()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [8, 2, 0.4906, 0.0031, 2, 0.33, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L157_C8", "label": "base_twist = Twist()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [14, 2, 0.4937, 0.0031, 2, 0.33, 0.1429, 685, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "base_twist", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " base_twist = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L158_C8", "label": "base_twist.linear.x =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [14, 2, 0.4969, 0.0031, 2, 0.33, 0.2857, 832, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "base_twist.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_twist.linear.x = 0.0 #x_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L159_C8", "label": "base_twist.linear.y =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [14, 2, 0.5, 0.0031, 2, 0.33, 0.4286, 277, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "base_twist.linear.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_twist.linear.y = 0.0 #y_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L160_C8", "label": "base_twist.angular.z =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [14, 2, 0.5031, 0.0031, 2, 0.33, 0.5714, 608, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "base_twist.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_twist.angular.z = 0.4 #r_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L161_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [14, 2, 0.5063, 0.0031, 2, 0.33, 0.7143, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(20.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L162_C8", "label": "while", "type": "while", "loc": [162, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [5, 2, 0.5126, 0.0094, 2, 0.33, 0.8571, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n self.base_pub.publish(base_twist)\n r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L163_C12", "label": "publish()", "type": "expression", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L162_C8", "vector": [8, 3, 0.5126, 0.0031, 3, 0.82, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(base_twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L164_C12", "label": "sleep()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L162_C8", "vector": [8, 3, 0.5157, 0.0031, 3, 0.82, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L165_C8", "label": "publish()", "type": "expression", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "vector": [8, 2, 0.5189, 0.0031, 2, 0.33, 1.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(Twist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "label": "find_ar_tag", "type": "function", "loc": [167, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.5943, 0.1415, 1, 0.08, 0.8333, 245, 0, 2, 1, 0, 0, 0, 24], "semantic": {"name": "find_ar_tag", "arg_names": ["self", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_ar_tag(self, timeout=None):\n rate = 20.\n ar_2d_q_len = 10\n sigma_thresh = [0.005, 0.001, 0.01]\n no_mean_thresh = 0.5\n r = rospy.Rate(rate)\n ar_2d_queue = deque()\n new_obs_queue = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L168_C8", "label": "rate =", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5283, 0.0031, 2, 0.36, 0.0, 477, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rate = 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L169_C8", "label": "ar_2d_q_len =", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5314, 0.0031, 2, 0.36, 0.125, 708, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ar_2d_q_len", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ar_2d_q_len = 10"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L170_C8", "label": "sigma_thresh =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5346, 0.0031, 2, 0.36, 0.25, 137, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "sigma_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sigma_thresh = [0.005, 0.001, 0.01]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L171_C8", "label": "no_mean_thresh =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5377, 0.0031, 2, 0.36, 0.375, 924, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "no_mean_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " no_mean_thresh = 0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L172_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5409, 0.0031, 2, 0.36, 0.5, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L173_C8", "label": "ar_2d_queue = deque()", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.544, 0.0031, 2, 0.36, 0.625, 577, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "ar_2d_queue", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " ar_2d_queue = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L174_C8", "label": "new_obs_queue = deque()", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5472, 0.0031, 2, 0.36, 0.75, 96, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "new_obs_queue", "arg_names": [], "import_names": [], "rhs_call_name": "deque", "annotation": ""}, "snippet": " new_obs_queue = deque()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L175_C8", "label": "start_time = get_time()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [14, 2, 0.5503, 0.0031, 2, 0.36, 0.875, 511, 3, 0, 0, 0, 164, 10, 1], "semantic": {"name": "start_time", "arg_names": [], "import_names": [], "rhs_call_name": "get_time", "annotation": ""}, "snippet": " start_time = rospy.get_time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "label": "while", "type": "while", "loc": [176, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "vector": [5, 2, 0.6085, 0.1132, 2, 0.36, 1.0, 0, 1, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n if timeout is not None and rospy.get_time() - start_time > timeout:\n rospy.logwarn(\"[pr2_viz_servo] find_ar_tag timed out, current ar_sigma: \" + \n str(np.std(ar_2d_queue, 0)) +\n \" sigma_thresh: \" +\n str(sigma_thresh))\n return None, 'timeout'\n if self.preempt_requested:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L177_C12", "label": "if", "type": "if", "loc": [177, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "vector": [4, 3, 0.5645, 0.0189, 3, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timeout is not None and rospy.get_time() - start_time > timeout:\n rospy.logwarn(\"[pr2_viz_servo] find_ar_tag timed out, current ar_sigma: \" + \n str(np.std(ar_2d_queue, 0)) +\n \" sigma_thresh: \" +\n str(sigma_thresh))\n return None, 'timeout'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L178_C16", "label": "logwarn()", "type": "expression", "loc": [178, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L177_C12", "vector": [8, 4, 0.5645, 0.0126, 4, 0.73, 0.0, 736, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "logwarn", "arg_names": [], "import_names": [], "rhs_call_name": "logwarn", "annotation": ""}, "snippet": " rospy.logwarn(\"[pr2_viz_servo] find_ar_tag timed out, current ar_sigma: \" + \n str(np.std(ar_2d_queue, 0)) +\n \" sigma_thresh: \" +\n str(sigma_thresh))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L182_C16", "label": "return", "type": "return", "loc": [182, 182], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L177_C12", "vector": [13, 4, 0.5723, 0.0031, 4, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, 'timeout'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L183_C12", "label": "if", "type": "if", "loc": [183, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "vector": [4, 3, 0.5786, 0.0094, 3, 0.53, 0.25, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested:\n self.preempt_requested = False\n return None, 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L184_C16", "label": "self.preempt_requested =", "type": "assigned_variable", "loc": [184, 184], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L183_C12", "vector": [14, 4, 0.5786, 0.0031, 4, 0.78, 0.0, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.preempt_requested", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.preempt_requested = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L185_C16", "label": "return", "type": "return", "loc": [185, 185], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L183_C12", "vector": [13, 4, 0.5818, 0.0031, 4, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L186_C12", "label": "if", "type": "if", "loc": [186, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "vector": [4, 3, 0.5865, 0.0063, 3, 0.53, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n return None, 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L187_C16", "label": "return", "type": "return", "loc": [187, 187], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L186_C12", "vector": [13, 4, 0.5881, 0.0031, 4, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "label": "if", "type": "if", "loc": [189, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "vector": [4, 3, 0.6274, 0.0692, 3, 0.53, 0.75, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_ar_pose is not None:\n # make sure we have a new observation\n new_obs = self.ar_pose_updated\n self.ar_pose_updated = False\n\n if new_obs:\n if len(ar_2d_queue) == ar_2d_q_len:\n ar_2d_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L191_C16", "label": "new_obs =", "type": "assigned_variable", "loc": [191, 191], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "vector": [14, 4, 0.6006, 0.0031, 4, 0.65, 0.0, 985, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_obs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_obs = self.ar_pose_updated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L192_C16", "label": "self.ar_pose_updated =", "type": "assigned_variable", "loc": [192, 192], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "vector": [14, 4, 0.6038, 0.0031, 4, 0.65, 0.2, 65, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.ar_pose_updated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ar_pose_updated = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "label": "if", "type": "if", "loc": [194, 198], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "vector": [4, 4, 0.6164, 0.0157, 4, 0.65, 0.4, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_obs:\n if len(ar_2d_queue) == ar_2d_q_len:\n ar_2d_queue.popleft()\n ar_2d = homo_mat_to_2d(self.cur_ar_pose)\n ar_2d_queue.append(ar_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L195_C20", "label": "if", "type": "if", "loc": [195, 196], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "vector": [4, 5, 0.6148, 0.0063, 5, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(ar_2d_queue) == ar_2d_q_len:\n ar_2d_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L196_C24", "label": "popleft()", "type": "expression", "loc": [196, 196], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L195_C20", "vector": [8, 6, 0.6164, 0.0031, 6, 0.07, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " ar_2d_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L197_C20", "label": "ar_2d = homo_mat_to_2d()", "type": "assigned_variable", "loc": [197, 197], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "vector": [14, 5, 0.6195, 0.0031, 5, 0.78, 0.5, 726, 3, 1, 0, 0, 550, 10, 1], "semantic": {"name": "ar_2d", "arg_names": [], "import_names": [], "rhs_call_name": "homo_mat_to_2d", "annotation": ""}, "snippet": " ar_2d = homo_mat_to_2d(self.cur_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L198_C20", "label": "append()", "type": "expression", "loc": [198, 198], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "vector": [8, 5, 0.6226, 0.0031, 5, 0.78, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ar_2d_queue.append(ar_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L200_C16", "label": "if", "type": "if", "loc": [200, 201], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "vector": [4, 4, 0.6305, 0.0063, 4, 0.65, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(new_obs_queue) == ar_2d_q_len:\n new_obs_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L201_C20", "label": "popleft()", "type": "expression", "loc": [201, 201], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L200_C16", "vector": [8, 5, 0.6321, 0.0031, 5, 0.43, 0.0, 285, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "popleft", "arg_names": [], "import_names": [], "rhs_call_name": "popleft", "annotation": ""}, "snippet": " new_obs_queue.popleft()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L202_C16", "label": "append()", "type": "expression", "loc": [202, 202], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "vector": [8, 4, 0.6352, 0.0031, 4, 0.65, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_obs_queue.append(new_obs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "label": "if", "type": "if", "loc": [205, 210], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "vector": [4, 4, 0.6525, 0.0189, 4, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(ar_2d_queue) == ar_2d_q_len:\n ar_sigma = np.std(ar_2d_queue, 0)\n no_mean = np.mean(new_obs_queue, 0)\n print(ar_sigma, no_mean)\n if np.all(ar_sigma < sigma_thresh) and no_mean >= no_mean_thresh:\n return np.mean(ar_2d_queue, 0), 'found_tag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L206_C20", "label": "ar_sigma = std()", "type": "assigned_variable", "loc": [206, 206], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "vector": [14, 5, 0.6478, 0.0031, 5, 0.92, 0.0, 632, 3, 2, 0, 0, 616, 10, 1], "semantic": {"name": "ar_sigma", "arg_names": [], "import_names": [], "rhs_call_name": "std", "annotation": ""}, "snippet": " ar_sigma = np.std(ar_2d_queue, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L207_C20", "label": "no_mean = mean()", "type": "assigned_variable", "loc": [207, 207], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "vector": [14, 5, 0.6509, 0.0031, 5, 0.92, 0.3333, 343, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "no_mean", "arg_names": [], "import_names": [], "rhs_call_name": "mean", "annotation": ""}, "snippet": " no_mean = np.mean(new_obs_queue, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L208_C20", "label": "print()", "type": "expression", "loc": [208, 208], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "vector": [8, 5, 0.6541, 0.0031, 5, 0.92, 0.6667, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ar_sigma, no_mean)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L209_C20", "label": "if", "type": "if", "loc": [209, 210], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "vector": [4, 5, 0.6588, 0.0063, 5, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(ar_sigma < sigma_thresh) and no_mean >= no_mean_thresh:\n return np.mean(ar_2d_queue, 0), 'found_tag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L210_C24", "label": "return", "type": "return", "loc": [210, 210], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L209_C20", "vector": [13, 6, 0.6604, 0.0031, 6, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.mean(ar_2d_queue, 0), 'found_tag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L211_C12", "label": "sleep()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "vector": [8, 3, 0.6635, 0.0031, 3, 0.53, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "label": "servo_to_tag", "type": "function", "loc": [213, 301], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "vector": [2, 1, 0.8082, 0.2799, 1, 0.08, 1.0, 123, 0, 4, 1, 0, 0, 0, 60], "semantic": {"name": "servo_to_tag", "arg_names": ["self", "pose_goal", "goal_error", "initial_ar_pose"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def servo_to_tag(self, pose_goal, goal_error=[0.03, 0.03, 0.1], initial_ar_pose=None):\n lost_tag_thresh = 0.6 #0.4\n\n # TODO REMOVE\n err_pub = rospy.Publisher(\"servo_err\", Float32MultiArray)\n if False:\n self.test_move()\n return \"aborted\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L214_C8", "label": "lost_tag_thresh =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.673, 0.0031, 2, 0.06, 0.0, 728, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "lost_tag_thresh", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lost_tag_thresh = 0.6 #0.4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L217_C8", "label": "err_pub = Publisher()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.6824, 0.0031, 2, 0.06, 0.0769, 187, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "err_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " err_pub = rospy.Publisher(\"servo_err\", Float32MultiArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L218_C8", "label": "if", "type": "if", "loc": [218, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [4, 2, 0.6887, 0.0094, 2, 0.06, 0.1538, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n self.test_move()\n return \"aborted\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L219_C12", "label": "test_move()", "type": "expression", "loc": [219, 219], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L218_C8", "vector": [8, 3, 0.6887, 0.0031, 3, 0.96, 0.0, 560, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test_move", "arg_names": [], "import_names": [], "rhs_call_name": "test_move", "annotation": ""}, "snippet": " self.test_move()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L220_C12", "label": "return", "type": "return", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L218_C8", "vector": [13, 3, 0.6918, 0.0031, 3, 0.96, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"aborted\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L223_C8", "label": "goal_ar_pose = homo_mat_from_2d()", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7013, 0.0031, 2, 0.06, 0.2308, 727, 3, 1, 0, 0, 191, 10, 1], "semantic": {"name": "goal_ar_pose", "arg_names": [], "import_names": [], "rhs_call_name": "homo_mat_from_2d", "annotation": ""}, "snippet": " goal_ar_pose = homo_mat_from_2d(*pose_goal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L224_C8", "label": "rate =", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7044, 0.0031, 2, 0.06, 0.3077, 477, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rate = 20."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L225_C8", "label": "kf_x = ServoKalmanFilter()", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7075, 0.0031, 2, 0.06, 0.3846, 369, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "kf_x", "arg_names": [], "import_names": [], "rhs_call_name": "ServoKalmanFilter", "annotation": ""}, "snippet": " kf_x = ServoKalmanFilter(delta_t=1./rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L226_C8", "label": "kf_y = ServoKalmanFilter()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7107, 0.0031, 2, 0.06, 0.4615, 92, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "kf_y", "arg_names": [], "import_names": [], "rhs_call_name": "ServoKalmanFilter", "annotation": ""}, "snippet": " kf_y = ServoKalmanFilter(delta_t=1./rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L227_C8", "label": "kf_r = ServoKalmanFilter()", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7138, 0.0031, 2, 0.06, 0.5385, 3, 3, 1, 0, 0, 425, 10, 1], "semantic": {"name": "kf_r", "arg_names": [], "import_names": [], "rhs_call_name": "ServoKalmanFilter", "annotation": ""}, "snippet": " kf_r = ServoKalmanFilter(delta_t=1./rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "label": "if", "type": "if", "loc": [228, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [4, 2, 0.7248, 0.0189, 2, 0.06, 0.6154, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if initial_ar_pose is not None:\n ar_err = homo_mat_to_2d(homo_mat_from_2d(*initial_ar_pose) * goal_ar_pose**-1)\n kf_x.update(ar_err[0])\n kf_y.update(ar_err[1])\n kf_r.update(ar_err[2])\n print(\"initial_ar_pose\", initial_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L229_C12", "label": "ar_err = homo_mat_to_2d()", "type": "assigned_variable", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "vector": [14, 3, 0.7201, 0.0031, 3, 0.53, 0.0, 972, 3, 1, 0, 0, 550, 10, 2], "semantic": {"name": "ar_err", "arg_names": [], "import_names": [], "rhs_call_name": "homo_mat_to_2d", "annotation": ""}, "snippet": " ar_err = homo_mat_to_2d(homo_mat_from_2d(*initial_ar_pose) * goal_ar_pose**-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L230_C12", "label": "update()", "type": "expression", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "vector": [8, 3, 0.7233, 0.0031, 3, 0.53, 0.25, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " kf_x.update(ar_err[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L231_C12", "label": "update()", "type": "expression", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "vector": [8, 3, 0.7264, 0.0031, 3, 0.53, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " kf_y.update(ar_err[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L232_C12", "label": "update()", "type": "expression", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "vector": [8, 3, 0.7296, 0.0031, 3, 0.53, 0.75, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " kf_r.update(ar_err[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L233_C12", "label": "print()", "type": "expression", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "vector": [8, 3, 0.7327, 0.0031, 3, 0.53, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"initial_ar_pose\", initial_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L235_C8", "label": "pid_x = PIDController()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.739, 0.0031, 2, 0.06, 0.6923, 900, 3, 3, 0, 0, 15, 10, 1], "semantic": {"name": "pid_x", "arg_names": [], "import_names": [], "rhs_call_name": "PIDController", "annotation": ""}, "snippet": " pid_x = PIDController(k_p=0.5, rate=rate, saturation=0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L236_C8", "label": "pid_y = PIDController()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7421, 0.0031, 2, 0.06, 0.7692, 677, 3, 3, 0, 0, 15, 10, 1], "semantic": {"name": "pid_y", "arg_names": [], "import_names": [], "rhs_call_name": "PIDController", "annotation": ""}, "snippet": " pid_y = PIDController(k_p=0.5, rate=rate, saturation=0.05)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L237_C8", "label": "pid_r = PIDController()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7453, 0.0031, 2, 0.06, 0.8462, 996, 3, 3, 0, 0, 15, 10, 1], "semantic": {"name": "pid_r", "arg_names": [], "import_names": [], "rhs_call_name": "PIDController", "annotation": ""}, "snippet": " pid_r = PIDController(k_p=0.5, rate=rate, saturation=0.08)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L238_C8", "label": "r = Rate()", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [14, 2, 0.7484, 0.0031, 2, 0.06, 0.9231, 436, 3, 1, 0, 0, 543, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "Rate", "annotation": ""}, "snippet": " r = rospy.Rate(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "label": "while", "type": "while", "loc": [239, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "vector": [5, 2, 0.8491, 0.1981, 2, 0.06, 1.0, 0, 1, 0, 0, 0, 0, 0, 44], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n if rospy.is_shutdown():\n self.base_pub.publish(Twist())\n return 'aborted'\n if self.preempt_requested:\n self.preempt_requested = False\n self.base_pub.publish(Twist())\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L240_C12", "label": "if", "type": "if", "loc": [240, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "vector": [4, 3, 0.7579, 0.0094, 3, 0.19, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n self.base_pub.publish(Twist())\n return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L241_C16", "label": "publish()", "type": "expression", "loc": [241, 241], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L240_C12", "vector": [8, 4, 0.7579, 0.0031, 4, 0.22, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(Twist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L242_C16", "label": "return", "type": "return", "loc": [242, 242], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L240_C12", "vector": [13, 4, 0.761, 0.0031, 4, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'aborted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "label": "if", "type": "if", "loc": [243, 246], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "vector": [4, 3, 0.7689, 0.0126, 3, 0.19, 0.2, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.preempt_requested:\n self.preempt_requested = False\n self.base_pub.publish(Twist())\n return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L244_C16", "label": "self.preempt_requested =", "type": "assigned_variable", "loc": [244, 244], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "vector": [14, 4, 0.7673, 0.0031, 4, 0.86, 0.0, 540, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.preempt_requested", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.preempt_requested = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L245_C16", "label": "publish()", "type": "expression", "loc": [245, 245], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "vector": [8, 4, 0.7704, 0.0031, 4, 0.86, 0.5, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(Twist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L246_C16", "label": "return", "type": "return", "loc": [246, 246], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "vector": [13, 4, 0.7736, 0.0031, 4, 0.86, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'preempted'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L247_C12", "label": "goal_mkr = create_base_marker()", "type": "assigned_variable", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "vector": [14, 3, 0.7767, 0.0031, 3, 0.19, 0.4, 921, 3, 3, 0, 0, 210, 10, 1], "semantic": {"name": "goal_mkr", "arg_names": [], "import_names": [], "rhs_call_name": "create_base_marker", "annotation": ""}, "snippet": " goal_mkr = create_base_marker(goal_ar_pose, 0, (0., 1., 0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L248_C12", "label": "publish()", "type": "expression", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "vector": [8, 3, 0.7799, 0.0031, 3, 0.19, 0.6, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mkr_pub.publish(goal_mkr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "label": "if", "type": "if", "loc": [249, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "vector": [4, 3, 0.8616, 0.1604, 3, 0.19, 0.8, 0, 0, 0, 0, 0, 0, 0, 36], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_ar_pose is not None:\n # make sure we have a new observation\n new_obs = self.ar_pose_updated\n self.ar_pose_updated = False\n\n # find the error between the AR tag and goal pose\n print(\"self.cur_ar_pose\", self.cur_ar_pose)\n cur_ar_pose_2d = homo_mat_from_2d(*homo_mat_to_2d(self.cur_ar_pose))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L251_C16", "label": "new_obs =", "type": "assigned_variable", "loc": [251, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.7893, 0.0031, 4, 0.36, 0.0, 985, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_obs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_obs = self.ar_pose_updated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L252_C16", "label": "self.ar_pose_updated =", "type": "assigned_variable", "loc": [252, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.7925, 0.0031, 4, 0.36, 0.0294, 65, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.ar_pose_updated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ar_pose_updated = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L255_C16", "label": "print()", "type": "expression", "loc": [255, 255], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8019, 0.0031, 4, 0.36, 0.0588, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"self.cur_ar_pose\", self.cur_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L256_C16", "label": "cur_ar_pose_2d = homo_mat_from_2d()", "type": "assigned_variable", "loc": [256, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.805, 0.0031, 4, 0.36, 0.0882, 636, 3, 1, 0, 0, 191, 10, 2], "semantic": {"name": "cur_ar_pose_2d", "arg_names": [], "import_names": [], "rhs_call_name": "homo_mat_from_2d", "annotation": ""}, "snippet": " cur_ar_pose_2d = homo_mat_from_2d(*homo_mat_to_2d(self.cur_ar_pose))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L257_C16", "label": "print()", "type": "expression", "loc": [257, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8082, 0.0031, 4, 0.36, 0.1176, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"cur_ar_pose_2d\", cur_ar_pose_2d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L258_C16", "label": "ar_mkr = create_base_marker()", "type": "assigned_variable", "loc": [258, 258], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8113, 0.0031, 4, 0.36, 0.1471, 595, 3, 3, 0, 0, 210, 10, 1], "semantic": {"name": "ar_mkr", "arg_names": [], "import_names": [], "rhs_call_name": "create_base_marker", "annotation": ""}, "snippet": " ar_mkr = create_base_marker(cur_ar_pose_2d, 1, (1., 0., 0.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L259_C16", "label": "publish()", "type": "expression", "loc": [259, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8145, 0.0031, 4, 0.36, 0.1765, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.mkr_pub.publish(ar_mkr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L260_C16", "label": "ar_err = homo_mat_to_2d()", "type": "assigned_variable", "loc": [260, 260], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8176, 0.0031, 4, 0.36, 0.2059, 972, 3, 1, 0, 0, 550, 10, 1], "semantic": {"name": "ar_err", "arg_names": [], "import_names": [], "rhs_call_name": "homo_mat_to_2d", "annotation": ""}, "snippet": " ar_err = homo_mat_to_2d(cur_ar_pose_2d * goal_ar_pose**-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L261_C16", "label": "print()", "type": "expression", "loc": [261, 261], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8208, 0.0031, 4, 0.36, 0.2353, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"ar_err\", ar_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L262_C16", "label": "print()", "type": "expression", "loc": [262, 262], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8239, 0.0031, 4, 0.36, 0.2647, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"goal_ar_pose\", goal_ar_pose)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L265_C16", "label": "x_filt_err, x_filt_cov, x_unreli = update()", "type": "assigned_variable", "loc": [265, 265], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8333, 0.0031, 4, 0.36, 0.2941, 5, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "x_filt_err, x_filt_cov, x_unreli", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " x_filt_err, x_filt_cov, x_unreli = kf_x.update(ar_err[0], new_obs=new_obs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L266_C16", "label": "y_filt_err, y_filt_cov, y_unreli = update()", "type": "assigned_variable", "loc": [266, 266], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8365, 0.0031, 4, 0.36, 0.3235, 560, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "y_filt_err, y_filt_cov, y_unreli", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " y_filt_err, y_filt_cov, y_unreli = kf_y.update(ar_err[1], new_obs=new_obs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L267_C16", "label": "r_filt_err, r_filt_cov, r_unreli = update()", "type": "assigned_variable", "loc": [267, 267], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8396, 0.0031, 4, 0.36, 0.3529, 921, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "r_filt_err, r_filt_cov, r_unreli", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " r_filt_err, r_filt_cov, r_unreli = kf_r.update(ar_err[2], new_obs=new_obs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L269_C16", "label": "if", "type": "if", "loc": [269, 271], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [4, 4, 0.8491, 0.0094, 4, 0.36, 0.3824, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.any(np.array([x_unreli, y_unreli, r_unreli]) > [lost_tag_thresh]*3):\n self.base_pub.publish(Twist())\n return 'lost_tag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L270_C20", "label": "publish()", "type": "expression", "loc": [270, 270], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L269_C16", "vector": [8, 5, 0.8491, 0.0031, 5, 0.92, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(Twist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L271_C20", "label": "return", "type": "return", "loc": [271, 271], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L269_C16", "vector": [13, 5, 0.8522, 0.0031, 5, 0.92, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'lost_tag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L273_C16", "label": "print()", "type": "expression", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8585, 0.0031, 4, 0.36, 0.4118, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Noise:\", x_unreli, y_unreli, r_unreli)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L275_C16", "label": "ma = Float32MultiArray()", "type": "assigned_variable", "loc": [275, 275], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8648, 0.0031, 4, 0.36, 0.4412, 321, 3, 0, 0, 0, 704, 10, 1], "semantic": {"name": "ma", "arg_names": [], "import_names": [], "rhs_call_name": "Float32MultiArray", "annotation": ""}, "snippet": " ma = Float32MultiArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L276_C16", "label": "ma.data =", "type": "assigned_variable", "loc": [276, 277], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8695, 0.0063, 4, 0.36, 0.4706, 546, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ma.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ma.data = [x_filt_err[0,0], x_filt_err[1,0], ar_err[0], \n x_unreli, y_unreli, r_unreli]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L278_C16", "label": "publish()", "type": "expression", "loc": [278, 278], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8742, 0.0031, 4, 0.36, 0.5, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " err_pub.publish(ma)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L280_C16", "label": "print()", "type": "expression", "loc": [280, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8805, 0.0031, 4, 0.36, 0.5294, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"xerr\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L281_C16", "label": "print()", "type": "expression", "loc": [281, 281], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8836, 0.0031, 4, 0.36, 0.5588, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(x_filt_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L282_C16", "label": "print()", "type": "expression", "loc": [282, 282], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8868, 0.0031, 4, 0.36, 0.5882, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(x_filt_cov)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L283_C16", "label": "print()", "type": "expression", "loc": [283, 283], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.8899, 0.0031, 4, 0.36, 0.6176, 535, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Cov\", x_filt_cov[0,0], y_filt_cov[0,0], r_filt_cov[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L284_C16", "label": "x_ctrl = update_state()", "type": "assigned_variable", "loc": [284, 284], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8931, 0.0031, 4, 0.36, 0.6471, 684, 3, 1, 0, 0, 502, 10, 1], "semantic": {"name": "x_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "update_state", "annotation": ""}, "snippet": " x_ctrl = pid_x.update_state(x_filt_err[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L285_C16", "label": "y_ctrl = update_state()", "type": "assigned_variable", "loc": [285, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8962, 0.0031, 4, 0.36, 0.6765, 724, 3, 1, 0, 0, 502, 10, 1], "semantic": {"name": "y_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "update_state", "annotation": ""}, "snippet": " y_ctrl = pid_y.update_state(y_filt_err[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L286_C16", "label": "r_ctrl = update_state()", "type": "assigned_variable", "loc": [286, 286], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.8994, 0.0031, 4, 0.36, 0.7059, 676, 3, 1, 0, 0, 502, 10, 1], "semantic": {"name": "r_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "update_state", "annotation": ""}, "snippet": " r_ctrl = pid_r.update_state(r_filt_err[0,0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L287_C16", "label": "base_twist = Twist()", "type": "assigned_variable", "loc": [287, 287], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.9025, 0.0031, 4, 0.36, 0.7353, 685, 3, 0, 0, 0, 9, 10, 1], "semantic": {"name": "base_twist", "arg_names": [], "import_names": [], "rhs_call_name": "Twist", "annotation": ""}, "snippet": " base_twist = Twist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L288_C16", "label": "base_twist.linear.x =", "type": "assigned_variable", "loc": [288, 288], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.9057, 0.0031, 4, 0.36, 0.7647, 832, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_twist.linear.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_twist.linear.x = x_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L289_C16", "label": "base_twist.linear.y =", "type": "assigned_variable", "loc": [289, 289], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.9088, 0.0031, 4, 0.36, 0.7941, 277, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_twist.linear.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_twist.linear.y = y_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L290_C16", "label": "base_twist.angular.z =", "type": "assigned_variable", "loc": [290, 290], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.9119, 0.0031, 4, 0.36, 0.8235, 608, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_twist.angular.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_twist.angular.z = r_ctrl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L291_C16", "label": "cur_filt_err = array()", "type": "assigned_variable", "loc": [291, 291], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [14, 4, 0.9151, 0.0031, 4, 0.36, 0.8529, 789, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "cur_filt_err", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " cur_filt_err = np.array([x_filt_err[0,0], y_filt_err[0,0], r_filt_err[0,0]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L292_C16", "label": "print()", "type": "expression", "loc": [292, 292], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.9182, 0.0031, 4, 0.36, 0.8824, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"err\", ar_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L293_C16", "label": "print()", "type": "expression", "loc": [293, 293], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.9214, 0.0031, 4, 0.36, 0.9118, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Err filt\", cur_filt_err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L294_C16", "label": "print()", "type": "expression", "loc": [294, 294], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.9245, 0.0031, 4, 0.36, 0.9412, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Twist:\", base_twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L295_C16", "label": "if", "type": "if", "loc": [295, 297], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [4, 4, 0.9308, 0.0094, 4, 0.36, 0.9706, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(np.fabs(cur_filt_err) < goal_error):\n self.base_pub.publish(Twist())\n return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L296_C20", "label": "publish()", "type": "expression", "loc": [296, 296], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L295_C16", "vector": [8, 5, 0.9308, 0.0031, 5, 0.84, 0.0, 102, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(Twist())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L297_C20", "label": "return", "type": "return", "loc": [297, 297], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L295_C16", "vector": [13, 5, 0.934, 0.0031, 5, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'succeeded'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L299_C16", "label": "publish()", "type": "expression", "loc": [299, 299], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "vector": [8, 4, 0.9403, 0.0031, 4, 0.36, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.base_pub.publish(base_twist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L301_C12", "label": "sleep()", "type": "expression", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "vector": [8, 3, 0.9465, 0.0031, 3, 0.19, 1.0, 476, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " r.sleep()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "label": "main", "type": "function", "loc": [303, 315], "level": 0, "parent": null, "vector": [2, 0, 0.9717, 0.0409, 0, 0.66, 0.9583, 624, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"pr2_viz_servo\")\n assert(sys.argv[1] in ['r', 'l'])\n if sys.argv[1] == 'r':\n viz_servo = PR2VisualServoAR(\"/r_pr2_ar_pose_marker\")\n else:\n viz_servo = PR2VisualServoAR(\"/l_pr2_ar_pose_marker\")\n if False:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L304_C4", "label": "init_node()", "type": "expression", "loc": [304, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "vector": [8, 1, 0.956, 0.0031, 1, 0.3, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(\"pr2_viz_servo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L306_C4", "label": "if", "type": "if", "loc": [306, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "vector": [4, 1, 0.967, 0.0126, 1, 0.3, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.argv[1] == 'r':\n viz_servo = PR2VisualServoAR(\"/r_pr2_ar_pose_marker\")\n else:\n viz_servo = PR2VisualServoAR(\"/l_pr2_ar_pose_marker\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L307_C8", "label": "viz_servo = PR2VisualServoAR()", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L306_C4", "vector": [14, 2, 0.9654, 0.0031, 2, 0.08, 0.0, 476, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "viz_servo", "arg_names": [], "import_names": [], "rhs_call_name": "PR2VisualServoAR", "annotation": ""}, "snippet": " viz_servo = PR2VisualServoAR(\"/r_pr2_ar_pose_marker\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L309_C8", "label": "viz_servo = PR2VisualServoAR()", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L306_C4", "vector": [14, 2, 0.9717, 0.0031, 2, 0.08, 1.0, 476, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "viz_servo", "arg_names": [], "import_names": [], "rhs_call_name": "PR2VisualServoAR", "annotation": ""}, "snippet": " viz_servo = PR2VisualServoAR(\"/l_pr2_ar_pose_marker\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L310_C4", "label": "if", "type": "if", "loc": [310, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "vector": [4, 1, 0.9827, 0.0189, 1, 0.3, 1.0, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n viz_servo.save_ar_goal()\n elif False:\n viz_servo.servo_to_tag((0.55761498778404717, -0.28816809195738824, 1.5722787397126308))\n else:\n print(viz_servo.find_ar_tag(5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L311_C8", "label": "save_ar_goal()", "type": "expression", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L310_C4", "vector": [8, 2, 0.978, 0.0031, 2, 0.85, 0.0, 118, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save_ar_goal", "arg_names": [], "import_names": [], "rhs_call_name": "save_ar_goal", "annotation": ""}, "snippet": " viz_servo.save_ar_goal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L312_C4", "label": "if", "type": "if", "loc": [312, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L310_C4", "vector": [4, 2, 0.9858, 0.0126, 2, 0.85, 1.0, 0, 1, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif False:\n viz_servo.servo_to_tag((0.55761498778404717, -0.28816809195738824, 1.5722787397126308))\n else:\n print(viz_servo.find_ar_tag(5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L313_C8", "label": "servo_to_tag()", "type": "expression", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L312_C4", "vector": [8, 3, 0.9843, 0.0031, 3, 0.74, 0.0, 123, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "servo_to_tag", "arg_names": [], "import_names": [], "rhs_call_name": "servo_to_tag", "annotation": ""}, "snippet": " viz_servo.servo_to_tag((0.55761498778404717, -0.28816809195738824, 1.5722787397126308))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L315_C8", "label": "print()", "type": "expression", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L312_C4", "vector": [8, 3, 0.9906, 0.0031, 3, 0.74, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(viz_servo.find_ar_tag(5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L317_C0", "label": "if", "type": "if", "loc": [317, 318], "level": 0, "parent": null, "vector": [4, 0, 0.9984, 0.0063, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L318_C4", "label": "main()", "type": "expression", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L317_C0", "vector": [8, 1, 1.0, 0.0031, 1, 0.8, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L70_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L104_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L116_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L116_C48"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L150_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L151_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L150_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L152_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L177_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L178_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L177_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L182_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L184_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L185_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L186_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L187_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L191_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L195_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L195_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L196_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L197_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L194_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L198_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L200_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L200_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L201_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L202_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L189_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L206_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L207_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L208_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L205_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L209_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L209_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L210_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L219_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L218_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L240_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L240_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L242_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L245_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L246_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L248_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L251_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L252_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L256_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L257_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L259_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L260_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L261_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L262_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L265_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L266_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L267_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L269_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L269_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L270_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L269_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L271_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L273_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L275_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L276_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L278_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L280_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L281_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L282_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L283_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L284_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L285_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L286_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L287_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L288_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L289_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L290_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L291_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L292_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L293_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L294_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L295_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L295_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L296_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L295_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Return_L297_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L249_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L299_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:While_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:FunctionDef_L303_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L310_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99274:If_L317_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99274:Expr_L318_C4"}] |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Sat Feb 11 08:02:58 2012
# by: The Resource Compiler for PyQt (Qt v4.6.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x05\x49\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x86\x00\xaf\x00\xd2\x7d\x1c\x57\xe8\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x26\x1f\x6d\x51\x59\xe5\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x04\xa4\
\x49\x44\x41\x54\x78\xda\xed\x9c\x6d\x4c\x95\x65\x1c\x87\x2f\x0e\
\x07\xe4\x25\x20\x44\xc0\x17\x40\x8c\x06\x44\x93\x35\x60\xb1\x26\
\x99\x58\x89\xbd\x20\x4d\x93\x29\x81\x03\x35\x5d\x22\xd8\x26\xa1\
\x91\xc6\x91\x42\x2b\x4d\x04\x53\x81\x15\x30\x28\x0d\x35\x0c\x6b\
\x24\x86\x4c\xc0\x66\x33\xd8\xa2\x35\x8c\xa6\x19\x2e\x9d\x6b\x34\
\x4b\x09\x90\x97\x73\xfa\x70\x60\xa3\xd6\xda\x79\x1e\xce\x49\x38\
\xe7\x7f\x7d\x3a\x5f\x9e\x7b\x3b\xd7\xfe\xf7\xdb\xef\xb9\xef\x07\
\x04\x41\x10\x04\x41\x10\x04\x41\x98\x74\x38\x02\x9e\x93\xf9\x0f\
\x68\xee\xb2\xbc\x1a\xe0\x3e\xa9\x23\xe5\x68\x81\x93\x80\x01\x88\
\x14\x1d\xca\xab\xbe\x6a\x44\x9e\x08\x54\xc1\xfe\x31\xf2\x44\xa0\
\x42\x74\x80\xc1\x5e\xeb\x20\x02\x55\x90\x01\x18\xec\x34\x1a\x43\
\xf2\xd6\x7d\x86\x99\x41\x61\x56\x21\xf0\xff\x9a\x85\x53\x80\x42\
\x80\x65\xe9\x3b\x08\x8b\x5e\x68\x55\x03\xba\xa5\x59\x02\x94\x01\
\x76\xcf\xac\xce\x26\x62\x61\x82\xd5\xcd\x88\x96\xe4\x31\xa0\x1a\
\xd0\xc6\x2e\x5f\xc7\xbc\xf8\x64\xab\x5c\x52\x58\x8a\x48\xe0\x33\
\xc0\x29\x7a\x71\x22\x4f\x26\x6d\xb4\xda\x35\x99\x25\x08\x05\xbe\
\x00\xdc\xe6\xce\x8b\x23\xfe\xc5\x1c\xab\x5e\xd4\x9a\x9b\x00\xa0\
\x1e\xf0\x0e\x89\x7c\x94\xc4\x97\x77\xa2\xd1\x68\x44\xa0\x89\x78\
\x8f\xc8\x0b\x08\x7c\x20\x82\x95\xaf\xec\xc1\x5e\xeb\x60\xf5\xdb\
\x2a\x73\xe1\x3e\xd2\x6d\x43\x67\x04\x86\x90\xf2\x5a\x11\x8e\x53\
\x9c\x6d\x62\x5f\x6a\x0e\x9c\x81\x5a\x20\xd2\x6b\x46\x00\xa9\xb9\
\xc5\x38\xbb\xba\xdb\xcc\xc6\x7e\xbc\x68\x47\x96\x2a\x0b\xdc\xa7\
\xfa\xb0\x5a\x57\x82\xdb\xbd\x5e\x36\xb3\xbd\x1a\xaf\x40\x3b\xa0\
\x1c\x88\x77\x76\xf3\x20\x4d\x57\x82\xa7\xcf\x2c\x9b\xda\x9f\x6a\
\xc7\xf9\xfc\x3e\x20\xd9\xd1\xc9\x85\xd4\x6d\x07\xf1\xf5\x0f\x52\
\xd3\x46\x0b\xd0\x36\x81\x1d\x7d\x04\x14\x5b\x42\x60\x2e\x90\x69\
\xaf\x75\x20\xe5\xd5\x42\xfc\x83\xe7\x8e\x67\xfc\x8c\x99\xc0\x02\
\xbf\xb2\x44\x05\x6e\x04\x74\x76\x1a\x0d\x2b\xb2\x76\x13\x14\x1e\
\xad\xb8\x81\xa5\xe9\x3a\x06\xfa\x7a\x27\xac\xb5\xa6\x13\x65\x74\
\xb6\x36\x5b\xa4\x0b\xbf\x00\x14\x01\x2c\xdd\xa0\xe3\x41\x95\xc9\
\xca\xcc\x39\xa1\x13\x7a\x6c\xeb\xfa\xe1\x5b\x93\x04\x2a\x9d\x44\
\x9e\x05\x2a\x00\xbb\xa7\x53\xb3\x88\x7c\xfc\x39\x6c\x1d\x25\x02\
\xe7\x03\x47\x01\xed\x82\x65\x6b\x89\x49\x58\x85\x60\xba\xc0\x08\
\x8c\xc9\x8a\xf3\xc3\x71\xcb\x59\x94\x9c\x29\xe6\x14\x08\x0c\x06\
\xea\x00\xf7\xf0\x98\xc5\x2c\xb1\xe2\x64\xc5\x12\x02\xfd\x80\xd3\
\x80\x6f\x70\x44\x0c\xcf\x67\xe6\xa3\xb1\xb7\x17\x6b\x26\x0a\x9c\
\x06\x7c\x09\xcc\x9e\x1d\xfa\x10\x49\xd9\xef\xa2\x75\x70\x10\x63\
\x26\x0a\x74\x63\x24\x59\x99\x1e\x18\xcc\xaa\x6d\xef\xd9\x44\xb2\
\x62\x2e\x81\x4e\x18\x93\x95\xa8\xa9\xd3\xfd\x49\x7b\xdd\x76\x92\
\x15\x73\x08\xb4\xc7\x98\xac\xc4\xba\x79\x7a\xb3\x66\x47\x29\x6e\
\x9e\xd3\xc4\x92\x02\x81\x87\x30\xbe\x86\x24\x2d\xb7\xd8\xe6\x92\
\x15\x73\x08\xfc\x78\xf4\xc7\x37\xa7\x8f\x8b\x1d\x15\x02\x1b\x81\
\x27\x80\x81\xf3\x75\x47\x68\x38\x72\x40\x0c\xa9\x98\x44\xce\x00\
\x89\xc0\x70\xe3\xd1\x12\xce\xd5\x56\x8a\x25\x15\xcb\x98\x5a\x20\
\x0d\x30\xd4\x55\xec\xa1\xed\xcc\xa7\x62\x4a\xc5\x42\xba\x0a\xd8\
\x04\x50\x73\x50\xc7\xf7\xe7\x1b\xc4\x96\x8a\xad\xdc\x7e\x20\xd7\
\xa0\xd7\x53\xbd\x37\x9b\x4b\xed\x5f\x8b\x31\x15\x61\x42\x1e\x50\
\x30\x3c\x34\x44\xd5\xae\x4d\x5c\xed\x6c\x17\x6b\x0a\x05\x02\x6c\
\x06\x2a\x06\xef\xf4\x51\xf1\x46\x3a\x37\xba\x7e\x14\x73\x0a\x05\
\x1a\x80\xb5\x40\x4d\xff\x9f\xb7\x28\xd3\xad\xa7\xfb\x7a\x97\xd8\
\x43\x59\x22\x3d\x0c\xac\x04\x1a\x7a\x7e\xff\x8d\x32\xdd\x7a\xfe\
\xe8\xbe\x61\xf3\x02\xed\x54\x3c\xe3\x8a\x31\xe6\x7a\xc4\xdb\x6f\
\x0e\xeb\xf2\x2b\x70\x75\x57\x76\xd9\xe8\xf6\xcd\x6e\xda\x1a\x6b\
\x27\xb4\x98\xe6\x9a\x32\xfa\x7b\x6f\x03\xbc\x0d\x6c\x35\xa7\x40\
\x30\x5e\xcf\x3a\x0b\x84\xcf\x0a\x0a\x63\x4d\xde\xfb\x38\xb9\xdc\
\x63\xf2\xc3\xd7\x2e\x77\x70\x20\x6b\xc5\x64\x29\xb2\xff\x14\xa8\
\xf6\xbd\xf0\x4d\x20\x0e\x68\xb9\x76\xb9\xe3\xfe\xaa\x9d\x19\xa4\
\x6e\x3f\x84\xc3\x14\x27\x35\x6d\xbd\x35\xc1\x05\x36\x99\xbb\x0b\
\x8f\x25\x10\xe3\xd1\x0c\xbf\x90\xa8\xf9\x24\x6f\x29\x30\xe9\x3c\
\xe0\x98\x0a\x6c\x03\xa2\x6c\x65\x12\xf9\x37\x7e\x06\x16\x01\xdd\
\x9d\xad\xcd\x1c\x2f\xda\x8e\x5e\xaf\x97\x59\x58\x21\x17\x81\xa7\
\x80\x5b\xed\x2d\x75\x9c\x2c\xcd\x17\x81\x2a\x68\x05\x12\x80\xbe\
\x0b\xf5\xc7\xa8\xff\xb0\x50\x04\xaa\xe0\x2c\xc6\x18\x6c\xb0\xe9\
\x93\x0f\x68\x3e\x51\x2e\x02\x55\xf0\x39\x90\x0a\xe8\x4f\x55\x16\
\x70\xc1\x06\x52\x6d\x4b\xdc\x3f\x38\x0c\xa4\x03\xd4\x96\xbc\xc9\
\x77\xe7\x4e\x89\x40\x15\x14\x03\x39\x06\xbd\x9e\x63\x85\x39\x74\
\xb6\xb5\x88\x40\x15\xec\x02\x76\x0f\x0f\x0d\x71\xf8\x9d\xcd\x5c\
\xe9\x68\x13\x81\x2a\xd8\x02\x94\x0e\x0e\xf4\x53\x99\x9f\xc1\xf5\
\x9f\x2e\x8a\x40\x85\x18\x80\x0d\x40\xf5\x9d\xde\x1e\xca\xf3\x5e\
\xe2\xd7\x5f\xae\x20\x28\xc7\x11\xe3\x11\x39\x83\x87\x97\xaf\x21\
\x29\x7b\xef\xe8\x6d\xf5\x56\x51\x63\x3a\x2e\x40\x33\x7f\xff\xe0\
\x84\x08\x54\x88\xc7\x48\x80\x30\x2a\xf0\x92\x28\x51\x8e\xcf\x3f\
\xaa\x50\x50\x41\x00\xc6\x4c\x71\xd2\x77\xe1\xbb\x75\x13\xfa\x2a\
\x10\x0b\xf4\x48\x2d\x8d\x8f\x60\x51\x20\x08\x82\x20\x08\x82\x20\
\x4c\x46\xfe\x02\x33\x9f\x39\x87\x30\x36\x3e\x1c\x00\x00\x00\x00\
\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x0b\xa7\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x34\x27\x3d\xa7\x91\xa8\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0b\x02\
\x49\x44\x41\x54\x78\xda\xed\x9c\x7b\x54\x55\x55\x1e\xc7\x3f\xbc\
\xdf\x20\x04\xa2\x80\x9a\xa9\x08\x9a\x26\xe0\xf8\x48\xb3\xd4\x74\
\x95\x96\x66\x53\x9a\x4d\x96\xcb\x69\x4d\x66\x63\x63\x35\x65\x69\
\x35\x53\x8e\x39\x34\x3e\xa6\xb1\x87\x4d\xa6\x46\x38\x61\xa3\x96\
\x8f\xc4\xa8\x44\x4d\x4a\x11\x41\x44\x45\x01\x79\x28\x28\xc8\xfb\
\xfd\xb8\x8f\x33\x7f\x9c\xb3\xe9\x4e\xc9\xb9\x17\xbc\xc0\xad\xce\
\x77\xad\xbb\xd8\xe7\x9c\xdf\xbe\x67\xdf\xef\xd9\x7b\xff\x9e\x07\
\xd0\xa0\x41\x83\x06\x0d\x1a\x34\x68\xf8\x59\xc2\xce\x86\xc7\xe6\
\x03\xf4\x01\xfc\x95\xb6\xb3\xc9\x35\x03\x50\x09\x54\x00\xc5\x40\
\xc9\xaf\x9d\xc0\x40\x60\x12\x30\x06\x88\x04\x86\x00\x7e\xed\xe8\
\x5f\x0f\x9c\x07\xd2\x81\x64\xe0\x10\x90\xf9\x4b\x27\xb0\x2f\xf0\
\x28\x30\x03\x88\x02\xec\x4d\x2f\x3a\x39\xbb\xe2\xed\x1f\x88\xbb\
\x97\x0f\xee\x9e\x3e\x38\xb9\xb8\x01\x20\x19\x0d\xe8\xf5\x3a\x74\
\x4d\x8d\xd4\x55\x95\x53\x55\x56\x4c\x4b\x53\xc3\xb5\xbe\x3f\x1f\
\xd8\x0f\x7c\x02\x7c\x0b\x48\xbf\x14\x02\x23\x81\xa5\xc0\x03\x82\
\x34\x27\x67\x57\xfa\x85\x8f\xa0\x5f\x78\x24\x7d\x42\x87\xd1\xab\
\x5f\x28\xde\x7e\x01\x16\x7f\x61\x63\x5d\x0d\x25\x97\x2e\x70\x39\
\x37\x93\x82\xcc\x34\x72\x33\x92\xa9\xaf\xa9\x34\x15\xc9\x02\xde\
\x04\x62\x81\xe6\x9f\x2b\x81\xa1\xc0\x3a\x60\x9a\x38\x71\xcb\x84\
\x69\xdc\x3c\x76\x0a\xa1\x11\xe3\x70\x72\x71\xb5\xda\x8d\x24\x49\
\xe2\x72\x6e\x26\xa7\x8e\xec\xe7\xc4\x37\x9f\xd3\x50\x5b\x25\x2e\
\x5d\x01\xfe\x06\xfc\x1b\xd0\xff\x5c\x08\xb4\x07\x9e\x55\x06\xee\
\x02\x30\x7e\xc6\xa3\x8c\x9f\xf9\x58\xbb\x66\x59\x47\x61\x30\xe8\
\x39\x9d\x94\xc0\xe1\xcf\x36\x73\x25\xff\xbc\x38\x9d\x02\xcc\x07\
\xce\xd8\x3a\x81\xbd\x81\x38\x60\x02\xc0\x2d\xb7\x4d\xe3\x9e\xc7\
\x97\xe2\xe1\xed\xdb\xe5\xfb\x86\x24\x49\x9c\x39\xfa\x35\xbb\xde\
\x5f\x49\x7d\x75\x05\xca\x52\x7e\x19\x58\x73\x3d\xfb\x63\x67\x12\
\x38\x14\x48\x00\x82\xdc\x3c\xbd\x99\xbd\x64\x15\x83\xa3\x6e\xeb\
\x76\x75\xdf\xdc\x58\x4f\xfc\x96\x35\x24\x27\x6c\x17\xa7\x3e\x55\
\x94\x59\xb3\x2d\x11\x18\x09\x7c\x05\xf8\x05\x0f\x1c\xca\x63\xcb\
\xdf\xc6\xb3\xc7\x0d\x36\x65\x64\x9e\x39\x76\x80\x6d\x6b\x5e\x40\
\xaf\x6b\x01\x48\x04\x66\x02\xb5\xb6\x40\xe0\x30\xe0\x08\xe0\x1d\
\x36\xf2\x76\xe6\x3e\xbf\x1a\x27\x67\x97\x0e\x7d\x91\x5e\xd7\x42\
\x45\x71\x21\x35\x15\x57\x69\xac\xab\x69\x3d\xef\xe8\xec\x8c\xbb\
\x57\x0f\xfc\x02\x43\xf0\xf2\xf5\xef\xf0\x40\x8b\x0b\xb2\xd9\xfc\
\xda\x13\xd4\x56\x96\x01\x1c\x05\xa6\x00\x75\xdd\x49\xa0\xbf\xb2\
\x41\xf7\x0b\x8d\x1c\xcf\xbc\x97\xde\xc2\xc1\xd1\xc9\xe2\xce\x4d\
\x0d\x75\x64\xa5\x26\x71\x2e\xe5\x10\x17\xcf\x9f\xa4\xb2\xa4\x08\
\x49\x52\xdf\x9e\x9c\x5d\xdd\x08\xea\x1f\xce\x4d\xc3\x47\x11\x16\
\x35\x81\xa0\x01\x43\xb0\xb7\xb7\xb7\xf8\x9e\x95\x57\x8b\x78\x7f\
\xd9\x7c\x6a\xca\x4b\x00\xf6\x02\xf7\x29\x9e\x4e\x97\x13\xe8\x00\
\xec\x03\xa6\x06\x0f\x18\xc2\x13\xab\x3e\xc6\xd1\xc9\x32\xf2\x4a\
\x8b\xf2\x38\xb8\xe3\x43\x32\x8e\xec\x17\x4b\x4a\x40\xa7\x18\xc4\
\x57\x95\x8f\xde\xc4\xcd\xeb\x05\x84\xfc\xd8\x63\xf1\x0d\x0c\x61\
\xcc\xdd\x73\x18\x35\xf5\x41\x5c\xdc\xdc\x2d\xbe\xff\x86\x17\xe7\
\x89\x59\xbe\x1a\x78\xbe\x3b\x08\x7c\x11\x58\xe5\xe6\xe9\xcd\xd3\
\xeb\xb6\xe3\xe3\xdf\xcb\x6c\x87\x86\x9a\x2a\xe2\x63\xd6\x92\x9a\
\xb8\x1b\xc9\x68\x14\xa7\x93\x80\x2f\x80\x78\xe0\xb4\x05\xf6\x5a\
\x00\x30\x1e\xb8\x13\x98\xad\xac\x02\xdc\x3c\xbd\xa5\xc9\x73\x9e\
\xb4\x1b\x73\xf7\x43\xd8\x3b\x38\x98\x1d\x4b\xde\x99\x14\x3e\x78\
\x79\x81\x38\xbc\x0f\xd8\xd5\x95\x04\xf6\x57\x7c\x4f\x97\xf9\xaf\
\xbc\x4b\x68\xe4\x78\x8b\x06\xbc\x6d\xed\x8b\xd4\x54\x5c\x15\xa7\
\x36\x00\x6b\x81\xec\xeb\xb4\x39\xa7\x2b\x9e\xce\x38\x80\x7e\xe1\
\x11\xcc\x5e\xf2\x06\xbe\x3d\x83\xcd\x76\x4e\xda\xf3\x31\x5f\x6c\
\xfa\x07\x40\x29\x10\xa6\x04\x2b\xcc\x2e\x3b\x6b\x20\x16\x08\x8f\
\x98\x38\x83\x09\xf7\xcd\x37\x2b\x9c\x76\x70\x0f\x5b\xdf\x7c\x8e\
\xa6\x86\x5a\x61\xd4\x4e\x04\x62\x2c\x19\xb0\x39\x73\x4f\x71\xdb\
\x36\x29\xb3\xf7\xf6\xea\xb2\x62\xcf\xb4\x83\x7b\xa4\x7e\xe1\x11\
\x76\x3d\x02\x7a\xab\x76\xee\x13\x3a\x9c\xfc\xb3\xa9\x54\x5e\x2d\
\xf2\x50\x6c\xd8\xcf\x2d\x79\x62\xd7\x8b\x3b\x80\xe9\x8e\xce\x2e\
\xdc\x35\x6f\x89\x59\xe1\xf4\xc3\xfb\xd8\xbe\xfe\x15\x8c\x06\x3d\
\xc0\x7a\x60\xac\xf2\xa3\xad\x8d\x1d\x4a\x54\x27\xb1\xb1\xae\xc6\
\x6e\xf3\x5f\x9f\x90\x72\x4f\x1f\x57\x5f\x8e\x76\x76\xcc\x7a\xf2\
\x55\xec\xed\x1d\x00\xe6\x01\xa3\xbb\x62\x06\x7e\x08\xf4\x9f\x34\
\x7b\x21\x61\x23\x27\xa8\x0a\xe6\x67\xa6\xb1\x35\x7a\x09\x46\x83\
\x01\x60\x19\xb0\x1c\x30\x76\xa2\xb9\xd7\xa8\xac\x8e\x10\xa3\x41\
\x1f\x99\xf1\xdd\x57\x84\x45\x4d\x50\x35\x7d\xdc\xbd\x7c\xd0\xb5\
\x34\x51\x90\x99\x66\xa7\x6c\x4d\x31\x9d\x39\x03\x23\x80\x49\x2e\
\x6e\x1e\x8c\x9d\x3e\x57\xdd\x44\xa9\xaf\xe5\xd3\x75\x2f\x61\xd0\
\xeb\xc5\x7e\xb7\xaa\x8b\x6c\x66\x03\xf0\x38\xf0\x99\xae\xb9\x91\
\xad\x6f\x3e\x43\x63\x7d\x8d\x6a\x87\x09\xf7\x2f\xc0\xd5\xdd\x0b\
\x60\xb2\xa2\xa0\x3a\x8d\xc0\xc5\x00\x91\x93\x66\xe2\xe6\xe1\xad\
\x2a\xf8\x65\xec\x5b\x54\x95\x5e\x06\x38\x09\x3c\xdd\xd5\xae\x30\
\xf0\x30\x70\xba\xa2\xb8\x90\xbd\x1b\xa3\x55\x85\xdd\x3c\xbc\x19\
\x33\xed\x21\x71\xf8\xe7\xce\x22\xd0\x1d\x78\x10\xe0\xd6\xe9\x0f\
\xab\x0a\x5e\x2d\xcc\xe3\x78\xc2\x0e\x71\xf8\x3b\xc5\xbe\xeb\x6a\
\x34\x01\xf7\x03\xc6\xb4\x83\x7b\xc8\x3d\x9d\xa2\x2a\x3c\xee\xde\
\x47\x44\xf3\x1e\xc5\xde\xb4\x3a\x81\xf7\x02\x9e\x7d\x06\x0f\xe7\
\x86\xde\x7d\x55\x05\x0f\xed\xd8\x88\xd1\x68\x40\xd1\x8e\x67\xbb\
\xd1\x05\xce\x56\xc2\x6a\xc4\x6f\x59\xad\xea\xe5\x78\x78\xfb\x32\
\x6c\xdc\x54\xa1\x27\xe6\x77\x06\x81\xbf\x05\x18\x3a\x7a\xb2\xaa\
\x50\x5d\x55\x39\xa7\x8e\xc4\x8b\xc3\xd7\x6d\x20\x8e\xf0\x77\xa0\
\xbc\xe8\xc2\x59\xb2\xd3\x92\xd4\x37\xf8\xdb\xef\x15\xcd\xb9\xd6\
\x26\xd0\x5e\x71\xbc\xb9\x79\xec\x14\x55\xc1\x13\x89\xbb\x84\xe2\
\xd8\x03\x14\xd8\x00\x81\x8d\x40\x34\xc0\xa1\x9d\x9b\x54\x05\x07\
\x45\x8e\x13\xca\x64\x08\x72\x44\xdd\x6a\x04\x46\x00\x3d\x7c\x7b\
\x06\xe3\xd7\x2b\x44\x55\x30\xe3\xc8\x97\xa2\xb9\xd9\x86\xa2\x59\
\x1b\x00\x29\xef\x4c\x0a\x15\xc5\x85\x6d\xdb\x78\x0e\x8e\x84\x46\
\x8e\x33\xdd\x0b\xad\x46\xe0\x78\x80\x1b\x87\x46\xa9\x0a\xd5\xd7\
\x54\x72\x25\xef\x9c\x38\x8c\xb7\x21\x02\x6b\x91\x03\xa9\x64\x7c\
\x9f\xa0\x2a\x18\x1a\xd1\x4a\xe0\x24\x6b\x12\x18\x09\xd0\x67\xd0\
\xcd\xaa\x42\x97\xb2\x32\xc4\x46\x7d\x48\xd1\x82\xb6\x84\x9d\x00\
\x39\x69\xdf\xab\x0a\xdd\x34\x6c\x94\x68\x8e\xbd\x56\xec\xa0\xa3\
\x04\x0e\x07\xe8\xdd\x3f\x4c\x55\xa8\x30\xe7\xb4\x68\xa6\x62\x7b\
\xf8\x5a\xf6\x8e\x52\xd1\xb5\xb4\x1d\xcd\xef\x11\xd0\x5b\x78\x2e\
\x7e\xc0\x20\x6b\x11\x18\x0a\x10\xd8\x67\x80\x7a\x9c\xad\x30\xaf\
\x35\x7e\x60\x83\x04\x56\x00\x67\x0d\x7a\x1d\x57\x72\xcf\xa9\x0a\
\xf6\xba\x71\xb0\x68\x8e\xb0\x06\x81\xbd\x00\x77\x37\x2f\x1f\x5c\
\x3d\xbc\x54\x05\xcb\xaf\x5c\x14\xcd\x2c\x6c\x13\xc7\x01\x2e\xe7\
\xa9\x13\x18\xd8\x77\xa0\x68\x86\x59\x83\xc0\x10\x00\x6f\xdf\x9e\
\xe6\x77\xea\xca\x52\xd1\x2c\xb2\x51\x02\xcf\xca\x2b\x25\x57\x55\
\xc8\x3f\xa8\x5f\xeb\x96\x68\x0d\x02\xfd\x64\x4b\xbd\x87\x59\xc1\
\x86\xda\x6a\xd1\x2c\xb3\x51\x02\x2f\x02\x54\x96\x5e\x51\x15\x32\
\x09\xc6\x86\x58\x83\x40\x5f\x00\x37\x4f\x1f\xf3\x61\x10\xbd\xce\
\xd4\x0f\xb5\x45\x14\xc9\xde\x92\xfa\xf3\xf5\xf0\x69\x2d\x04\xf8\
\x49\x1c\xcc\x51\xf9\xeb\x83\x5c\x41\x10\x80\x5c\x29\x95\x4a\xdb\
\xd9\xfa\x28\x00\x47\x27\xe7\xf6\x0c\x34\xc5\xcc\x75\x71\xcf\x7a\
\x25\x6a\x52\xd8\x45\x04\xd6\x03\xe8\x9a\xd5\x73\xea\xae\x6e\x9e\
\xa2\x19\xd0\x16\x81\xd5\xc0\x5f\x91\x73\xa3\xad\x76\x9e\xaa\x3f\
\x64\x26\xa6\x26\x48\x56\xb2\x6c\x51\x16\xda\x96\x33\xbb\x90\x3c\
\x84\x5d\xd7\x46\x79\xdc\x8f\xa4\x80\x6b\x24\xb8\x1c\x4d\xda\xc7\
\x94\xf0\xd4\x7f\x01\x46\x4e\x9e\xc5\xe8\xbb\xe7\xb4\xfd\x54\xdc\
\x3d\xcd\x8e\x6e\x61\x74\xac\x69\xb6\xed\x27\xc8\x39\x75\x94\x2f\
\x63\xfe\x29\x0e\x5f\x05\x76\x77\xf1\x12\x76\x94\xb7\x23\xf5\x58\
\x66\x43\x4d\x95\xa9\xe9\xd3\x26\x81\x00\xdb\x91\xeb\x44\x62\x4e\
\x24\xee\x22\x7c\xd4\x1d\x84\x8f\x9a\xd8\xe1\xd1\x05\xa9\x18\xda\
\xc5\x05\x59\x1c\xdc\xbe\xd1\x34\x42\xb2\xa2\x1b\xf6\xc0\x10\xc0\
\x6c\xd9\x89\x49\xad\xe1\x55\x4b\x94\xc8\xc7\xc0\x32\xc9\x68\x64\
\x6b\xf4\xb3\x5c\x38\x75\xcc\xea\xa3\xae\x2a\x2b\x66\xcb\x8a\xa7\
\x68\x6e\xa8\x03\xd8\x8a\x9c\x1f\xe9\x0e\x84\x01\x04\x04\xf7\x37\
\x3b\x5e\x53\xad\x6d\x89\x16\x5e\x05\xbc\x67\x34\x1a\x88\x8d\x7e\
\x86\xe2\x02\xeb\xd9\xc1\x4d\xf5\xb5\x7c\xb4\x62\x91\x28\xa5\x48\
\x04\x16\xd0\x49\xe5\xb7\x16\x60\x84\xec\x92\x0e\x56\x15\x2a\x2b\
\xca\x17\xcd\xfc\xf6\x98\x31\x8b\x81\x1d\xcd\x0d\x75\x6c\x59\xf1\
\x14\xd5\x3f\x3c\x85\x0e\x43\xaf\xd3\x11\x1b\xfd\x0c\x25\x17\x73\
\x40\x2e\x6e\x9c\x05\xb4\x74\xa3\x19\x33\x11\x20\xe8\xa6\x70\x55\
\xa1\xe2\xfc\xd6\x09\x94\xd9\x1e\x02\x0d\x8a\x49\x71\xa0\xa6\xbc\
\x84\x2d\x2b\x16\x51\x57\xdd\xf1\xbc\xb7\x24\x49\xec\x78\xfb\x15\
\x72\x33\x92\x51\x34\xed\x5d\x8a\xf6\xa7\x1b\x67\xdf\x0d\x1e\x3e\
\x7e\xa6\xae\xda\x35\xc7\x7d\x39\xaf\x95\xb7\xe4\xf6\x1a\xd2\x2d\
\xc8\x89\x98\x8c\x92\x8b\x39\xc4\xac\x5c\x4c\x4b\x73\x63\x87\x46\
\x9b\x10\xfb\x16\xe9\x87\xf7\x01\xd4\x20\xd7\x49\x17\xd2\xbd\x78\
\x04\x60\xe8\x98\xc9\xd8\xd9\xb5\x5d\xe1\x52\x5a\x94\x2f\x8a\x8e\
\x8a\xaf\x35\x66\x4b\x3c\x91\x6a\xf1\x83\x0b\xb3\x33\x88\x5b\xb3\
\x54\x24\xc6\x2d\xc6\xd1\xf8\x6d\x22\x7c\xde\xa2\x2c\xdb\x8c\x6e\
\x26\xcf\x03\xf8\x03\xc0\xc8\x3b\xef\x57\x15\xcc\x49\x6f\x8d\x17\
\x1e\xba\xd6\x75\x4b\x5d\xb9\x42\x65\xbf\x28\x3d\x77\xfc\x20\x7b\
\x36\x5a\x9e\x13\xcf\x4c\x4e\x14\xf2\x92\xa2\x30\x0e\xd8\x80\x0b\
\xb7\x08\xf0\xea\x13\x3a\x9c\x90\x81\x43\x55\x05\xcf\x9f\xf8\x56\
\x34\xf7\x5f\x0f\x81\x00\x39\xc8\xa9\xcc\x86\x63\xfb\x3f\xe5\xeb\
\xb8\x77\xcd\x76\xb8\x94\x75\x8a\xb8\x35\x4b\x85\x31\xbd\x4c\x31\
\x59\xba\x1b\x21\xc8\xef\x8c\x70\xe7\xdc\xa7\xcc\x7a\x5b\x39\x27\
\xbf\x13\xfa\x60\xef\xf5\x12\x28\xbc\x95\xb9\x80\xe1\xc0\xb6\x0d\
\x1c\x8d\xdf\xd6\xa6\x60\xf9\x95\x8b\xc4\xac\x5c\x8c\xae\xa5\x09\
\xe0\x3d\xc5\x58\xee\x6e\xb8\xa0\x54\x5c\x85\xfd\xe6\x0e\x06\x8d\
\x18\xab\x2a\x9c\x91\x94\x60\x9a\x92\x28\xb3\x06\x81\x28\xee\xd6\
\x1f\x01\x69\xcf\xc6\x55\x9c\x3d\xf6\xd3\x15\x59\x57\x5d\xc1\xe6\
\xd7\x17\x0a\x0b\x7e\xb7\x62\x12\x75\x37\x5c\x91\x53\xab\x51\x5e\
\xbe\x01\xcc\x5a\xf4\x17\xb3\x1d\x4e\x7c\xd3\x5a\xdd\x16\xdb\x96\
\x4c\x47\x43\xfa\x1b\x84\xb7\x12\xb7\x76\xa9\x74\xf1\x7c\xfa\x0f\
\x6a\xbb\xb9\x91\x98\x95\x8b\x45\xba\xb0\x75\xc6\x76\x33\x79\x83\
\x91\xa3\xe2\x53\xdc\x3c\xbd\xa5\x47\x97\xaf\xc7\xcb\x8c\xfb\x56\
\x70\xee\x24\x97\xb2\x4e\x09\xff\x37\xce\xda\x04\x0a\xff\x75\x83\
\xbe\xa5\xd9\x6e\xf3\x6b\x0b\x29\x2e\xc8\xc2\x68\x30\x10\xb7\x66\
\x29\x85\xd9\x19\x00\x17\xc4\x9e\x69\x03\xb3\x6f\x10\xf2\xab\xb3\
\x3c\xb6\xfc\x1d\xbb\xe0\x01\x43\xcc\x76\x38\xfc\x59\x6b\x1a\x7b\
\x13\x72\x32\xfe\x9a\xb8\xde\xfa\xc0\xfd\xc0\x08\x83\x5e\x37\x38\
\xf3\xf8\x21\x72\x4f\x27\x73\x3e\xe5\x30\xca\x7e\x31\xd1\x06\x6c\
\x3d\x53\x05\x38\x03\xe8\xed\xea\xe1\xc5\xa0\x88\x5b\xcd\x28\xbf\
\x0c\xe2\x3f\x5a\x03\xf2\xcb\x37\x0f\xa1\xf2\xea\xc3\xf5\x96\xb7\
\x19\x94\x25\x7a\xa4\xa6\xbc\x44\xa8\xfc\x46\xe4\x2c\x7e\x0e\xb6\
\x03\x23\x72\x8d\xa0\x21\x69\x6f\x2c\x97\x73\x33\x55\x3d\x8f\xdd\
\x1f\xbc\x21\x0e\xd7\x21\xbf\xa0\x48\x67\x11\x88\xb2\x44\xef\x41\
\xae\x49\x46\x21\xf4\x18\xb6\x87\x54\x60\xbd\x64\x34\xb2\xf3\xdd\
\xd7\xda\x74\x06\xbe\xdf\xf7\x09\x45\x39\x67\x44\xe8\xca\xac\xc1\
\x6b\xad\x22\xf3\x66\x45\xc3\x9d\x51\xdb\x70\x6d\x00\x49\xc0\x23\
\xb5\x95\xa5\x3e\xae\x1e\x5e\xf4\x1d\x7c\xcb\xff\x07\x0d\x0a\xb2\
\x89\x5b\xfd\x82\xa8\xdf\x5e\x80\x05\x05\x01\xb6\xfc\x3f\x13\x3a\
\x0b\xd3\x81\xbd\x4e\xce\xae\xfc\xe9\x5f\x3b\xf1\x0b\x94\x13\x6d\
\xb5\x55\xe5\xbc\xf3\xdc\x1c\xf1\xda\xc5\x26\xe0\xf7\x68\x68\x13\
\xff\x01\xa4\x01\xc3\x46\x4b\x2b\x77\xa6\x4b\xcb\x36\x27\x4a\x81\
\x7d\x07\x4a\x8a\xbb\x99\x8e\x5c\x7d\xab\x41\x05\xfe\xc8\x2f\xd3\
\x48\xa3\xa6\x3e\x20\x79\xf9\xfa\x0b\xf2\x32\x81\x60\x8d\x1e\xcb\
\xf0\x80\x42\x9a\xf8\xa4\x02\x3d\x35\x5a\xda\x87\x4d\x0a\x79\xef\
\x2b\x21\x2e\x0d\xed\x84\x03\x10\xa4\xd1\xa0\x41\x83\x06\x0d\x1a\
\x34\x68\xd0\xa0\x41\x83\x06\x0d\x1a\x34\x68\xd0\xa0\xe1\x57\x82\
\xff\x01\x97\x42\xc3\x35\xf6\x81\x05\xaf\x00\x00\x00\x00\x49\x45\
\x4e\x44\xae\x42\x60\x82\
\x00\x00\x06\x5f\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x06\x1f\x26\x3f\x54\x88\x39\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x05\xba\
\x49\x44\x41\x54\x78\xda\xed\xdc\x7d\x88\x5c\xd5\x19\xc7\xf1\xcf\
\x6c\xe2\xfa\x42\x93\xf5\x6d\x29\xd1\x28\x4d\x0d\xb4\x55\x23\x55\
\x4c\xc5\x1a\x41\x63\x25\x4d\x1b\x63\xd7\x12\xdf\xdf\x5a\xa4\xa8\
\xad\x14\x5f\xd0\xd6\x5a\xc4\x37\x6a\x53\x85\x16\x15\x54\xac\xf8\
\x56\xaa\x46\x04\x43\xa4\x1a\x89\x46\x45\xd4\x88\x28\xd1\x8a\x4a\
\x9a\x18\x93\x26\xb5\x6b\x8c\xab\x26\xd5\x68\xf6\xf4\x8f\x7b\x76\
\x76\x76\xb2\x3b\x73\xef\xec\x6e\x98\xc9\x9e\x1f\x1c\x98\xb9\xf7\
\xdc\x3b\x73\xbf\xf3\x9c\x73\x9e\xe7\xb9\xcf\x1d\x92\x92\x92\x5a\
\x58\xa5\x16\xfb\xbe\xdf\xc5\x4c\x4c\xc5\x38\x7c\x81\x0d\xe8\xc6\
\x1a\xac\x88\xed\xcb\xf4\xd3\x0e\xfc\x91\x4f\xc5\x72\x84\x1c\xed\
\x7f\x78\x0e\x57\x61\xca\x58\xb7\xc0\x29\xb8\x0f\x33\xc0\xce\x38\
\x19\xfb\x63\x4f\x7c\x85\x8f\xb1\x1e\xef\x63\x25\xde\x1b\x70\xfc\
\x56\x3c\x88\xcb\xf0\x9f\xb1\x66\x79\x3f\xc4\x46\x04\x1d\x82\xf9\
\x82\x8d\x82\x4d\x75\xda\xbf\x05\x7f\x17\xfc\x78\x80\x55\xae\xc7\
\x21\x63\x09\xde\x3c\x6c\x41\x30\x4b\xb0\x5a\xf0\x91\xe0\x35\xc1\
\xab\x82\xf7\x73\x80\xdc\x14\xfb\x1f\x5c\x86\xb8\x12\x5f\xdb\xd1\
\x40\x4d\x1b\x64\xdb\x71\x65\xcb\xb9\x50\xf0\xba\xa0\x4b\x30\x5e\
\xef\x80\xb9\xee\x7b\x82\xa7\x72\x40\xfc\xaf\x60\x8f\xf2\x71\xbf\
\xde\xd1\xe0\xbd\x30\xc8\xf6\x3b\xca\x90\x1e\x13\x4c\xb0\xb5\x02\
\xdc\xa7\x71\x96\xcb\xde\x97\xf4\x5a\x90\x03\xe2\x6d\x03\x86\xf3\
\xbc\xd8\x4e\xad\x78\x3d\xab\xd5\xac\x73\x3f\xac\x8b\x2b\x6b\xb5\
\x26\xe0\xdd\xaa\x95\xf5\x65\xec\x53\xd1\x67\x57\x2c\x42\x30\x51\
\xaf\xd5\x75\x00\xbe\x92\x6b\xf5\x9e\xd6\x2a\xf0\x3a\xab\xbe\xf8\
\x60\x3a\xa4\x62\xff\x12\xb4\x0d\xe1\x41\xac\x42\x70\x7d\x1d\x80\
\x6f\x57\x7c\x5e\x57\x45\x9b\xd3\x7a\x00\x3b\xf0\x5a\xc5\x97\x5e\
\x5d\xa3\xef\x6f\xa3\x53\x3c\xa1\x46\x9f\xd3\x10\xcc\xa8\x03\x70\
\x8d\xe0\x3b\x82\x0d\x83\xec\x3b\xa8\x75\x00\xee\x86\xe7\xab\xac\
\x6f\x79\x1d\x1f\xf5\x80\x3a\xe7\x9c\x8c\x60\xaf\x3a\x00\xdf\x11\
\x2c\x19\x62\xdf\x30\x01\xb6\x6d\x27\x78\xed\x58\x80\x19\x26\xe1\
\xd1\x5c\xc7\x04\xfc\xab\x4e\x9f\xcf\xc8\x11\xb8\x7d\x1c\x63\x93\
\x51\xd0\xf8\xed\x00\x6f\x5c\x8c\x26\x7e\x64\x6f\x3c\x81\xcf\x47\
\xec\xdc\xdf\x04\x13\x73\xf4\xbc\x01\x47\xe2\xe0\xaa\xed\x1b\x9b\
\x3f\x8e\xcd\xdc\x92\x09\x7a\xbd\x10\x87\xcd\xcb\xb9\x86\xf0\xed\
\xf8\x10\xa7\xd7\xe8\xf3\x30\x82\x79\x75\x86\xf0\x5b\xad\xbb\x0a\
\xff\x11\xc1\x2e\x7a\x2d\xae\xb8\xa0\xfa\x00\x67\x55\x5d\xdc\x32\
\x9c\x89\x3d\xe2\xfe\x7d\x63\x8c\x1b\x94\x04\x4b\xeb\x00\x5c\x32\
\xe0\x5c\x1f\x55\xb4\x8d\x15\xaf\x0f\x6c\x36\x78\xbf\x21\x46\x10\
\x8f\x56\x5d\x50\x6d\x80\x13\xcb\xce\xf2\x24\xc1\xee\x55\x11\x48\
\x75\xfb\x53\x0e\x47\xfa\xa4\x72\xff\x7b\x5b\xc5\xd7\xbb\xa0\x1c\
\x29\xdc\x3b\xc8\x05\xd5\x06\x78\x71\x19\xce\xad\x82\x75\x82\x1b\
\x63\xe8\xd6\x1e\xb7\xef\x2a\x98\x2d\x78\x32\x07\xbc\x3f\x97\x3f\
\xab\x17\xdf\x6f\x05\x78\x67\xc4\x44\x53\x70\xcb\x10\x17\x55\x1b\
\xe0\xce\xb8\xbf\x0c\xf1\x38\xc1\xf2\x78\xdc\x67\x82\xf5\x39\x13\
\x09\xff\x8c\x90\xfb\xad\xf5\xaa\x56\x80\x77\x42\xcc\x12\x07\xd7\
\xd5\xb8\xb8\x7c\x8b\xc8\xcf\xd1\x53\x06\x30\x4f\xb0\x58\xf0\xe9\
\x10\xe7\xec\x11\xbc\x28\xb8\x59\x70\xd4\x00\x70\x9f\xb7\x4a\x12\
\xe1\x58\x6c\x42\x70\x69\x1d\xeb\xc8\x07\x10\x26\xe1\xee\x98\x18\
\xed\x87\x72\x68\x8c\x3e\x8e\x15\x4c\x17\x4c\xa9\x18\xde\xfd\x6d\
\x4b\x9c\xf3\xa6\xb6\x02\xbc\xe9\xd1\x5d\x0d\xce\xcb\x31\xbc\xf2\
\x03\xec\xd3\xb7\x30\x3f\x86\x76\x43\x2d\x28\xbd\x71\xff\x83\xf8\
\x19\xf6\xde\x5e\x7e\xda\x70\x75\x20\x96\xa2\xd3\x29\xb8\x2b\x47\
\x7c\xf3\x26\x8e\x00\x6f\x34\x90\x29\x9e\x1c\x43\xbc\xdd\xa3\xc5\
\x93\xdd\x54\x5a\x85\x4f\xb6\xb7\xe5\x0c\x37\x12\xf9\x06\x9e\x44\
\xa7\xd9\xd1\xf5\x1d\xfd\xe0\x70\x6d\x6c\x4d\xa1\xe1\x00\xfc\x3a\
\x9e\xc2\x64\x47\xc7\x60\xad\xbd\xa1\xa4\xea\x8d\x4d\x3e\x3d\x2d\
\x8d\x01\xe8\x88\x02\xec\x88\xf0\xa6\x3a\x0c\x0f\xc5\x5c\x4b\x63\
\xba\xa2\xc9\x01\x86\x91\x06\xb8\x5b\x1c\xb6\xd3\x7c\x3b\x66\x56\
\x3a\x1a\xb0\xdd\x6b\x9b\x1c\xdb\xcd\xd1\x89\x1a\xe1\x21\xdc\x8e\
\xc7\x70\x84\xfd\xb1\x50\x96\x5f\x2e\xaa\x4e\x5c\xda\x02\x76\x77\
\xf5\xc8\xe6\x03\xc7\x45\x17\xe1\x07\x3a\x05\x8b\x62\x48\x3f\xc6\
\x95\x17\x60\x09\x7f\x45\x97\x89\x82\x45\x4a\x75\x73\xc5\x09\xe0\
\x36\x33\xc2\x39\x76\x11\x2c\x54\xda\x26\x29\x99\x00\xd6\xd4\xef\
\x71\xb1\xf1\x82\x05\x4a\xa6\x27\x68\x45\x00\x5e\x84\x6b\xb5\xe1\
\x3e\x25\x33\x13\xb0\x22\x00\xcf\xc2\x5f\xc0\x6d\x38\x31\xc1\x2a\
\x02\x70\x2e\xee\x41\xc9\x7c\x9c\x9d\x40\x15\x01\x38\x13\x8f\xa0\
\xcd\x95\xf8\x65\x82\x54\xc4\x91\x3e\x46\x56\x4a\xc1\xf9\xf8\x5d\
\x02\x54\xd4\x02\xfb\x6f\x21\x9e\x9b\xe0\x34\x02\xf0\x82\x18\xa0\
\xd1\x25\x58\x95\x00\x15\x05\xb8\x55\x56\x85\xfc\xb4\xf5\x4a\xe6\
\xe2\x83\x04\xa9\xe8\x22\xf2\x05\x4e\xc2\x32\x2b\x31\x27\x5f\x56\
\x22\x01\x1c\xa8\x9e\x88\xee\x6d\x6f\x45\x9c\x9b\x13\xac\xa2\x8e\
\x74\x37\x8e\xc7\x1a\x2f\xc9\xee\xf6\x6e\x49\xc0\x8a\x86\x72\x6b\
\xa3\x5f\xd8\x6d\x31\x7e\x11\x67\xc9\xa4\x42\xc9\x84\x15\xb2\x62\
\x9f\x1e\x0b\x70\x49\x82\x56\x14\x20\x59\x59\xee\x89\xd8\xec\x2e\
\xb9\x32\xb5\x09\xe0\xb6\x7a\x56\x56\x93\xfc\xa5\x9b\xca\x69\x86\
\x04\xb0\x60\xff\x85\xb2\xbb\xfe\xc1\x95\xb2\x12\xa0\x14\x0b\x17\
\xd6\xdf\x64\x85\x8e\xb7\xb8\x30\xbe\x9a\xd3\xc0\x59\x96\xe9\xab\
\x70\x6e\x4e\x3d\x33\xfa\x1f\x71\xb5\xbe\x02\xca\xc7\x73\x96\x9c\
\x0d\x5e\x1d\xdf\xec\xed\x0f\x23\x6d\x81\x7d\xba\x06\x7b\xf9\xca\
\x45\x4e\x16\x3c\xde\x70\xba\xff\x03\x59\x8d\x4c\xb3\x6a\xc5\x68\
\x9e\xbc\x84\x07\x64\xcf\x6a\xf4\x5a\xd6\x90\x05\x4e\x6b\xe5\x39\
\x70\xb8\xa5\x40\x01\xe7\x60\xa1\x0d\x4a\x7e\xa2\xf6\xb3\x47\x69\
\x15\x1e\x54\x5b\xa3\x7b\xf3\x8c\x75\x71\x41\xe9\x4e\x00\x8b\x6a\
\x33\xba\xf0\xea\x58\xcb\xe0\x8c\x64\x35\x5f\x0f\x66\xe3\x5d\x6f\
\xe2\xa7\x63\x23\x83\x33\xd2\xe5\x90\xdd\xb2\x27\xce\xd7\x7a\x51\
\x76\x37\x6f\x4b\x02\x58\x54\x6b\x23\xc4\x6e\xff\x90\xdd\x9c\x4a\
\x19\x9c\x86\x74\xb8\xbe\xc7\x14\xce\xdb\x71\xdd\x98\xd1\xd6\x4c\
\x7d\x8f\x3e\x5c\x9e\x00\x36\xaa\xb9\xfa\x9e\x5c\x9a\x9f\x00\x36\
\xaa\x33\x88\x0f\x0d\xde\x99\x00\x36\xaa\x5f\x21\x68\x13\x3c\x9c\
\x00\x0e\x27\x01\x51\xfd\x27\x3a\x09\x60\x41\xdd\xaa\x45\xff\xaf\
\xa5\x59\xd4\x9f\xc1\x49\x00\x1b\xd6\x4e\xb2\xdb\x03\x09\xe0\x30\
\xd4\x2e\xfb\xfb\xa6\x04\x70\x98\x10\x3b\x12\x86\xa4\xa4\xa4\xa4\
\xa4\xa4\xa4\xa4\xa4\xa4\x31\xa6\xff\x03\xde\xf7\xb4\x7b\xfa\x64\
\x3d\x22\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x07\xcd\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x06\x1a\x11\xfa\x9e\xd9\x73\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x07\x28\
\x49\x44\x41\x54\x78\xda\xed\xdc\x7d\x6c\x57\xd5\x1d\xc7\xf1\xd7\
\x2d\x95\x02\xb5\x14\xa8\x84\x90\xb1\x0c\xa6\x04\x5d\x2c\x99\x44\
\x9d\x99\x98\x89\x28\x28\xce\xa7\x65\x22\x93\x32\x56\x34\x6a\x75\
\x4e\xc9\xd4\xb2\x45\xc1\xf9\x88\x73\x3e\x45\xc6\x7c\x44\x57\xc0\
\x81\xb0\x6c\xa2\x24\x9b\x84\x82\xca\xe2\xc6\xd0\x65\xba\x6c\x95\
\xa8\x1b\xa5\xdb\xc0\xce\xb8\x96\x0a\x43\x5a\xee\xfe\xb8\xb7\xb5\
\x05\xfa\x70\xdb\x5f\x6b\xa1\xf7\x93\xdc\xfc\xee\xc3\x39\xe7\xde\
\xfb\xfe\x7d\xcf\x39\xdf\xf3\xbd\xe7\x5e\x52\xa5\x4a\x75\x18\x2b\
\x38\xcc\xae\xf7\xcb\x38\x0b\xc7\xa1\x1f\xf6\xe2\x43\x54\x63\x3b\
\xde\x8d\x97\x7d\xe9\x5f\xdb\xf2\x4f\x9e\x81\xb7\x10\x76\x60\xd9\
\x83\x57\x71\x2b\xc6\xf4\x75\x0b\x1c\x83\x32\x4c\x84\x9c\x1c\x2e\
\xbc\x90\x51\xa3\x18\x32\x84\x86\x7a\x6a\x6a\xd8\xb9\x93\xaa\x7f\
\x52\xb9\x8d\xca\xed\x2d\xf2\x37\x60\x05\x6e\xc2\x8e\xbe\x06\xf0\
\x5c\xfc\x02\x43\x06\x0f\x66\xee\x8d\x14\x15\xd1\xbf\x7f\xdb\x99\
\x6a\x6a\x78\xfd\x75\x56\xff\x92\x75\xeb\x9a\x76\xef\xc0\xd4\xd8\
\x8a\xfb\x04\xc0\x4b\xb1\x1c\x47\x4d\x9a\xc4\x83\x0f\x90\x9b\x4b\
\x55\x15\xfb\xf7\x73\xcc\x31\x0c\x1d\xda\x7e\x21\xef\xbd\xc7\xb5\
\xd7\x51\x51\x01\xfe\x8e\xf1\xa8\x3b\x92\xda\xb7\xc2\x43\xec\x9b\
\xdc\xd8\x9e\x15\x17\x0b\x37\x94\x0b\xcf\x9f\x26\xcc\xce\xb6\xbf\
\x79\x5b\x37\x61\x82\x70\xf5\x2a\xe1\xb6\x7f\xb4\xbd\xfc\xed\xaf\
\xc2\xfc\xfc\xa6\x7c\x37\x1c\x49\x16\x58\x88\xc7\x70\xfa\x01\xfb\
\x1f\xc7\x55\xb0\xb4\x8c\x92\x6b\xed\xaf\xab\x93\x15\x1f\xab\x8b\
\x7b\xdd\x2f\x40\x10\x08\x9f\x7a\x52\x70\xf6\xd9\x6d\x9f\x68\xc5\
\x4a\x4a\x4b\x9b\x36\xa7\xc7\xbf\xfd\xe2\x36\x12\x6a\xf1\xbb\xce\
\x58\xe7\x67\x05\xf0\xf3\xf8\x03\xfe\x13\x57\xab\xe6\xca\xc3\x1b\
\x18\xdb\x6c\xdf\x66\x5c\x82\x7f\xc5\xdb\x03\xb1\x0a\xe7\xe7\xe5\
\x09\x5f\x7d\x45\x30\x6c\x58\xeb\x27\xdb\xba\x95\x73\xa6\xb4\x7b\
\x4d\xe3\xf1\x76\xd2\x1b\xc9\xfe\x0c\xe0\x0d\x47\x65\xbc\x3e\xf2\
\x10\xc7\x77\xe1\x9b\xf8\x73\xbc\x5d\x8e\x73\xb0\xbf\x59\x9a\x3d\
\xb8\x00\xef\xef\xda\x65\xf4\xf3\xab\xb8\xe6\xea\xd6\x4f\x98\x9b\
\xfb\xe9\xfa\xf9\xd3\x3e\x5d\xdf\x57\xcf\xcb\x2f\x77\xed\x66\x7a\
\x1a\x60\x3e\x9a\x5f\x72\x65\x2b\xe9\xde\xc2\x0f\x71\x05\x2e\x3e\
\x00\x5e\xa3\xc2\x38\xcd\x73\xe5\xe5\xed\x03\x1c\x3b\x96\x97\x5e\
\x64\xc0\x80\x96\xc7\xa6\x4c\xe5\x9d\x77\x3a\x7f\x43\x59\x3d\x08\
\x6f\x10\x5e\x8a\x47\x13\x4d\x5e\x47\x1b\xe9\x17\xc6\xae\xc7\xae\
\x36\xd2\xbc\xd6\x58\x45\xdb\xd2\xee\xdd\x2c\x5c\x78\x30\xbc\x4c\
\xa8\xa7\x00\xf6\x8f\xdb\xac\x89\x23\x46\xf0\xec\x33\x1d\xca\x13\
\xe2\xbd\x76\xd2\xd4\x41\x7d\x7d\xdb\x89\x6a\x6b\xf9\xfd\xeb\xdd\
\x73\x63\x3d\x51\x85\xfb\xc5\xa3\x89\x69\xc3\x86\xb1\x72\x05\x7b\
\xf7\x66\xac\xec\x2f\x42\x5e\x5e\xfb\x09\x1f\x7a\x98\x93\x4f\xe6\
\x84\x13\x0e\x76\xbc\x7b\x33\xc0\x00\x8b\x71\xd9\xd1\x47\x0b\x97\
\x96\x09\xc6\x8c\x69\x72\x6c\xdb\xd3\x63\x71\x67\xf2\x3d\x3c\xd7\
\x4a\x9a\x79\x44\x60\xda\x52\x6e\x6e\x64\xa5\x97\xcd\x38\xfc\xaa\
\xf0\x42\x5c\x95\x93\x23\x7c\x66\x89\xe0\xc4\x13\x3b\x9c\x6f\x2a\
\xae\x46\x41\x3c\x22\xd9\x8c\x22\x34\x8e\x3f\x3e\x17\x8f\x71\x2f\
\x0d\x02\xe6\x14\xb7\x5d\xd8\xce\x0f\x5a\x6c\x7e\xd4\x6c\xf9\x6f\
\xb3\xf5\x86\xde\x66\x81\xf3\x70\x4b\x76\xb6\xf0\xf1\xc7\x04\xa7\
\x9e\xda\xe1\x7c\x83\x63\x67\xda\x88\x11\xfc\x6f\x8f\xb0\xa6\xd6\
\x29\x58\x7a\xa8\xc4\xf3\xe7\x73\xd2\x49\x6d\x17\xb8\x64\x49\xd3\
\x6a\x19\x66\x1f\x0e\x16\x58\x82\x7b\x83\x40\xf8\xf0\x43\x82\x49\
\x93\x12\xe5\xbd\xa2\x71\xa4\x31\x77\x2e\x9b\x36\x09\x6e\xbb\x95\
\x09\x13\x3e\x0d\x24\x0c\x18\xc0\xe4\xc9\x3c\xbf\xb2\x7d\xeb\x5b\
\xba\x94\xb5\x6b\x9b\x3a\xa5\xc7\x0f\x87\xa1\xdc\x4c\xfc\x1c\xfd\
\xee\xbd\x87\xcb\x2f\x3f\x38\x41\x45\x05\x53\xcf\x25\xf6\xfc\x0f\
\x1c\x89\xe4\xe0\xa9\xb8\xca\x3a\xe3\x0c\xee\xba\x93\xd1\xa3\x09\
\x43\xea\xea\x3a\xd6\x69\x54\x6e\xe7\xf6\x05\xac\x2f\x6f\xda\x75\
\x1b\xee\xea\xed\xbd\xf0\x05\x58\x82\x7e\xf3\xe6\x1d\x1a\x5e\x07\
\xb4\x17\xb3\xb0\x01\x0f\xbd\xf6\x9a\xc1\x5f\x3b\x33\x8a\x03\xce\
\x2a\x6a\xbd\xc3\xa8\xaf\x8f\xfc\xc1\xcd\x7f\x8c\x2c\x6e\xf3\xe6\
\x16\xe5\x95\xe2\x91\xee\xea\x25\x33\xa5\x49\xb1\xa3\x3c\xa8\xa4\
\x84\x79\xa5\xad\x27\x6c\xc7\x02\x9b\x6b\x24\xee\x8e\xdb\xad\xa6\
\xe6\xa6\xf0\x44\x06\xe5\x72\x54\x36\x1f\xef\xe6\xc3\x0f\xd9\xb1\
\x83\x4f\x3e\x69\x91\x77\x9f\x28\x9e\x78\xa7\x28\xcc\xdf\xab\xfd\
\xc0\x53\xf0\x2b\x0c\x2a\x2a\x6a\x1b\x5e\x42\xfd\x1b\x73\x70\x5f\
\xdc\x36\x7e\x03\xc7\xbe\xfd\x97\x56\x1d\xef\xf7\xb1\x05\xbf\xc5\
\x8b\x71\xb0\xa2\x5b\x95\x09\x80\x5f\xc2\x5a\xe4\x5f\x7c\x11\x77\
\xde\xd1\x2d\xd7\xf9\x0e\x6e\x89\x97\x51\x38\x16\x43\xf0\x71\x7c\
\xbc\x5a\x14\x30\xad\xed\xe9\xc8\x48\x57\x01\x8e\x8e\xff\xed\xe1\
\x93\x27\x73\xff\xfd\x64\x75\xff\xe0\xb0\x2a\x5e\x7a\x85\xba\x02\
\x70\x04\xd6\x61\xd4\x69\xa7\xf1\xd3\x45\xed\x3f\xaf\x38\x84\x0a\
\x63\x67\xbb\x37\x6b\x23\x7e\x93\x69\x80\xf9\x31\xbc\xe3\xc6\x8f\
\xe7\xc9\x27\x18\x38\xb0\xd3\x17\x58\xda\xcb\x01\x86\x99\x06\x38\
\x28\xae\xb6\x85\x63\x8f\x8b\x22\x2b\x83\x07\x27\x2b\x60\xf8\xf0\
\x8c\x76\x34\xdd\xa2\xc5\x3f\x8b\xa2\x38\x99\xae\xc2\xfd\xf1\x02\
\xbe\x32\x6a\x54\xe4\xe5\x17\x14\x24\xbf\xb8\x82\x02\x4a\x4a\x7a\
\xb9\xd9\x85\xdc\xf7\xe3\xcc\x0e\xe5\xfa\xc5\x03\xf8\xb3\x0b\x0a\
\x84\xcb\x97\x31\x72\xa4\x3e\xaf\x8e\x02\x0c\xf0\x34\x2e\xc9\xcb\
\x13\x3e\xb7\x5c\x30\x7a\x74\x0a\x2f\x09\xc0\x07\x30\x3b\x27\x27\
\x8a\xe9\x1d\x7f\x7c\x0a\x2e\x09\xc0\xdb\x30\x37\x3b\x5b\xb8\xe4\
\x69\x41\x7b\xa1\xa3\x14\x60\x4b\x5d\x8f\x3b\xb2\xb2\x58\xf4\xa8\
\x60\xe2\xc4\x14\x58\x12\x80\xb3\x1a\x23\x18\xf7\x2d\xe4\xbc\xf3\
\x52\x58\x49\x00\x5e\x88\x67\x11\x2c\x98\xcf\xf4\xe9\x29\xa8\x24\
\x00\xcf\xc2\x6a\x64\xdd\x78\x03\x73\xe6\xa4\x90\x92\x38\xd2\x67\
\x62\x3d\x7c\x67\x76\x14\x52\x4f\x95\xcc\x02\x9b\x62\xc8\x33\x66\
\xa4\x70\x3a\x03\xb0\x04\x6b\x60\xf6\x6c\x61\x65\x65\x0a\x28\x29\
\xc0\x06\xd1\xfc\xb9\xf2\x9d\x1f\x08\x8a\x66\x51\x5d\x9d\x42\x4a\
\xda\x89\xec\x15\x85\xce\x37\x6f\xdb\xc6\xe5\x33\x3b\x16\x95\x48\
\x01\xb6\x54\x0d\xbe\x8e\x8a\xad\x5b\x29\x2e\x66\xcf\x9e\x14\x56\
\x52\x47\xba\x5a\x34\xb1\x71\xfb\x96\x37\xb8\xa6\xe4\xa0\xa7\x5e\
\xa9\x3a\x30\x94\xab\x8a\xfd\xc2\xea\x8d\x1b\xf9\xfe\x4d\x34\x34\
\xa4\xd0\x92\x06\x13\xde\x15\x4d\xf6\xa9\x59\xb3\x86\xf9\x0b\x52\
\x68\x49\x01\xc2\x9f\x70\x11\x76\x2f\x5b\xd6\xb1\x48\x6d\x0a\xf0\
\x60\xbd\x82\x6f\x61\xdf\xe2\xc5\x3c\xf1\x44\x0a\x2f\x29\x40\xb1\
\x93\x5d\x8c\xf0\xee\x7b\x58\xb5\x2a\x05\xd8\x99\xa7\x72\xcb\x45\
\x13\x1d\x1f\xbd\xa5\x94\xfc\x7c\xa6\x4c\x49\x5e\xc8\x9b\x6f\x46\
\x93\xbf\x7b\xab\x36\x6d\xea\x58\xba\xae\x4c\x2e\x5a\x80\xdb\xb3\
\xb3\x85\x65\x65\x82\xd3\xbf\x9a\x2c\x73\x57\x5f\x2f\xe8\x41\x2d\
\xc4\x0f\x32\x69\x81\x8d\xfa\x11\x0a\xea\xeb\x5d\x7f\xe5\x95\xd1\
\x83\xa6\x4e\x86\xfb\x77\xea\xc4\x1b\x42\x3d\xa8\x77\xbb\xcb\x02\
\x1b\xf3\x2f\xc5\xcc\xa1\x43\x85\x2b\x57\x08\xc6\x8d\x4b\x6c\x81\
\xe3\x7b\x39\xc0\x8c\x76\x22\x07\x2a\x14\xcd\xdd\x5b\xf3\xd1\x47\
\x82\x6f\xcf\x66\xfb\xf6\xb4\x17\x4e\xaa\x86\xd8\xbd\xd9\xb0\x63\
\x07\x33\x8b\xa2\x09\x8f\x29\xc0\x64\xda\x2d\x7a\x9b\xf2\x8d\xbe\
\x16\xc1\xc9\xe4\x6c\xbe\x1a\x9c\x87\xad\x15\x15\x14\xcf\xe9\x1b\
\x11\x9c\x4c\x4f\x87\xac\x16\xbd\x71\x5e\xb5\x65\x0b\xd7\x5d\x77\
\xe4\x47\x70\xba\x63\x3e\x69\x55\x0c\xb1\x7a\x7d\x39\x37\xdf\x7c\
\x64\x47\x70\xba\x6b\x42\xee\x56\x4c\x43\xed\xaf\x5f\x38\xb2\x23\
\x38\xdd\x39\xa3\x79\x4b\xdc\xb1\xec\x5e\xb6\x8c\xfb\x7f\x92\x02\
\xec\x8c\xca\x63\x17\xa7\x61\xd1\xa2\x16\xef\xac\xa5\x4a\xa8\x99\
\xa2\xd7\xf6\xc3\x07\x1f\x88\x3e\x47\x32\x6e\x5c\xd3\xa7\x48\x0a\
\x53\x3c\x1d\xd3\x77\x11\x66\x65\x09\x9f\x7a\x32\x05\xd8\x95\x00\
\xc4\x81\x1f\xd1\x49\x01\x26\xd4\x22\x2d\xbf\xb6\x96\x02\x4c\xa8\
\x00\xcb\x52\x80\x5d\xd3\x51\xa2\xc7\x03\x29\xc0\x2e\xa8\xbf\xe8\
\xf5\xd8\x14\x60\x17\x21\xe6\xa7\x18\x52\xa5\x4a\x95\x2a\x55\xaa\
\x54\xa9\x52\xa5\xea\x63\xfa\x3f\x96\x06\x21\x66\xa1\x06\xc5\xf7\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x0c\xe2\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x09\x06\x1b\x26\xc9\x48\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0c\x3d\
\x49\x44\x41\x54\x78\xda\xed\x9c\x79\x70\xd4\xd5\x1d\xc0\x3f\xbf\
\xdf\x9e\xd9\xdd\x64\x93\x6c\x4e\xc8\x05\x01\x0c\xc8\x19\xb9\x45\
\x6a\x44\x41\xf0\x40\x2b\x5e\xc5\xea\xb4\x53\xa1\x3a\x56\x7a\xd1\
\xce\xd4\xd2\x69\x6d\xab\xce\xb4\x38\x38\x6a\x3b\x6d\x3d\xe8\x88\
\x88\xc5\x83\x7a\x80\x80\x07\x8a\x86\x00\x4a\x48\x08\x77\x0e\xc2\
\x91\x90\x04\x72\x67\xb3\x9b\xdd\xfd\xbd\xfe\xf1\xfb\xfd\x82\x20\
\x45\x42\x7e\xbb\x39\xc8\x77\x26\xb3\x99\x37\x9b\xef\x7b\xef\x93\
\xf7\xde\xf7\x78\x07\x0c\xc8\x80\x0c\x48\x1f\x16\xa9\x97\xb7\xcf\
\x01\x8c\x04\x86\x02\xc9\x40\x22\x10\x07\x98\x01\x01\x34\x03\x3e\
\xe0\x34\x70\x14\xa8\x04\xca\x80\xd6\xcb\x15\x60\x14\x30\x47\xfb\
\x99\x04\x8c\xd3\x60\x75\x45\x84\x06\xb1\x00\xc8\x07\x36\x03\xa5\
\xfd\x1d\xe0\x18\x60\x31\xb0\x10\x88\xd5\x0b\x65\xd9\x44\x7c\x4a\
\x3a\x9e\x41\x19\xc4\x26\xa4\xe2\x74\xc7\x61\x8b\x72\x22\xcb\x32\
\xb2\xc9\x8c\xbf\xdd\x4b\x30\xe0\xa7\xf9\x74\x2d\x2d\x0d\x75\x9c\
\xaa\x3e\xca\xe9\xaa\xca\xf3\xe9\x2f\x06\xd6\x00\x2f\x02\xb5\xfd\
\x09\x60\x06\xf0\x0c\x70\x9b\x5e\x90\x9c\x31\x9c\x51\x53\xf2\x18\
\x36\x6e\x2a\x83\x87\x5d\x89\xd5\x16\xd5\x25\x85\xa1\x60\x80\xda\
\x63\xe5\x54\x1e\x28\x64\xd7\x27\xef\x70\xfc\x70\xc9\xb9\x5f\x79\
\x0d\xf8\x12\x78\x1b\xa8\xe8\xcb\x00\x6f\x05\x5e\x05\x5c\xb2\xc9\
\xcc\x84\x6b\x6f\xe6\xea\x5b\xee\x23\x25\x73\x44\xb7\x15\x9f\x28\
\xdb\xc7\xe6\xd5\xcf\x71\xb8\xf0\x0b\x84\x10\x17\xfa\xea\x17\xc0\
\x32\xe0\x93\xbe\x06\xf0\x21\xe0\x59\xc0\x34\x22\x77\x06\xb7\x3d\
\xf4\x3b\x62\x13\x52\xba\xad\x34\x18\x08\xb0\x79\xf5\xb3\x6c\x5d\
\xb7\xb2\xb3\x2c\x66\xf4\x6c\x4c\x51\x31\x98\x9c\x71\x48\x92\x84\
\x64\xb2\xe0\xaf\x2d\xa7\xa9\x78\xc3\xd7\xd7\xcc\xe7\x80\xa5\x80\
\xbf\x2f\x00\xfc\x29\xf0\x34\x20\xdd\xb0\xf0\x27\xe4\x2d\x78\xd0\
\x10\xa5\x3e\x6f\x2b\xab\x9e\x5c\x22\xca\x4b\x76\x4a\x9d\xe0\xec\
\xd1\xb4\x96\x6d\x27\xd0\x70\xfc\x6c\xd3\x9e\x75\x15\xee\xb1\x37\
\xe2\x3f\x55\x49\x7d\xc1\x6b\xa0\x84\x00\xb6\x6b\xc6\xab\xa9\x37\
\x03\x7c\x08\x78\x1e\x90\xe6\xff\x78\x19\x53\xe6\xdc\x69\x88\xd2\
\x0e\x9f\x97\x97\x7e\xbf\x98\xa3\x07\x8b\x90\x6d\x2e\xe2\x26\x2f\
\xa0\x61\xc7\x1b\x28\xfe\x33\xde\x8c\xd9\x9d\x0c\xa1\x20\xc1\xd6\
\xd3\x9d\x65\xb6\xe4\xe1\x78\x66\xdc\x4f\xcd\x86\xe5\x84\xbc\x8d\
\x00\x5f\x01\xd7\x76\xc5\x0d\x92\x22\xbc\xe6\xbd\x05\x98\xe6\x2f\
\xfe\x2d\x53\x6e\xbc\xcb\x10\xa5\x42\x08\xd6\x2c\x5f\xca\x9e\x2f\
\x36\x61\x8a\x8a\x11\xee\x71\xf3\xa4\xfa\x82\x35\x9d\x80\x52\x6e\
\xfa\x15\xce\x21\x93\x90\x64\x59\x35\x32\x7e\x2f\x8d\x85\xff\xa5\
\x76\xe3\x0a\x94\x8e\x76\x64\xab\x83\xa4\x39\x4b\xa8\xfb\xf8\x1f\
\x84\xda\xea\x01\xd6\x01\xdf\xd5\xa6\xf6\xb7\x8a\x29\x42\xf0\x46\
\x00\x1b\x80\xa8\xbc\x3b\x17\x31\xf3\xf6\x1f\x18\xa6\x78\xfb\x07\
\xff\x61\xeb\xba\x95\x48\x66\xab\x12\x37\xf1\x0e\xb9\x7e\xdb\x6a\
\x00\x92\x66\x2f\x21\xed\xae\x27\xb1\xc5\xa7\x21\x49\x67\xc6\x89\
\x6c\xb6\xe0\x48\x1b\x83\x67\xfa\x7d\x04\x1a\xaa\xf0\x55\xed\xa3\
\xad\xac\x80\xe4\x39\x3f\xa3\xad\x34\x1f\x84\x92\x03\xd4\x68\x96\
\xba\x57\x00\x8c\x02\x3e\x02\xd2\x47\x4f\x9f\xcd\xfc\xc5\x8f\x9d\
\xd5\xa1\xee\x48\xe3\xa9\x93\xac\x7a\x6a\x89\x08\x05\x83\x92\x67\
\xda\x42\xa9\x7e\xfb\x1a\x10\x0a\xa9\xb7\xfc\x86\x84\x19\xf7\x5f\
\xb0\x1e\xc9\x64\x21\x66\xf4\xf5\x04\x9b\x6b\x69\x3f\xb1\x97\xf6\
\x63\xc5\x24\xce\x7a\x58\x85\x28\x9b\x66\x21\xc4\x4b\x17\x33\x95\
\xe5\x08\x00\x7c\x0a\xb8\x32\x3e\x25\x8d\x3b\x1e\x79\xdc\x30\x78\
\x00\x1b\x5f\x59\x41\x87\xaf\x5d\x72\x5d\x31\x53\xb4\x96\x6e\x43\
\x84\x02\xc4\x4d\x5a\x40\xfc\xd4\x7b\x2e\x5a\x47\xea\xfc\x65\xb8\
\x46\xcc\x20\xe4\x6d\xa4\x65\xdf\xc7\xb8\x86\x5f\x0d\x4a\xc8\x6e\
\x76\x79\x9e\xb9\x98\xbf\x0f\x37\xc0\x09\xc0\x23\x00\xdf\x5b\xba\
\x1c\x5b\x94\xc3\x30\xc5\xb5\xc7\x2b\x28\xde\xba\x01\x40\xd8\x93\
\x87\x49\xfe\x9a\xc3\x58\xdc\x29\xa4\xcc\x5b\xda\x35\x37\x44\x96\
\x19\x7c\xc7\x1f\x91\x6d\x4e\xbc\x95\xbb\x88\xca\x18\xaf\xba\x44\
\x6d\xf5\x77\x00\x99\x3d\x0d\xf0\x69\x40\x9e\x71\xeb\xfd\x0c\x1a\
\x3a\xd2\x50\xc5\x9f\xaf\x5b\x89\x10\x02\xf7\x84\x5b\x85\xee\xd3\
\x25\xcd\x59\x82\x6c\x8d\xea\xb2\x2e\xb3\xcb\x43\xd2\x0d\x8f\x02\
\xd0\x54\xbc\x9e\x98\xd1\xb3\x41\x08\xd9\xec\xf2\x2c\xed\x49\x80\
\xf3\x80\x6b\x6d\x0e\x17\x79\x77\x2d\x32\x54\xb1\xaf\xad\x85\xdd\
\x5b\xd7\x03\x60\x8d\x4f\x97\x03\x8d\xd5\x58\x13\xb2\x70\x8f\x9d\
\x77\xc9\x3a\xe3\x27\x2f\xc0\x1c\x9d\x48\x47\x5d\x05\x56\x4f\xba\
\x6a\xb1\x3b\xbc\x0f\x7c\x9b\x9d\x08\x27\xc0\xc7\x00\xae\x5d\xf0\
\x23\xa2\x9c\x31\x86\x2a\x2e\xfe\x62\x23\xc1\x0e\x3f\x51\xe9\x63\
\x7d\xde\xca\x5d\x2a\x80\x29\x77\x77\x6b\x7d\x95\x4c\x16\xe2\xa7\
\xde\x0b\x80\xbf\xb6\x1c\x4b\xec\x20\x44\x47\xbb\x0b\xb8\xa6\x27\
\x00\x4e\x07\xa6\x5b\xed\x51\x4c\x9b\x7b\x8f\xe1\xca\x4b\xb6\x6d\
\x06\x20\x7a\x64\x9e\xbd\xad\x6c\x3b\x92\xc9\x82\x7b\xfc\xcd\xdd\
\xd6\x1b\x37\xf1\x76\x00\x5a\x0f\x6d\xc5\x35\x7c\xba\x5e\x7c\x4b\
\x4f\x00\x7c\x10\x60\xea\x8d\xf7\x60\xb5\x3b\x0c\x55\xec\x6f\xf7\
\x52\x51\xb2\x13\x24\x49\x48\x26\x33\x08\x05\x47\xe6\x04\xcc\x0e\
\x77\xb7\x75\x9b\x5d\x1e\x1c\x99\xb9\x88\x50\x10\x21\x14\xdd\xca\
\x5c\x1f\x69\x80\x0e\xe0\x4e\x80\x49\xb3\x17\x18\xae\xbc\xa2\x64\
\x27\xa1\x60\x10\xfb\xa0\x91\xf8\xaa\x0e\xa8\x23\x71\xd4\x75\x86\
\xe9\xef\x1c\x79\xa1\x20\xc8\x66\x10\xca\x28\xc0\x19\x49\x80\x73\
\x01\xe7\xe0\xec\x51\x78\x52\xd3\x0d\x57\x5e\x79\x70\xb7\xda\xd1\
\x61\xd3\xa4\xb6\x23\x6a\xb0\xe0\x1c\x3a\xc9\xb8\xff\x7e\x56\xae\
\x6a\xa8\x4e\x1e\xc2\x96\x38\x04\xd4\x8c\xf8\xb8\x48\x03\xe4\xca\
\x69\x37\x84\x65\x6d\x38\x7e\xa8\x44\xb7\xbe\x04\x9b\x6a\x90\x2c\
\x76\x6c\x89\xd9\xc6\x85\x4d\x83\x47\xa9\x00\x6b\x4a\xb1\x7a\x32\
\xf4\xe2\x9c\x48\x02\x9c\x0d\x30\x22\xf7\xea\xb0\x00\xac\xaa\xd8\
\xaf\xaf\x4d\x00\xd8\x53\x73\x3a\x13\x05\x46\x88\x6c\x75\x60\x8e\
\x4e\x00\x25\x88\x6c\xb1\xeb\xc5\x43\x23\x05\x30\x1d\x48\xb7\xda\
\x1d\xa4\x66\x5d\x61\x38\xbc\xd6\xa6\x7a\xda\x5b\x9b\x91\x2c\xf6\
\x90\x9e\xaa\xd2\xa6\x99\xa1\x62\x89\x1d\x74\xbe\x7e\x45\x04\xe0\
\x44\x80\xcc\x91\x13\x0c\x8d\x79\x75\xa9\x3f\x79\x4c\x85\x96\x90\
\x29\x75\xd4\x1f\xd7\x52\x56\xd9\x86\xd7\x63\x8e\x4e\x54\x53\x65\
\x4a\xb0\xd3\xcf\x8e\x14\xc0\xb1\x00\xc9\x19\xc3\xc2\x32\x7d\x1b\
\x6a\x4e\xe8\x23\x44\x0e\x34\x56\xab\xbf\xc7\xa4\x18\x0f\xd0\x19\
\xa7\xbb\xd7\xfa\xa7\x3b\x52\x00\x87\x03\x24\xa5\x0d\x0d\x0b\xc0\
\xd6\x26\x35\x9b\x6c\x71\x27\x77\x66\x96\x2d\xee\x64\xc3\xeb\x91\
\x2d\x5a\x3c\xad\xfb\x82\x17\x70\x63\xcc\x06\xd7\x9d\x01\x10\x9f\
\x92\x16\x16\x80\xde\x16\x75\xbb\xc2\xe4\x8c\x27\xd4\xd6\x00\xc0\
\x91\x17\x7e\x20\xcc\xee\x54\x2f\x42\x51\x10\x4a\x08\x24\x09\x59\
\x36\x49\x92\x6c\x42\x92\x65\x49\x92\x4d\xc8\xb2\x09\x21\x04\x42\
\x28\x42\x28\x0a\x42\x28\x48\x92\x2c\xc9\x26\x13\x92\xfc\x8d\x58\
\xd7\x5f\x73\x18\x80\xe6\x92\x4d\x5a\x89\x88\x8e\x14\xc0\x64\x00\
\x57\x6c\x42\x78\x01\x3a\xdc\x84\x7c\x2d\x02\x90\x44\x28\x28\x05\
\xea\x8f\x39\x2f\x26\xdc\xed\xc6\x8c\x5b\x18\x29\x80\x89\x00\xd1\
\xb1\x9e\xb0\x00\xec\xf0\xb7\x77\x4e\x31\xc5\xdf\xa6\x2f\x50\x93\
\x51\xcf\xc7\x84\x53\xf6\x45\x0a\x60\x2c\x80\x2d\xca\x19\x96\x5e\
\x04\xfc\xbe\x4e\x5f\x4d\x84\x02\x7a\xf1\x4e\x7a\x50\x8c\x36\x22\
\x12\x80\x6c\x32\x71\xb9\x88\xdc\x17\x1b\x2d\x94\xc0\x00\xc0\x4b\
\x1a\xde\x9a\x73\x2e\x49\x72\xbf\x05\xd8\x04\xd0\xde\xda\x1c\x96\
\xc6\xda\x9d\xaa\x37\x11\xf2\xb5\x81\x6c\x0a\xe9\xc5\xfd\x09\x60\
\x33\xa8\xe7\x54\xc2\x21\x16\xab\xca\x4a\x09\x78\x91\xcd\x36\xdd\
\xcb\x8d\xea\x77\x23\xd0\xd7\xd6\x12\x96\xc6\xea\xdb\xa2\x4a\x7b\
\x0b\xb2\xcd\x29\x7f\xdd\xf2\xf7\x17\x80\x55\x00\x8d\x75\x55\x61\
\x69\xac\x23\x5a\x0d\x49\x43\xde\x26\x4c\x51\x6e\xdd\xd4\x47\xf7\
\x27\x80\x95\x00\x4d\xa7\x6b\xc2\xd2\x58\xa7\x5b\x4d\x8a\x04\xbd\
\x0d\x98\xce\xec\x81\x78\xfa\x13\xc0\x0a\x80\xfa\x93\xc7\xc3\xd2\
\xd8\x98\x78\x35\x71\x10\x6c\xae\xc3\xec\xea\xe4\x96\xd2\x9f\x00\
\x96\x02\x9c\xaa\x3e\x1a\x96\xc6\xba\xb4\x11\x18\x68\xae\xc1\xec\
\x8a\x3f\x2b\xfe\xee\x2f\x00\xf7\x01\x9c\x3c\x72\x30\x2c\x8d\x8d\
\x4b\x52\x33\xc5\x81\xc6\x6a\xcc\xae\xce\x84\x45\x46\x7f\x02\x78\
\x10\xf0\x35\xd6\x55\x87\xc5\x12\x5b\x6c\x76\x5c\xb1\x1e\x35\x4f\
\x77\x26\x0b\x35\xa8\x3f\x01\x0c\x02\x45\x00\xc7\xcb\xf6\x86\xa5\
\xc1\x89\x83\xb3\xd4\x70\xee\x4c\x32\x21\xab\xbf\x85\x72\x5f\xc2\
\x99\xed\x47\xa3\xc5\x93\x92\xa1\x01\xec\xdc\xaf\x18\xd2\xdf\x00\
\x16\x00\x1c\x3d\x54\x1c\x96\x06\x27\x68\x23\x50\xf1\xb5\x20\x99\
\xad\x00\x49\x3d\xe9\x0b\x7e\x3d\x1f\x68\x3d\x27\x2c\x92\xb8\xc8\
\x83\xd6\xe7\x48\x11\x40\x59\x51\x01\x4a\x28\x64\x78\x6a\x4b\xdf\
\xb0\x52\x37\xbe\x33\xf5\xf4\x7b\x0e\x3d\x94\x17\x3c\x17\xe0\x73\
\xc0\x7d\x46\x28\x0e\x74\xf8\x38\x51\xb6\x97\xf4\x11\x63\x0d\x6d\
\x70\x4a\x96\x7a\x93\xc9\x5b\x71\x16\xaf\x1d\xc0\xfb\xe7\xe6\x1e\
\x00\xdb\x39\x7d\x0d\x6a\x9f\x4e\x20\x15\x48\x00\xf6\x00\xbb\x80\
\x45\x40\x47\x77\x00\xb6\x02\xdf\x07\x3e\x03\xfe\x79\x56\x0c\xea\
\x70\x75\x49\xa9\xdf\xdb\x8a\x23\x3a\x96\x13\x65\xfb\x0c\x07\xe8\
\xf6\xfc\x5f\xb7\xef\xa6\x4b\x54\x29\x80\x9f\x5f\x0a\x3c\x7d\x9a\
\x9e\x4f\xa6\x02\xef\x02\x09\x09\x83\xb2\x78\xe0\xb7\xcf\xe1\x49\
\xed\x51\x77\xeb\xec\x8c\xc5\xe9\x1a\x9a\xea\x4e\x12\x52\x82\xf8\
\xbd\x6d\xe7\x1f\x19\x16\x2b\x66\x8b\xf5\x1b\xe5\xed\x6d\xcd\xbc\
\xf2\xc4\xa3\x5f\x1f\x34\x59\xa8\xf7\x8d\x31\x12\x20\x40\x1a\xb0\
\x1e\x18\xe3\x8c\x89\xe3\x9e\x5f\xfe\x85\xec\x31\x93\xe9\xcb\xe2\
\x6d\x69\xe2\xc5\xdf\xfd\x88\x6a\xd5\xd1\xdf\x87\x7a\x2b\xa9\xae\
\x3b\x3a\x2f\xb4\xc2\x37\x03\xaf\x00\xa3\x03\x7e\xdf\x15\xc5\x5b\
\xd7\x13\x1d\x97\xc0\xe0\xec\x51\x7d\x12\x9e\xaf\xad\x85\x17\x7f\
\xbf\x88\xea\x8a\x03\x00\x07\x80\x3c\x0c\xb8\x3b\xfc\x6d\x26\xb2\
\x03\x58\x0b\xd8\x84\xa2\xcc\x38\xb0\xf3\x53\xfc\x3e\x2f\xd9\x63\
\xa6\x18\x7a\x22\x2a\xec\xf0\xbc\xad\xbc\xfc\xf8\x43\x9c\x28\x2d\
\xd1\xe3\xf5\x3c\xe0\xa4\x11\xba\x2f\xc6\xc7\x10\xc0\x87\xc0\x31\
\x60\xde\xd1\x83\x45\xa6\xaa\xf2\x03\xe4\x4c\xfa\xce\x79\xd7\x98\
\xde\x26\x1d\x3e\x2f\x2b\xff\xf8\x30\x47\x0f\x16\xe9\xd9\xa2\x3c\
\xe0\x84\x51\xfa\xbb\xe2\xa4\x15\x02\x9f\x03\xf3\x4e\x55\x55\x3a\
\x0f\xec\xfc\x8c\x9c\x89\x33\x3b\xf7\x29\x7a\x25\x3c\x7f\x3b\xff\
\xfe\xd3\x23\x1c\xd9\xb7\x0b\xd4\x47\x29\xf2\xb4\x4f\x7a\x02\x20\
\xc0\x11\xd4\xab\xf2\xb3\xda\x9a\xea\x93\x76\x7f\xfa\x3e\x59\xa3\
\x72\x71\x27\xa4\xf4\x3a\x78\x81\x0e\x3f\xab\x9e\x7c\x94\xf2\x3d\
\x3b\xd0\x46\x5c\x1e\x06\x5c\xf1\xef\x2e\x40\x80\x7a\xd4\xab\xfa\
\x57\x05\xfc\xbe\xec\xc2\x2d\xef\x12\x9f\x9c\xd6\xe9\xe0\xf6\x06\
\x09\x06\x02\xac\x7a\x6a\x09\xa5\xbb\xb7\xa1\xad\x75\xd7\x01\x87\
\xc3\x51\xd7\xa5\xc6\x59\x7e\x60\x35\x90\x20\x14\x65\xd2\xde\x82\
\x8f\x08\x06\xfc\x64\x8f\x9d\x12\x96\x83\x95\x5d\x85\xb7\xfa\x2f\
\xbf\xe0\xd0\x57\x5b\xd1\xac\x6c\x9e\x66\x75\xe9\x4d\x00\x75\xe3\
\xb2\x5e\x6b\xe4\x8d\x95\xfb\x0b\xe5\x9a\xca\x52\x72\x26\xcd\xc4\
\x64\xb6\xf4\x08\xbc\x50\x28\xc8\xeb\xcb\x7f\xcd\xfe\x1d\x1f\xa3\
\x39\xc7\xd7\x03\x7b\xc3\x59\xa7\x11\x91\xfe\x97\x9a\x71\xb9\xad\
\xee\x78\xb9\xfd\x50\x61\x3e\x57\xe4\xce\xc0\xde\xc5\xf0\xaf\xbb\
\xa2\x84\x42\xac\x5d\xf1\x1b\x4a\xf2\x37\x01\x34\x68\xf0\x8a\xc2\
\x5d\xaf\x51\xa9\x92\x0a\xd4\xeb\xfc\x73\x5b\x1a\xea\xe2\xf7\xe4\
\x6f\x22\x6b\x64\x2e\x31\x9e\xa4\x88\xc1\x7b\xe3\xd9\x65\x14\xa9\
\x17\x10\x9b\x50\x6f\x0a\x7c\x15\x89\xba\x8d\xcc\x35\x9d\x46\x7d\
\xd4\x66\xa2\xbf\xbd\x6d\xc8\xee\x4f\xdf\x27\x61\x70\x26\xc9\xe9\
\xd9\x61\xed\x80\x10\x82\x75\x7f\xfb\x03\xbb\x3e\x79\x47\x8f\x6d\
\xe7\xa2\xbe\xc0\x41\x5f\x03\x08\xe0\x45\x7d\x62\x29\x55\x09\x05\
\x73\x4b\xf2\x37\x21\x9b\xcd\x64\x8d\xcc\x0d\x8b\x71\x11\x42\xf0\
\xce\x3f\xff\xcc\xce\xcd\x6f\xea\x75\xcf\x45\x7d\x4c\x87\xbe\x0a\
\x10\x20\xa4\x65\x72\x5a\x81\x59\xe5\x7b\x76\xc8\xa7\xab\x8f\x92\
\x33\xf1\x3b\x86\x26\x57\x85\x10\xbc\xf7\xc2\x53\x14\x6c\x78\x1d\
\xa0\x1d\xf5\x55\x90\x2d\x91\x36\x5c\xe1\x3c\x09\xb9\x0d\xd8\x0d\
\xdc\x54\x53\x79\xd8\x76\x78\xf7\x36\x46\x4e\xce\xc3\x6a\x37\xe6\
\x2c\xd0\x86\x95\xcb\xc9\x7f\xef\x55\xdd\xa5\xba\x0d\xf5\x95\x36\
\xfa\x13\x40\x50\xb7\x39\xdf\x07\xe6\x35\xd7\xd7\xc6\x16\x7f\xfe\
\x01\xc3\xc6\x4d\x51\xb7\x26\xbb\x21\x1b\x57\x3d\xa3\x3f\xef\xd4\
\x81\xfa\xc6\xcb\x07\x3d\xe5\x77\x46\xe2\x2c\x6e\xad\x16\xb9\x5c\
\xe3\xf7\xb6\xa6\x15\x6e\x79\x57\x24\x67\x0c\x93\x12\x07\x5f\xda\
\x66\xda\x87\x6b\xfe\xc6\x96\xb5\xff\x02\x08\x00\x77\x6b\xcb\x05\
\xfd\x19\xa0\xbe\xc0\xaf\x02\x86\x84\x82\xc1\xb1\x7b\xf2\x37\x61\
\xb5\xd9\xc9\xcc\x19\xdf\x25\x25\x5b\xde\x78\x81\x0f\x5f\x7b\x5e\
\x5f\x67\xef\xd5\x5c\x27\x2e\x07\x80\x7a\xa7\xdf\x06\xfc\x08\x71\
\x5d\x69\xd1\x36\xa9\xb9\xbe\x96\xe1\xe3\xaf\xbe\x28\xe3\xb2\x75\
\xdd\x4a\x36\xbe\xb2\x42\xd7\x73\x3f\xf0\x7a\x6f\x88\xbb\x7b\xe2\
\x38\xfd\xe7\x5a\x78\x75\x73\x55\xf9\x7e\x4b\xe5\xfe\x42\x46\x5c\
\x75\xcd\x05\x8d\x4b\xfe\x7b\xaf\xb2\xfe\xe5\xbf\xea\xe1\xe3\x0f\
\xb5\xd1\xcc\xe5\x0a\x10\xd4\xfd\x88\x8d\xc0\xbc\x86\xda\xaa\x98\
\xbd\x05\x1f\x31\x6c\xfc\x74\x9c\x31\x71\xdf\xf8\xe2\xf6\x8d\x6b\
\x79\xf7\x5f\x4f\xe8\xf0\x16\x03\x2f\xd1\x8b\xa4\x27\x2f\x74\x54\
\xa3\x6e\x17\xcc\x6c\x6f\x6d\x1e\xb4\xeb\x93\x77\x48\x1b\x3e\xfa\
\xac\x7b\x76\x3b\x3f\x7c\x8b\x75\x7f\x7f\x5c\x87\xf7\x08\xf0\x0f\
\x06\xe4\x1b\xe2\x00\xde\x04\x84\x24\x49\xe2\xd6\x45\x8f\x89\x27\
\xde\x2e\x16\x77\x2e\x79\x42\x48\xb2\x2c\x34\x78\x3f\x1d\xc0\x74\
\x61\x91\x80\x3f\x01\x0a\x20\x6c\x0e\x97\x0e\x4e\x00\xbf\x1a\xc0\
\x73\xf1\xb2\x50\xf3\xef\x74\x78\xcb\x06\x90\x74\x5d\xa6\x01\x8d\
\xda\x88\x1c\x90\x4b\x94\xa4\x01\x04\x97\x89\xfc\x0f\xa4\xe6\x12\
\x80\x81\x29\x02\xa3\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
\x82\
\x00\x00\x08\x2e\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x06\x1a\x2b\x3c\x92\x00\xc1\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x07\x89\
\x49\x44\x41\x54\x78\xda\xed\xdc\x7b\x94\x95\x55\x19\xc7\xf1\xcf\
\x19\x87\x51\x61\x80\x60\x20\x20\xd1\x44\x5d\xc2\x1f\x02\x41\x86\
\x8b\xc2\x34\x08\xc9\x5b\x65\x01\xc3\x1d\x87\x28\x1d\xad\x8c\x4c\
\x0b\x45\x90\x5a\xb6\x20\xa4\xcb\x12\x51\x31\xc1\x04\x5d\x24\xae\
\x4a\x96\x96\x22\x17\x4b\x20\x56\xe1\xb2\xb0\x65\x02\xba\xb8\x38\
\x2b\xf1\xc6\xc0\x8c\x82\x8e\xcc\x9c\xfe\x78\xf7\x1c\x66\x06\x38\
\x73\xce\x70\x9b\xcb\xfb\x5b\x6b\xaf\xd9\xef\x7b\xde\xbd\xdf\x33\
\xdf\xb3\xf7\x7e\x9f\xe7\xd9\x7b\xbf\xc4\x8a\x15\xab\x09\x2b\x71\
\x82\xef\xd7\x0a\xe7\x85\x74\x26\x3a\xa3\x00\xa7\xa2\x12\xaf\x61\
\x35\xfe\x15\xff\x34\x07\xd5\x03\xd3\xf0\x37\xec\x47\x32\x83\xb4\
\x09\xa3\x4e\xc2\x0f\xdc\xa8\x5a\x60\x57\xdc\x1d\x40\x9c\x52\x7d\
\xf2\xac\x33\x39\xeb\xd3\x74\x3f\x83\x2e\x5d\x68\xdf\x9e\x53\x72\
\xd9\xb3\x87\x92\x12\x96\x2f\xe7\xa3\x8f\x52\x75\xac\xc5\x04\x6c\
\x6b\x69\x00\xfb\xe0\xd9\x00\xd1\xd0\xa1\x0c\xff\x26\x03\x07\x46\
\xc0\xd2\xa9\xa2\x82\x25\x4b\xf8\xd5\xaf\x29\x2b\x03\x7b\x30\x1a\
\xcf\xb4\x14\x80\xf9\xa1\x0b\xf6\xe8\xd5\x8b\xf9\xf7\x72\xee\xb9\
\xf5\x17\x2a\x2d\xe5\xdd\x77\xc9\xc9\xa1\x7b\x77\x3e\xf8\x80\x1f\
\xde\xcc\x9a\x35\xe0\x63\x8c\xc5\xb2\x96\x30\xe6\xdd\x84\x64\xfb\
\xf6\x92\xff\x7d\x45\x72\xc7\xf6\xf4\xe9\x89\x65\x92\xfd\xfb\xd7\
\x1e\x03\x73\x73\x55\x5d\x79\x85\xe4\x9a\xd5\x92\x45\x45\xb5\x3e\
\x1b\x72\x98\xfb\xf5\x6e\x8a\x2d\x30\x1f\x5f\x40\xbb\x70\x7c\x4a\
\x78\x8a\xc2\xe3\x30\x7b\x36\xa3\x0a\xd3\x57\xb2\x72\x25\x93\xbf\
\x2d\x99\x4c\xa6\xbe\xc7\x8e\xf0\x54\xce\x87\xfc\x7c\x55\xf7\xcd\
\x97\x33\x7e\x42\xaa\xc8\x02\x5c\x57\xa7\x9a\x75\xb8\x1e\x2f\x37\
\x25\x80\xbd\x43\x37\x3d\xa2\x9e\x5b\xc1\xf9\xe7\x1f\xf9\xf3\xdd\
\xbb\xf9\xe2\x25\x92\xe5\xe5\x12\x78\x1a\x23\xc2\x53\x1a\x3e\x85\
\x3f\x62\x40\x8d\x22\x5b\xf1\x59\x94\xd7\xa9\x6a\x13\x3a\xe1\x22\
\xbc\x71\xa2\x01\xe6\x1e\x6d\x05\x97\x5d\x46\xab\x1a\xb5\x3c\xfd\
\xe7\xe8\x6f\x9b\x36\xe9\xcb\x3d\xbe\x8c\x00\x6f\x3b\xae\x0e\x5d\
\xb4\x5a\xff\xc3\x40\x3c\x87\xc1\xe1\xdc\xf0\xc3\xc0\xab\xd9\x85\
\x77\xe2\x93\x78\xa7\xc9\x00\xec\xd9\x93\x07\x17\xd4\x3e\xf7\xe1\
\x87\x5c\x75\x75\xfd\x00\x57\xaf\x4e\x65\x6f\xab\x03\xaf\x5a\x55\
\xf8\x3a\x5e\xc2\x43\x69\x5a\xfc\x4e\x9c\x15\xf2\x2b\x70\x29\xf6\
\x9e\x28\x80\x39\xc7\xba\xc2\xd3\x4e\x63\xd6\x2c\xf6\xed\x4b\x7f\
\xdd\x96\x2d\xa9\xec\x0b\x69\x2e\x2b\xc7\x30\xcc\x4a\x73\x4d\x4d\
\x58\x9f\xc1\x53\x68\xdd\x64\x01\xc2\x86\xbf\xa7\x6c\xb8\x23\xea\
\xc0\x81\x54\xf6\xfd\x7a\xaa\x7b\xfd\x08\x2d\xb4\x96\x1e\x5e\x14\
\x19\xe6\x18\x14\xcc\x9d\xbc\x46\x0f\x70\xef\xde\x43\xd3\x86\x0d\
\x91\x11\x5c\x9f\xda\xb6\x4d\x65\xcf\x39\x16\xff\x48\xb7\x6e\xfc\
\x7e\x29\x1d\x3b\x82\x2b\xf0\x48\x4d\x0f\xa8\x51\x02\xdc\xb5\x8b\
\x3e\x7d\x6b\xa7\xc2\x51\x51\xeb\xaa\x6f\x0c\xbc\xf0\xc2\x54\xf6\
\x27\x69\x2e\x1b\x83\x77\x71\x7f\x46\x4e\x77\x0f\x16\x3f\x42\x7e\
\xbe\x24\x0a\x31\xff\x78\xfb\xd3\x0d\x05\x58\x89\xd2\x90\xf6\xd4\
\xc8\x97\x56\x5f\xf0\xd6\xdb\xe9\x2b\x98\x54\x44\x22\xfa\xd7\x46\
\x60\x29\xce\x08\x1f\x75\xc0\x38\xfc\x03\x8f\x06\xbb\xf0\xba\x30\
\x16\xd6\xab\x0b\x2e\x60\xd1\x42\x89\x53\x4f\x95\xc4\x77\xea\x19\
\x3f\x4f\x1a\xc0\x57\xd0\x31\xa4\x0e\x35\xf2\x1d\x43\xd7\xb1\x70\
\x61\xfa\x0a\xfa\xf5\x63\xfa\xf4\xd4\x61\x21\x4a\xc2\x58\xb7\x1b\
\x8b\xf1\xb9\xf6\xed\x24\xc3\xb8\x06\x0f\xd4\x30\xdc\xd3\x6a\xc0\
\x00\x1e\xb8\x5f\x22\x37\x57\x12\xb7\xd6\xd3\xca\x8f\x4a\xc7\x63\
\x8c\x78\x1b\x93\xb6\x6e\x95\xe8\x54\x40\xdf\xbe\xe9\x21\x7e\x7e\
\x20\xbb\x4b\x79\xf3\xcd\xa8\xeb\xe7\xe5\x45\x65\x26\x7f\x8b\xb9\
\x73\x25\x0a\x3a\x45\x1e\x0b\x3e\x11\x6c\xbc\x0d\x75\xaa\x29\x46\
\x97\xf1\xe3\xe8\xd4\xa9\x76\x77\x3e\xa7\x87\xc4\x5f\x9e\x91\xc4\
\x97\xc3\xf7\xda\xd8\x54\xa2\x31\xd3\xf0\x33\x18\x32\x98\x3b\x67\
\x46\x61\xac\xfa\x54\x5e\x4e\x7e\x7e\xd4\xb5\xb7\x6f\x67\xda\x1d\
\xbc\x70\xd0\xc8\x59\x82\xc9\xf8\xe8\x30\x9e\x48\xef\x67\x9f\xa1\
\x57\xaf\x43\xeb\x7c\xec\x31\xa6\xde\x96\x1a\x76\x26\x86\x61\xa1\
\x51\xb7\x40\xa2\xe0\xe9\x1e\x7c\x69\xdb\x36\xb9\x8b\x16\xb1\x7e\
\x7d\x64\x1b\xe6\xe5\xd1\xa1\x43\x14\x75\xa9\xab\x56\xad\xd8\xb8\
\x91\x59\xb3\x99\x3a\x95\x9d\x3b\x41\x19\x6e\xc0\xf4\x1a\xfe\x76\
\xbd\x2d\x30\xe5\xa6\xf4\x8e\x6c\xd3\xb5\x6b\xe5\xe0\x2a\xfc\x1b\
\x5b\x1a\x7b\x0b\xac\xd6\x79\xb8\x23\xc4\xf3\x5a\x55\x9f\xcc\xcb\
\xa3\x6b\x57\x0a\x0a\x68\xd3\x9a\x8f\x0f\xb0\xef\x03\x5e\xfe\xcf\
\x21\x9e\xc8\xef\x70\x3b\xde\x4c\x73\x8f\xb4\x2d\xb0\x5a\xb3\x66\
\x73\xdf\x7d\x60\x5f\x00\xb9\xa6\x29\x00\xac\x56\xa7\xe0\xef\x0e\
\xc3\x85\xc1\xf6\x4b\xa4\x31\x9c\xff\x10\xdc\xb7\xcd\x19\xd4\x9d\
\x11\x40\xb8\x7d\x5a\x14\xac\x0d\xde\xcb\x50\xfc\xb3\xa9\x00\xac\
\xab\x76\xa2\xb9\x92\xce\xe1\xb8\x4d\xe8\xf2\xaf\x87\xa7\x71\x36\
\xca\x18\x60\x55\x15\x53\xa6\xf0\xa7\x27\x09\x0f\xa4\x4b\x83\x45\
\x71\xf2\xa2\x31\x0d\x54\x59\x18\x8b\x4e\xa8\x72\x72\x98\x33\x87\
\xf2\xf7\x59\xb5\x4a\x67\xd1\xb4\xc3\xc5\x21\x22\x74\x5c\x00\x7e\
\x25\xfc\x4a\x8d\x59\x59\x45\xa4\xf3\xf2\xb8\x77\x1e\xd7\x16\xb1\
\x61\x83\xee\x21\x64\x36\x08\x6f\x1d\x0f\x80\x97\xe0\xc7\x9a\x99\
\x4e\x3f\x3d\x0a\xc3\x8d\x1d\xc7\xa6\x4d\xce\x0b\x10\x2f\x6e\x48\
\x18\x2c\xa3\x2e\xdc\xae\x1d\x37\x14\x37\x6e\x28\x9d\x3b\x67\x39\
\x08\xb7\x8b\x22\x38\x85\x85\x6c\x7d\x4d\xef\xd0\x9d\x07\x87\xa7\
\xf4\xb1\x05\x58\x7c\x3d\xc5\xc5\x9a\x9d\x0a\x0a\x58\xbc\x98\xe1\
\x23\x28\x29\x71\x11\x9e\xc4\x95\xa8\x38\x21\xd1\x98\xe6\xa0\x6e\
\xdd\x78\x74\x09\x05\x05\x29\x97\x6f\x69\x36\x0e\x46\x8b\x07\x08\
\x67\x9f\xcd\x63\x8f\x4a\xb4\x6d\x2b\x89\x6b\x82\x0d\x9a\x88\x01\
\x66\xa1\x5e\xbd\x58\xfc\x48\x2a\x0c\x36\x11\x73\x63\x80\x59\xaa\
\x5f\x3f\x16\x3e\x94\x0a\x83\x4d\x09\x6e\x68\x0c\x30\x1b\x0d\x1a\
\xc4\xbc\x7b\x24\x42\xb0\xe3\xa7\xf8\x5e\x0c\x30\x4b\x5d\x7e\x39\
\xb3\x0f\xc6\xb1\x7f\x83\xf1\x31\xc0\x2c\x35\x72\x24\x33\xa6\xa7\
\xe2\x05\x0f\xe3\xab\x31\xc0\x2c\x35\x69\x12\x3f\xb8\x29\xc5\xe9\
\x09\x07\x57\x49\xc4\x00\x33\xd5\x94\x29\x5c\x3b\x11\x51\x3c\x73\
\x55\xdd\xd8\x40\x0c\x30\x03\x8d\x1a\x55\xeb\x70\x4c\x0c\x30\x0b\
\xed\xdc\xc9\xc4\x89\xa9\x95\x11\xcb\x45\x53\x08\x31\xc0\x4c\xf4\
\xce\x3b\x8c\x1b\xcf\x5b\x6f\x4b\x88\x76\x0f\x8c\x54\x67\x5e\x26\
\x06\x78\x04\x95\x95\x31\x66\x2c\x3b\x76\x20\x9a\xe4\xff\x86\x43\
\x67\x04\x63\x80\x87\xd3\xfe\xfd\x14\x15\xa5\x56\x90\xbd\x2a\x9a\
\x84\xda\x1b\x9b\x31\x19\xa8\xa2\x82\xeb\x8b\xd9\xf8\x22\xa2\x15\
\xaf\x43\xa5\x59\xb4\x19\x03\xac\xa1\xca\x4a\x6e\xfe\x11\xcf\x3f\
\x1f\x0d\x81\xc1\xee\x2b\x89\x5d\xb9\x0c\x35\x7d\x46\xb4\xd1\x27\
\x74\xd7\x61\xa2\xad\x67\x71\x30\x21\x13\xcd\xfe\x45\x6a\xce\x78\
\x1f\xbe\x26\x5a\x5a\x2c\x06\x98\x81\x16\x2c\x60\xfe\x7c\x44\x1b\
\x7a\x46\xe3\xaf\x99\x96\x6d\xf1\x00\x97\x2d\xe3\xae\x9f\x23\x5a\
\x5a\x57\x14\x8c\xe5\x8c\x95\xd1\xa4\xd2\xda\xb5\xf4\xe9\xd3\x78\
\x21\xb4\x6e\x4d\xff\xfe\xd9\x97\x5b\xb1\x82\x5b\x0f\x4e\xda\x7e\
\x5f\x03\x56\x6e\x65\x04\x70\xdd\xfa\x28\x35\x56\xf5\xec\xc9\x8a\
\x67\xb3\x2b\xb3\x6e\x3d\xc5\x37\x48\x56\x55\x49\xe0\x4e\xcc\x6b\
\xc8\xbd\xeb\x03\xf8\x1a\x56\x36\xe2\x1e\xd8\x1b\x5d\xb2\x2d\xf4\
\xd2\x4b\x4c\x9e\x2c\x79\xe0\x80\x04\xee\xc1\xcc\x86\x7e\x81\x46\
\xbf\xa1\x39\x03\x80\x9b\xb2\x69\x81\x9b\x37\x53\x38\x4a\xb2\xb4\
\x54\x22\x74\xd9\xf1\x32\xd8\x46\x11\x3f\x44\xf0\xc6\x1b\x4c\x98\
\x48\x80\xb7\x5c\x34\xfb\x96\x3c\x9a\x3a\x5b\x0c\xc0\xf7\xde\x8b\
\xd6\xc2\xec\xda\x85\x68\x71\xe5\x68\x87\x5f\xf1\x1a\x03\xac\x27\
\xb2\xf2\xa2\x68\xf2\x7c\xdf\xb1\xa8\xbb\xd9\x03\xdc\xbf\x9f\xa2\
\x49\xbc\xfa\x2a\xa2\xb5\xd1\x97\x3b\x86\x9b\x11\x9b\x35\xc0\x8a\
\x0a\x6e\xbc\x31\x5a\xb8\x1e\x82\x02\x43\x1c\xe3\xed\xb0\xcd\x16\
\x60\x65\x25\xb7\xdc\xc2\xaa\xd5\xa9\xc8\xca\x10\xd9\x2f\x1f\x6e\
\xb9\x00\xa7\xcf\x48\xad\x85\x2e\x13\x6d\x3e\xdc\x72\x3c\xee\xd3\
\x2c\x01\xce\xb9\xbb\x56\x64\xe5\x1a\xc7\x61\x87\x52\xb3\x05\xb8\
\x70\x21\xf3\x22\xa7\xac\x32\x98\x2a\xab\xc5\x4a\xeb\x89\x24\x7b\
\xf6\x8c\x5e\xa1\xf2\xcb\xb9\xa9\xd7\xa3\x54\x89\xde\x33\x13\x2b\
\x53\x80\xbf\x7d\x50\x32\x27\x27\x05\xf0\xbb\x31\x9a\x2c\x00\x0a\
\x2f\xeb\x09\xf9\x99\x31\x96\x06\x00\x0c\x69\x5e\x8c\xa4\xe1\x00\
\x97\x68\xfa\xd1\xa5\x93\x06\x70\xb9\x1a\xbb\x41\x63\x65\x07\xf0\
\x29\x27\xe8\x15\x27\xcd\x51\xed\x63\x78\xb1\x62\xc5\x8a\x15\x2b\
\x56\xac\x58\xb1\x62\x35\x41\xfd\x1f\x00\x1a\x38\xfd\x7f\xab\xc1\
\x34\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x0c\x78\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x07\x24\x50\xc5\xa5\x22\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0b\xd3\
\x49\x44\x41\x54\x78\xda\xed\x9c\x79\x74\x53\x55\x1e\xc7\x3f\x2f\
\x7b\xd3\xb4\x69\x1b\xda\x42\x2d\x94\xd2\x85\x45\x2c\x8b\x30\x14\
\x10\x41\x40\x59\x64\x14\x14\x50\xc1\x2a\x0e\xe8\xa8\x07\x90\x03\
\x47\x47\xf1\xa0\x47\x07\x18\x1d\xc4\x91\x71\x45\x1c\x54\x70\x01\
\x54\x14\x45\x04\x1c\x45\x18\x40\xa0\x2c\x02\xb2\x48\x59\xda\x02\
\xa5\x69\x9b\xb4\xa1\x69\xda\xac\x6f\xfe\xc8\x4b\x49\xa1\xb5\xb4\
\x09\xb4\xd2\x7c\xcf\xe9\xe9\xcd\xbd\xc9\xcb\x7b\x9f\xdc\x77\x7f\
\xcb\xfd\x25\x10\x52\x48\x21\x85\x14\x52\x48\x21\x35\x8d\x84\x6b\
\xe0\x1a\xe4\x40\x4f\xe0\x63\x10\xca\x81\x0a\x10\x2d\x80\x19\x38\
\x0d\x9c\x04\x8e\x02\xfb\xbd\x63\x21\x5d\xac\x1b\x00\xf1\x32\xfe\
\x9c\x08\xb2\xfd\xc0\x42\x60\x90\x04\x3e\x34\x03\x25\x80\x07\x00\
\x22\xbb\xde\x06\x82\x0c\x10\x11\x64\x0a\x00\x3c\xce\x2a\x1c\xa6\
\x7c\xec\xc5\xa7\xc0\xe3\xba\x70\xe1\xaa\x30\xab\x5c\xa5\xfd\xd0\
\x65\x35\x2d\x00\xf2\x42\x00\xeb\x92\x4c\x81\x26\x3e\x15\x4d\xeb\
\x74\x90\x2b\x10\x04\x19\xd6\x9c\xed\x38\xcb\x0a\x24\x02\x82\x47\
\x11\x1e\xf3\x85\xcb\x6a\x7a\x02\x38\xd7\xa2\x01\x1a\xfa\x65\xe1\
\x71\x56\xe2\xaa\x28\xc5\x55\x5e\x8c\xb3\xac\x00\x57\x79\x49\xcd\
\x0b\x96\x2b\xd0\xa5\x0f\x40\x1d\xd7\x01\x87\xe9\x34\xe7\x7f\xdd\
\x28\x81\x96\x57\xe1\x71\xcf\x04\xde\x91\x6e\xf9\x96\x05\x50\x1d\
\x9f\x46\xea\xf4\x2f\x2e\x19\xf4\x38\x6c\x54\x9e\x3d\x8c\x2d\x77\
\x2f\xd6\x9c\xed\xd8\xf2\xf6\x56\x8f\xa9\x62\x93\xd1\x67\x8c\xa4\
\x32\xff\x17\xac\x39\xdb\x7c\xdd\x5f\x01\x59\x80\x35\x04\xb0\x16\
\xb9\xac\x26\x4a\x77\x7f\x89\x79\xc7\xa7\xb8\xca\x8b\x01\xd0\x26\
\xf5\x24\xa2\xcb\x60\x8a\x36\xbe\x86\xe8\x76\x01\xec\x01\x86\x00\
\x96\xfa\x8e\x27\x6b\xc2\x0b\x57\x35\xc5\x9b\x2a\x74\x06\x62\x07\
\x4d\x21\xfd\xc9\xf5\xb4\x1e\xf5\x0c\x32\x75\x38\xb6\xbc\xbd\x94\
\x6c\x7e\x8f\xd6\xb7\x3f\x8d\x3c\x3c\x06\xe0\x46\x60\x03\xa0\x6e\
\xae\x00\x63\x80\x77\x9b\xd4\x01\x96\x2b\x31\xf4\xbd\x8f\xb4\x99\
\x6b\xd1\xa5\xdf\x84\xdb\x56\x46\xe1\xb7\x2f\x11\x3b\xf8\xaf\xc8\
\xb5\x51\x00\x7d\x80\x05\xcd\x11\xa0\x01\xd8\x24\x39\xbf\x4d\x2e\
\x85\xce\x40\xbb\xac\x37\x88\xee\x75\x37\xa2\xdb\x45\xd1\x86\x45\
\xc4\x8f\x98\x05\x32\x39\xc0\x54\xe0\x96\xe6\x04\x30\x16\xc8\x05\
\x32\xa4\xb5\x2b\x78\x12\x3d\xee\x46\xcf\x46\x99\x8c\x84\x31\xcf\
\xa3\xcf\x18\x89\xc7\x61\xc3\xb4\x75\x19\x31\x99\xf7\xf9\x6c\xc4\
\xdf\x9b\x0b\xc0\x78\xe0\x27\x40\x27\x3d\x2e\x09\x32\x3f\x77\xa0\
\xc7\x48\x18\xf3\x3c\x32\x55\x18\x76\x63\x0e\xea\x56\x49\xbe\xee\
\xfe\x40\x72\x53\x03\x4c\x90\xe0\x75\xf1\xeb\x3b\x17\xdc\x19\x28\
\x7a\x02\x3d\x84\x4c\x15\x46\xdc\xb0\x19\x00\x58\x0e\xac\x47\x9f\
\x31\xc2\x37\x34\xa6\x29\x01\xb6\x05\x36\x03\x9d\xda\xb4\xef\x48\
\xd6\xec\x7f\xfb\xfa\x83\x1b\xd8\x0b\x42\x50\xae\x25\xaa\xc7\x9d\
\x00\xd8\x72\xf7\xa0\x8e\xeb\xe0\xeb\xee\xd5\x54\x00\xdb\x4b\xf0\
\x52\x13\x52\xba\x30\xf9\xc5\xf7\x08\x0b\x8f\xac\x76\xc9\x82\xcc\
\x2f\x28\xd7\x22\x57\x6b\x51\xe8\x0c\xde\x49\xed\x76\xfa\xba\xef\
\x03\xe2\xae\x36\xc0\x14\x09\x5e\x72\xdb\xf4\x0c\xa6\xbc\xb0\x04\
\x6d\x84\xbe\x86\x01\x6c\x8e\x33\xd0\x4b\x51\x21\xad\x0a\x35\x22\
\xba\xc9\x57\x13\x60\x47\x09\x5e\xbb\xa4\xce\x3d\x78\xe8\xf9\x77\
\xd0\x84\x47\x5c\x12\x14\x04\x19\x60\x50\xa2\x2a\xd1\xe3\xc1\x65\
\x31\x02\xe0\xae\x28\xf5\x1f\xba\xf7\x6a\x01\xec\x2c\x19\x8c\xeb\
\x92\xaf\xef\xc5\x43\xcf\xbd\x8d\x46\xab\xbb\xf2\x2b\xad\xc7\xe3\
\x0e\xc6\x61\x2a\x4e\x65\x03\xa0\x8c\x4e\xc4\x5d\x79\xde\x7f\x28\
\x03\x48\xbd\xd2\x00\x33\x24\x78\xad\x53\xbb\x65\xf2\xe0\x9c\x37\
\x51\x69\xb4\x57\xc5\xcc\x8b\x62\xe0\x00\x45\x51\xa4\xf0\xdb\x7f\
\x02\xa0\x4b\xe9\xc3\xf9\x5f\x37\x22\x08\x02\x89\x69\x5d\x7d\x4f\
\xb9\xf5\x4a\x02\xec\x01\xfc\x08\xc4\xa5\xf5\xe8\x4f\xd6\xec\xd7\
\x51\xa9\xc3\x2e\x0d\xe6\x9d\x0e\x5f\xd3\x1e\x64\x47\x3a\x60\x37\
\xa6\x64\xcb\x52\xec\xc6\x1c\x64\x6a\x1d\xee\xaa\x72\x00\xd2\x7a\
\xf4\xa7\xe7\x2d\x77\xf8\x9e\xd2\xef\x92\x48\x26\x48\xa7\xdf\x5b\
\x0a\xbe\xa3\x3b\xf5\x1e\xc4\x84\x27\x17\xa2\x50\x2a\x6b\xcf\x86\
\x5c\x00\x58\xd5\x9c\x66\xa0\x79\xc7\x0a\x8a\x36\x2e\x02\x20\xfa\
\x4f\x63\x31\xfd\xef\x03\xef\x94\x9b\x30\x15\x99\xac\x3a\xfb\x9f\
\x79\x25\x00\xf6\x03\xd6\x01\xfa\xeb\x33\x87\x72\xcf\xcc\x97\xeb\
\x84\xd7\x1c\xd7\x40\x8f\xa3\x92\xc2\x75\x0b\x28\xcd\xfe\xdc\x9b\
\xe5\xc8\xbc\x97\xd2\x5d\xde\xf6\x80\xd1\x93\xb8\x2e\xa5\x0b\x6e\
\x97\xd3\xdf\xb3\xd0\xe1\x97\x2b\x0c\x14\xe0\x00\x09\x9e\x2e\xe3\
\xa6\xe1\x8c\x9b\x31\x1f\xb9\x5c\x41\xd3\x48\x14\x1b\xba\xde\x59\
\x0e\xac\xa3\x68\xc3\x22\x9c\x96\x42\x04\xb9\x92\x98\x3e\xf7\x52\
\xb6\x6f\x8d\xe8\xb1\x5b\x85\x0e\x5d\x7b\x8b\xb7\x4e\x98\x26\x78\
\xbd\x1a\x25\x86\x84\x24\x4c\x05\x79\x82\x04\x71\x7f\x30\x00\x0e\
\x01\xbe\x06\xb4\xdd\x07\x8e\x62\xec\xb4\xbf\x23\x93\xcb\x69\x32\
\x09\xb2\xcb\x7a\x73\x97\xcd\x82\xe5\x97\xb5\x98\x77\xae\xc4\x51\
\x92\x0b\x80\x3a\x3e\x0d\x5d\x6a\x5f\xcc\x3b\x57\x78\x44\x97\x43\
\xd6\xae\x63\x37\xee\x7f\x66\x91\xe0\x7f\x27\xb5\x6a\xd3\x0e\x53\
\x41\x1e\x40\x52\x30\x00\x0e\x03\xbe\x04\xc2\x7a\x0d\x19\xc3\xe8\
\xc7\x9e\x6b\x0c\xbc\xdb\xa5\xb5\xf3\x28\x50\x1e\x04\x80\xb2\xba\
\x6c\x8b\xbd\xf8\x04\x15\x27\xb3\x29\x3f\xfc\x23\xb6\xbc\x7d\xd5\
\x11\x86\x32\xaa\x0d\xfa\x8c\x11\x54\x19\x8f\x8b\xa6\x6d\xcb\x04\
\x40\x76\x43\xff\xdb\xb8\x7b\xea\x8b\x97\x78\x0f\x11\xd1\xb1\xbe\
\x66\xbb\x40\xd7\xc0\x91\xc0\x6a\x40\xdd\x67\xf8\x78\xee\x78\xe4\
\xd9\x40\x7c\xd8\x5d\xd2\xff\x22\xe0\x94\x94\xea\x2a\x00\xf2\x01\
\x23\x50\x08\x98\x24\xc0\x65\x40\x65\x2d\xc6\x47\x03\xe0\xb2\x9c\
\xd3\xda\xf2\xf7\xe3\xb4\x18\x71\x9e\x2f\xc4\x6e\x3c\x81\xbd\xf8\
\x14\x55\xe7\x8e\x22\x3a\xab\xfc\x41\x13\x9e\xda\x17\x6d\x52\x4f\
\x1c\xe6\xd3\x9e\x92\x2d\x4b\x05\x40\x50\x69\xc2\xc4\xe1\x0f\xcc\
\x14\xfa\x0c\x1f\x5f\xeb\xf5\x44\x1a\xaa\x23\x39\x43\x20\x00\x47\
\x03\x2b\x01\x55\xdf\x91\xf7\x31\x6a\xca\xd3\x0d\x86\xa7\xd6\x86\
\x5f\x68\xc7\xa7\xe1\x30\xe5\x21\xba\x1c\x71\x52\xac\xd9\xa7\xd1\
\x2b\xa0\xdb\x25\x9c\x5a\x9c\x55\xeb\x98\x42\x1f\x4f\x78\xfb\x5e\
\x68\x12\x3a\x21\xba\x5d\x94\x1f\xd9\x54\x55\xfc\xc3\x9b\x1a\x40\
\x26\x08\x02\x19\x03\x46\x30\x2c\x6b\x86\x10\xd5\xaa\x75\x9d\xc7\
\x57\x28\xd5\x35\x3e\xb0\xc6\x00\x1c\x0b\x7c\x02\x28\x6f\xba\xe3\
\x01\x46\x4c\x9a\xd5\xa8\x99\x27\x97\x5d\x78\x4b\xb9\x36\x8a\xe8\
\xe4\x5e\xc8\x34\x11\x08\x72\x05\x82\x5c\x09\x1e\x37\x2e\x6b\x09\
\x2e\xab\x19\x97\xd5\x84\xdb\x66\xc1\x5d\x69\x71\x7b\xec\x15\x1e\
\x8f\xcb\x2e\xc3\xe3\xae\xb1\x56\x08\x72\x25\x32\x75\xb8\x28\xd7\
\x44\x08\xf2\xf0\x68\x14\x3a\x03\xca\xa8\x36\xa8\x62\x12\x91\xa9\
\x75\x20\x7a\x70\x98\x4f\x63\x3d\xfe\xb3\x68\x39\xb0\x0e\x44\x51\
\x00\x34\x0a\x95\x9a\xee\x03\x46\x72\xd3\xe8\x49\xc4\x25\x26\xd7\
\xff\xc1\x87\x55\xdf\xd2\x91\x8d\x01\x38\x01\x58\x06\xc8\x07\xde\
\x3d\x99\x61\xf7\x3f\xd1\xe8\xa5\x4a\x1f\x7b\xe1\x53\xb6\x9d\xca\
\xc6\x26\x85\x4e\xfe\xb7\x98\x32\xaa\x0d\xca\xc8\x78\x14\x91\xb1\
\x68\xe2\xd3\x90\x6b\xf5\x72\x59\x58\x84\x5c\xa6\xd4\x22\xd7\x84\
\x23\x8a\x1e\x04\x99\x52\x72\x43\x6c\x78\x9c\x95\x82\xdb\x66\xc1\
\x5d\x61\xc6\x69\x31\x62\xcb\xdd\xe3\x29\xdd\xbd\x5a\x14\x9d\x55\
\xf2\x1a\xac\x15\x0a\x92\xbb\xf6\xa6\x6b\xdf\x5b\xc9\xe8\x3f\xac\
\xb6\xf8\xbc\x6e\x77\xc7\x5d\x1d\xba\x0b\x0d\x05\xf8\x20\xf0\x1f\
\x40\x3e\xf8\x9e\x47\x19\x7a\xef\xe3\x01\xad\xf5\x7a\x43\x3c\xf3\
\xbf\x3c\x80\xc5\x64\xa4\x30\xf7\x18\xc6\xfc\xe3\x94\x9c\xcd\xc5\
\x54\x98\x4f\xf1\xd9\x5c\xac\x65\x26\x9c\xa5\x67\x71\x96\x9e\x0d\
\x28\x37\x0a\x10\xa6\x8b\x24\x21\xb9\x33\x89\xe9\x5d\x49\xea\xd8\
\x9d\xe4\xae\xbd\xfd\x67\x52\x03\xdd\x4c\x4f\xad\x49\x90\xfa\x00\
\x3e\x0c\x2c\x06\x84\xdb\x26\x4e\x67\xd0\xd8\x29\x41\xf3\x3a\xf4\
\x86\x78\xf4\x86\x78\x3a\xde\x38\xa0\x46\xbf\xd3\x5e\x45\x69\x51\
\x01\x56\x8b\x99\xf3\x66\x23\x15\x16\x33\xb6\x72\x0b\xf6\x4a\x1b\
\x4e\x47\x15\x55\x15\xe5\x35\xd2\x4c\x4a\xb5\x06\x95\x3a\x0c\x6d\
\x84\x1e\x6d\x84\x1e\x9d\xde\x40\x74\xfc\x75\xc4\xb4\x6e\x8b\x4e\
\x1f\x13\xb4\xf3\xb5\x57\x56\xe7\x7f\x4b\x2f\x17\xe0\xe3\xc0\x1b\
\x80\x30\xe2\xc1\x99\x0c\x18\x3d\xe9\xaa\xb8\x73\x4a\xb5\x86\xb8\
\xb6\x1d\x88\x6b\xdb\x81\xe6\xa4\x0a\x4b\x35\xb7\xe2\xcb\x01\x38\
\x03\x78\x15\x10\x46\x4d\xfe\x1b\xfd\x46\x4d\xa4\xa5\xab\xac\xa4\
\x7a\x0b\xc7\x58\x1f\xc0\xa7\x80\x97\x01\xee\x7c\x74\x0e\x7d\x86\
\x8d\x23\x24\x30\x15\xe4\xfb\x9a\x27\x7f\x0f\xe0\x1c\xe0\x45\x41\
\x26\x63\xf4\x63\xcf\xd1\x7b\xe8\x5d\x21\x72\x80\xc3\x5e\x89\xb9\
\xf0\xb4\xcf\x80\x1c\xa9\x0b\xe0\x5c\xe0\x59\x80\xb1\xd3\xe6\xd2\
\x63\xd0\xa8\x10\x39\x49\x67\x8f\x1f\xf2\x25\x7b\xf6\x03\xb6\xda\
\x12\xaa\x71\x78\xcb\x18\x50\x6b\x75\x21\x78\x17\xe9\xf8\xfe\x1d\
\xbe\x66\x76\xad\xfe\x92\x14\x8b\x8e\x00\x5c\x76\x9b\x95\x1d\xdf\
\xad\x0c\x51\xf3\xd3\xe1\x9d\x9b\x7c\xcd\x0d\x75\x01\x04\xf8\x19\
\x98\x04\x88\xdf\x2c\x99\xef\x4f\xbd\x45\xab\x30\xef\x18\xc6\xfc\
\x1c\xa4\x64\xc6\xef\x02\x04\xf8\x18\x98\x2f\x8a\x22\x1f\xbd\x34\
\x83\xa2\x33\xa7\x5a\x3c\xc0\x6d\xdf\x7c\xe4\xcf\xa6\xb2\x3e\x80\
\x3e\x4b\xbc\xda\x51\x65\x63\xd9\xbc\xa9\x58\x2d\xe6\x16\xec\xfb\
\x15\xb2\xef\xa7\xb5\xbe\x87\x8b\xeb\x8c\x19\x2f\xce\x0c\xe1\xad\
\x11\xde\x6d\x2e\x3c\xcd\x8a\x57\x9e\xc4\xe5\x74\xb6\x48\x80\x5f\
\xbd\xfd\xa2\x2f\x89\xf0\x15\x70\xb0\xd6\xec\x52\x1d\xaf\x75\x02\
\xdf\x01\xe3\x4b\x8b\x0a\x22\xad\x65\x26\x3a\xf7\x1e\xd4\xa2\xe0\
\x6d\xfa\x7c\x09\xd9\x1b\x3f\x07\xef\x06\xd2\x9f\xa9\xa3\x5e\xfa\
\xf7\xf2\xf0\xe7\x81\x2d\xc0\xfd\x05\x27\x8f\x28\x55\x9a\x30\x92\
\x3a\x75\x6f\x11\xf0\x76\x6e\xf8\x8c\x75\xef\x2f\x00\x70\x03\xf7\
\x70\x21\x73\xde\x20\x80\xe0\xad\xe1\x3b\x06\x8c\x3b\x71\x70\xa7\
\x90\x90\xdc\x91\xd8\xeb\x92\xaf\x6d\x78\xeb\x57\xb1\x66\xf1\x5c\
\xdf\x52\x36\x55\x32\x1e\x34\x16\x20\xc0\x61\xc0\x81\x28\x0e\x39\
\xba\x7b\xb3\xd8\xa9\xf7\x40\x41\x17\x65\xb8\xe6\xc0\x89\xa2\xc8\
\x7f\x3f\x7d\x93\xf5\xcb\xfe\xe5\x83\x37\x13\x6f\x36\x8a\x40\x01\
\x02\x6c\x03\x52\xdd\x2e\x57\xc6\xd1\xdd\x5b\xe8\x3e\xf0\x76\x54\
\x9a\xb0\x6b\x06\x9e\xbd\xd2\xc6\xaa\xd7\x66\xb3\x6b\xc3\x2a\xdf\
\x6d\x3b\xf5\x72\xe0\x41\xc3\xbe\x68\xa3\xc6\x5b\x38\x94\x99\x98\
\x76\x03\x8f\xcc\xfb\xa0\x69\x2a\x10\x82\xac\x82\x93\x47\xf8\x64\
\xc1\x2c\xcc\x85\x67\x7c\xeb\x7e\x16\xde\xfd\x6e\x82\x0d\x10\xbc\
\x55\xf6\xd9\x40\x52\xb7\x9b\x47\x32\x7e\xc6\x3f\x82\x55\x96\x77\
\xd5\x55\x59\x71\x9e\x4d\xab\xde\x65\xeb\xd7\xcb\x7c\x5d\x87\x80\
\xbb\xa4\x35\xff\xb2\xd5\xd0\xdd\x70\x1b\xf0\x03\x30\xd1\x98\x97\
\xa3\x96\x2b\x94\x24\x77\xb9\xf1\x0f\x05\xce\x51\x65\x63\xeb\x37\
\xcb\xf9\xf8\xe5\x99\x9c\xfa\x35\x1b\xc0\x03\xbc\x2e\x59\x5b\x63\
\x43\x8f\xd7\x98\x5a\x8c\x22\xc9\xb0\x8c\x3f\x79\x70\x97\x2c\xae\
\x5d\x0a\xf1\x6d\x53\x1a\x74\x80\x1d\xdf\xad\x40\x14\x3d\x44\x44\
\xb5\x22\x48\xa5\xcd\xf5\xca\x74\xee\x34\x5b\x56\x2f\xe5\xd3\x85\
\x4f\x72\x6c\xcf\x56\xdc\xde\x2a\xb1\x9f\x80\xbb\x81\xf7\x69\x64\
\xc5\x6c\x20\xf7\xdf\x2c\xe0\x15\xa5\x4a\xc3\xc3\x73\x97\xfa\x17\
\x21\xd6\xab\xb9\x0f\xdc\x8c\xad\xbc\x0c\xa5\x4a\x43\x4a\xb7\x4c\
\xda\xa5\x67\x90\x98\xde\x95\xc4\x94\xeb\x1b\xb4\xd5\x58\x9f\x55\
\x3d\x97\xfb\x1b\xc7\xf6\x6e\xe3\xd0\xcf\xdf\x73\xf6\xc4\x61\xff\
\xe1\xed\xc0\x3c\xbc\x85\x51\x01\x29\xd0\x05\x6c\x09\x30\x25\xd2\
\x10\xcf\x63\x2f\x2d\x47\xff\x3b\x3b\xfb\xfe\x9a\x3d\x26\xa3\xce\
\xb1\xa8\xd8\x36\xb4\x6e\xdf\x91\x56\x6d\xda\x11\xd3\x3a\x11\xbd\
\x21\x9e\xa8\xd8\x04\x34\xe1\x11\x68\xb4\x3a\xc2\x74\x17\xf6\xb5\
\x3d\x6e\x37\xf6\xca\x0a\xca\xcb\x4c\x58\xcb\x4a\x30\x17\x9e\xa1\
\xe8\xcc\x49\x8c\xf9\xc7\xc9\x3b\xb2\x0f\x47\x55\x8d\xdc\x67\x05\
\xf0\x99\x74\xce\xdb\x83\x35\xb3\x03\x05\xa8\x92\x42\xbe\xc1\x09\
\x29\x5d\x78\x64\xde\xfb\xb5\x56\xa5\x5e\xac\x17\x26\xf6\xc3\x6e\
\xb3\x82\xb7\x24\xb8\x1b\xde\xc2\xc5\x5e\x52\x5b\x13\xc4\x3b\xf7\
\x34\xb0\x51\x3a\xc7\xef\xb8\x28\x9b\xdc\x1c\x00\x02\xb4\xc2\x9b\
\x4b\x4c\xbd\x3e\x73\x28\x13\x9e\x5a\x58\xaf\x65\xf6\x03\x18\x75\
\x51\x8c\xa9\xc0\x5b\xe1\xdf\x05\x6f\x41\x77\x32\xde\x72\xb2\x04\
\x40\x8f\xb7\xac\x42\x7f\x51\xe2\xa3\x0c\xef\x56\xa3\x11\x6f\x51\
\x52\x0e\xde\x6f\xb0\xef\x96\x00\x5e\x51\x05\xcb\x07\x49\x97\xe2\
\x45\xfd\xc0\xbb\xfe\xc2\xb0\xac\x19\x8d\x05\xf8\x87\x53\xb0\x4c\
\xe0\x31\xc9\x87\x72\x6f\x5e\xbd\x94\x5f\x36\x7f\xdb\x62\xb2\x36\
\xc1\xf4\x21\x7e\x04\xa6\x01\x7c\xf1\xc6\x1c\xf2\x7f\xdb\x1f\x02\
\xd8\x08\xbd\x0d\xbc\xe5\x76\xb9\x58\x3e\x7f\x3a\x65\xc5\xe7\x42\
\x00\x1b\xa1\xe9\xc0\xf7\x15\xe7\x4b\xf9\x70\xee\x54\xff\xa2\x9c\
\x10\xc0\xcb\x94\x1b\x18\x07\x1c\x32\xe6\xe7\xb0\xf2\xd5\xa7\x09\
\xc2\x77\xa1\x5b\x14\x40\x24\xcb\x3a\x1a\x28\x3e\xba\x7b\x33\xeb\
\x97\xbf\x16\x02\xd8\x08\x1d\x97\x02\x74\xe7\xd6\x35\x1f\x92\xfd\
\xfd\x17\x21\x80\x8d\xd0\x26\xe0\x51\x80\xaf\xdf\x9d\xc7\x89\x83\
\xbb\x08\xa9\x71\x7a\x09\x10\xc3\x23\xa3\xc5\x59\x6f\xad\x15\xd5\
\x5a\x9d\xef\x27\xe9\xf4\x21\x34\x97\x27\x39\xb0\x06\x10\x5b\x25\
\xb4\xf7\xff\x4d\xbf\x10\xc0\x06\x48\x27\xc5\xa8\x21\x80\x01\x28\
\x51\x0a\xfc\x7d\x00\xa3\x42\x48\x1a\xae\xcc\xd0\x0c\x0c\x5c\x0f\
\x87\x00\x06\xae\xe5\x21\x80\x81\x1b\x15\x55\x08\x43\x48\x21\x05\
\xa2\xff\x03\xe2\xf8\x22\x43\x04\x4e\x0c\x50\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x0c\x44\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x02\x0b\
\x0c\x31\x19\xaf\xc5\xf4\x83\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0b\x9f\
\x49\x44\x41\x54\x78\xda\xed\x9c\x69\x50\x54\x57\x16\xc7\x7f\x0f\
\x9a\x6e\x1a\x64\x15\x9a\x45\x6c\x09\x0a\x91\xc5\x46\x81\x44\x34\
\xb8\x24\x48\x50\x94\xc8\x62\x20\x98\x60\x62\xcc\x62\x9c\x99\xaa\
\x4c\x26\x55\xb3\x7c\xc8\x54\x66\x6a\x2a\x53\x93\x54\xcd\x64\x3e\
\x4c\x92\x4a\x46\xc7\x98\xc5\xc8\xa0\x88\x5b\x8c\x93\x68\x74\x50\
\xc7\x8c\x8e\x28\x08\x82\x2b\x8b\xa0\x80\xb8\x42\xd3\x74\xf3\xe6\
\x43\xf7\x83\x96\xb0\x74\xd3\xdd\x2c\xca\xbf\xaa\xab\xde\xed\xf7\
\xde\x7d\xf7\xfd\xdf\xbd\xe7\xdc\x73\xee\x39\x17\xc6\x31\x8e\x71\
\x8c\x63\x1c\xe3\x18\x22\x84\x51\xdc\x36\x19\xa0\x37\x1d\xab\x4d\
\xe5\xfe\xd0\x01\xb4\x99\x95\x75\xc0\xdd\xfb\x89\xc0\x09\xc0\x01\
\xc0\x15\xf0\x36\xbd\x30\x80\x3b\x20\x37\xbb\xce\xa3\x17\x51\x52\
\xfb\x2e\x9b\x48\xb4\x06\x22\x70\x11\x48\x01\x2e\x38\xf2\x2b\x0f\
\x07\x92\x81\x78\x5b\x2b\x71\x12\x04\xbc\xbc\xbc\x7e\xf4\xbf\x5e\
\xaf\xa7\x53\xaf\xef\x2e\x1b\x0c\x06\x3a\x3b\x3b\x05\x20\x0c\x48\
\x05\x3e\x18\xcb\x3d\x50\x09\x54\x02\xea\x88\xa9\x53\x49\x4b\x49\
\xe9\x3e\xe1\xe2\xe2\x82\xcc\xd9\xb9\xbb\x2c\x57\x28\x70\x76\x72\
\xe2\xad\x77\xde\xe9\xb3\x07\xbe\xb1\x6e\x9d\xe8\xed\xe5\x65\x51\
\x9b\x0f\x1d\x3d\xca\xbe\xfd\xfb\x01\xf6\x02\x8b\xc7\x6a\x0f\x74\
\x06\xbe\x02\xd4\x3e\xde\xde\x3c\x9d\x91\x81\x42\x2e\x1f\x96\x0f\
\x3e\x6b\xc6\x0c\xbe\xfb\xfe\x7b\xd1\xd0\xd5\x95\x0a\x24\x01\xff\
\x76\xc4\x0b\x3a\x39\x90\x3c\x57\x60\x3b\x90\xee\xa6\x54\xb2\x32\
\x3b\xdb\x16\xf2\x44\xab\x85\xae\xbb\x3b\x73\x67\xcf\x96\x08\xdf\
\x68\x92\xaf\x63\x86\x40\x5f\xe0\x5b\x60\xa9\xab\x42\x21\xe6\xe7\
\xe6\x12\xa0\x52\xd9\x52\xdf\x2d\x80\x8e\x8e\x0e\xab\x6e\x7a\x3c\
\x29\x09\x95\x9f\x1f\x26\x59\xf8\x0f\x47\x88\x2c\x47\x10\x18\x0e\
\x1c\x06\xe6\x7a\x7a\x78\xf0\x52\x7e\xbe\x30\x29\x28\xc8\xba\x71\
\x2a\x08\xe6\x22\x60\xe8\xf2\x49\x26\xe3\x99\xac\x2c\x14\x72\xb9\
\x08\x64\x01\x7f\x1a\xed\x04\x26\x03\x47\x81\x87\x03\x55\x2a\x5e\
\x5e\xb5\x0a\x95\xbf\xbf\xd5\x95\xc8\x7b\x86\xfa\x04\x5b\x1b\xe4\
\x37\x71\x22\x79\xd9\xd9\x82\xb3\x93\x13\xc0\x9b\xc0\x5b\xa3\x95\
\xc0\x9f\x00\x5f\x03\xbe\xd3\xc3\xc3\x59\x93\x9f\x8f\x97\xa7\xe7\
\xa8\x98\x91\x87\x85\x86\x92\x95\x9e\x2e\xf5\xec\xb7\x81\x5f\x8c\
\x26\x2d\xec\x02\xbc\x0f\xbc\x06\x30\x7f\xce\x1c\x9e\x58\xb0\x00\
\x27\x61\x74\x19\x39\x33\xa2\xa2\xd0\xeb\xf5\x14\xed\xda\x85\x08\
\xef\x99\x3a\xcf\xbb\x23\x4d\xa0\x0f\x50\x00\x24\xcb\x9c\x9d\x59\
\x9e\x96\x46\x6c\x4c\x8c\xcd\x2f\x2b\x76\x75\x39\x84\xc4\x59\x1a\
\x0d\x5d\xa2\xc8\xf6\xdd\xbb\x31\xc9\x43\x67\xe0\x8f\x23\x45\xe0\
\x14\x60\x17\x10\xed\xee\xe6\xc6\xca\x15\x2b\x98\x3c\x69\x92\xcd\
\x2f\xa9\x37\x18\xd0\x75\x76\xf6\xfe\xfb\x26\xc0\x95\xc6\x46\x5b\
\xb5\x39\xf1\xb1\xb1\x00\x14\xef\xd9\x83\x28\x8a\xef\x98\x46\xd0\
\xef\x87\x5b\x06\xc6\x09\x82\x70\x0c\x88\x56\xf9\xfb\xb3\x76\xf5\
\x6a\xbb\x90\x07\x70\xfc\xe4\x49\xe9\xf0\x1c\x70\xdb\x74\x5c\x03\
\x50\x59\x5d\x6d\x97\x67\xc4\xc7\xc6\x92\xb5\x6c\x99\x24\x13\x7f\
\x07\xfc\xc6\x16\x4b\xc1\x5a\x24\x09\x82\xb0\x4f\x14\x45\xdf\xb0\
\xd0\x50\x56\xe5\xe6\x32\xc1\xdd\xdd\x2e\x2f\xd6\x25\x8a\x14\x16\
\x17\xd3\xae\xd5\x02\xac\x03\xca\x4c\xa7\x8e\x02\xaf\x37\xb7\xb4\
\x38\x45\x47\x46\xe2\xee\xe6\x66\xf3\xb3\x02\x55\x2a\x7c\xbd\xbd\
\xa5\x8f\x92\x0c\x68\x81\x12\x47\x13\xf8\xa4\x69\xd8\xba\x47\x46\
\x44\x90\x97\x9d\x6d\x3e\xe5\xb0\x19\x95\xd5\xd5\xfc\x70\xe2\x04\
\x26\x2f\xca\x5a\x33\x0b\xe4\x36\x10\x02\xc4\x1b\x0c\x06\xa6\x87\
\x87\xdb\xe5\x79\x81\x2a\x15\x3e\x5e\x5e\x12\x89\x8b\x80\x3b\xc0\
\x11\x47\x0d\xe1\x14\xa0\x18\x50\x26\xcc\x9c\x49\x6e\x66\xe6\x3d\
\x8e\x00\x7b\xe0\xe4\xe9\xd3\xd2\xe1\x87\x40\x6f\x4d\xf2\x1e\xc0\
\xe9\x8a\x0a\x74\x3a\x9d\xdd\x9e\x39\x73\xc6\x0c\x96\x2f\x59\x22\
\x15\xdf\x05\x5e\x71\x04\x81\xb3\x81\x22\x40\x31\x3b\x3e\x9e\xf4\
\xc5\x8b\x71\x72\xb2\xef\x1c\x5c\xab\xd5\x52\x75\xfe\xbc\x54\xfc\
\xb4\x8f\x4b\xaa\x80\x1f\x74\x3a\x1d\x67\xcf\x9d\xb3\xeb\xb3\xe3\
\x62\x63\x59\x96\x9a\x2a\x39\x2b\xfe\x66\x8d\xf7\xc6\x12\x16\xc2\
\x81\x9d\x80\xdb\x2c\x8d\x86\xb4\x94\x14\x73\x53\xcb\x6e\xb8\x58\
\x53\x83\xc1\x60\x00\x38\x09\x34\xf6\x73\xd9\x16\xc0\xee\x04\x02\
\x3c\x1a\x17\xc7\xfc\x39\x73\x24\xb1\xb6\x19\x98\x66\x0f\x02\x3d\
\x4d\x32\xcf\x2f\x62\xea\x54\x96\x2f\x59\xe2\x10\xf2\x00\xae\x34\
\x34\x48\x87\x7b\x06\xb8\x6c\x1f\x40\xdd\x95\x2b\x0e\x69\x43\xf2\
\x82\x05\x44\x46\x44\x00\x78\x99\x3c\x49\x1e\xb6\x12\xf8\x31\x10\
\xee\xef\xe7\x47\x4e\x66\xa6\xdd\x87\xad\x39\xae\x35\x37\x4b\x87\
\x67\x06\xb8\xac\x1c\xa0\xb5\xb5\x15\xbd\xb1\xb7\xda\x15\x82\x20\
\x90\x95\x9e\x8e\x9f\xaf\x2f\x40\x94\x69\x38\x0f\x99\xc0\x57\x80\
\x1c\x85\x5c\xce\xca\xec\x6c\xe4\x2e\x2e\x0e\x35\xb5\xf4\x3d\x2e\
\x79\xed\x40\x97\x61\x52\xcd\x5d\x0e\x20\x10\x40\x21\x97\xb3\x72\
\xc5\x0a\xa9\xb3\x3c\x07\x64\x0e\x85\xc0\x00\xc9\x4e\x4c\x4b\x49\
\x61\xa2\xf1\x8b\x38\x14\xae\xae\xae\xd2\xe1\x40\x8b\x47\xc1\x00\
\x2e\x32\x99\x68\xcf\xe9\x53\x5f\x1e\x9c\x25\x8b\x16\x99\xcf\x08\
\xbc\xad\x25\xf0\x6d\xc0\x73\x6a\x68\x28\xb3\x34\x9a\x61\x31\xf6\
\xcd\x2c\x99\xdf\x0e\x30\x3f\xfd\x2b\x40\xa8\x5a\xed\x70\x4f\xc5\
\xa3\x71\x71\x52\x9b\x54\x03\xb9\xc0\xfa\x22\x70\x1a\xb0\xc6\x49\
\x10\x48\x7b\xf2\xc9\x61\xf3\x96\xcc\x8c\x89\xc1\x4d\xa9\x94\x14\
\x57\x23\xf0\x2a\xc6\xb5\x8c\x44\xd3\x50\x3a\x06\x64\x03\xcc\x33\
\x6a\x4b\x87\x42\x10\x04\xf3\x05\xb0\xb5\x40\xa0\xa5\x04\xfe\x14\
\x90\xc5\x44\x45\xe1\x3f\x71\xe2\xb0\x11\xe8\xea\xea\x4a\xde\x8a\
\x15\x12\x89\x7e\xa6\xa1\x73\xc8\x64\x19\x6c\x02\x1e\x91\xc9\x64\
\x64\xa4\xa5\x11\xaa\x56\x0f\x4b\x9b\x26\x05\x05\x49\x5a\x59\x09\
\xbc\xde\x27\xd1\x7d\x10\xda\x00\xa8\x5e\x5e\xb5\xca\x6e\x0e\x02\
\x6b\xd0\xd6\xde\xce\x89\xd2\x52\x2e\xd5\xd6\x72\xe7\xce\x1d\xc0\
\xb8\x40\x14\x12\x1c\xcc\x2c\x8d\x66\xd8\x9d\xb4\x97\xeb\xea\xf8\
\xfb\xa6\x4d\x00\x4d\x40\x10\x60\x18\xc8\x9d\x95\x04\xa8\x7c\x7d\
\x7c\x46\x84\x3c\x00\x37\xa5\x92\xa4\xc4\x44\x92\x12\x13\x19\x0d\
\x98\x12\x12\x82\x97\xa7\x27\x37\x6f\xdd\xf2\x07\xe6\xd0\x6b\x79\
\xb4\xf7\x10\x5e\x08\x10\x36\x65\x0a\xe3\xe8\x41\xf4\xf4\xe9\xd2\
\x61\xda\x60\x32\x30\x0c\xb0\xd9\x69\x79\xbf\x21\x24\x38\x58\x52\
\x2c\x89\x83\x11\x18\x0c\xe0\xd3\x47\xfc\xc9\x83\x0c\xd3\xda\x32\
\xc0\xe4\xc1\x08\x54\x02\x38\xdb\xd9\x4d\x35\xd6\xe1\xde\xe3\x30\
\x9e\x38\x18\x81\x77\x01\xb4\x56\x46\x00\xdc\xef\xb8\x6d\x9a\x0d\
\x88\xa2\xe8\x33\x18\x81\xa9\x00\xff\x3b\x75\x6a\x9c\x35\x33\xd4\
\xf7\x78\x8a\x2c\x33\xe5\x2e\x5c\xbe\x3c\xce\x9a\x19\x5a\x5a\x5a\
\x2c\x26\xb0\x56\xf2\x8c\x74\xd8\xd1\x6d\x3e\xd6\x71\xa9\xb6\xd6\
\x62\x02\xbb\xbb\xde\xf8\x30\xee\xc1\x40\x0e\xdc\x7e\xfd\x81\xfb\
\x0f\x1d\xba\x27\x6c\xf6\x41\xc5\xe5\xba\x3a\xf3\x62\xa5\xc5\x04\
\xb6\x6b\xb5\x7c\x5f\x52\xf2\xc0\x13\x78\xe8\xc8\x3d\xab\x9c\x9d\
\x16\x11\xb8\x68\xc1\x02\x00\x0e\x1e\x3e\x4c\x43\x63\xe3\x03\x4b\
\x5e\x4d\x5d\x1d\x55\x83\x2c\x60\xf5\x49\xe0\x94\xc9\x93\x79\x34\
\x2e\x0e\x80\xcd\xdb\xb6\xa1\xd5\x6a\x1f\x38\xf2\xf4\x06\x03\xc5\
\x5f\x7f\x0d\x20\xb9\xb4\xba\x0d\x0d\x8b\x86\x70\x6a\x72\x32\x81\
\x01\x01\xb4\xde\xb8\xc1\xe7\x05\x05\x0e\x59\xc4\x19\xcd\xf8\xd7\
\x81\x03\x5c\x6b\x6a\xc2\xd7\xc7\x87\x94\x85\x0b\xa5\xbf\xe5\x16\
\x13\xe8\x22\x93\x91\x97\x95\x85\x9b\x52\xc9\xe5\xba\x3a\x0a\x8a\
\x8a\xe8\x72\x50\xd8\xd9\x68\xc3\xd9\xea\x6a\x0e\x1f\x3b\x66\x5c\
\xa5\x5b\xb6\x0c\x99\x4c\x66\xbd\x16\x06\xf0\xf1\xf6\xe6\x85\xbc\
\x3c\x14\x0a\x05\x15\x55\x55\x14\x6c\xdf\x8e\xe1\x3e\x27\xb1\xe1\
\xea\x55\xbe\x2a\x2a\xea\xd6\x05\xea\x90\x10\xeb\x65\xa0\x39\x02\
\x03\x02\xc8\xcf\xc9\xc1\xc5\xc5\x85\xf2\xca\x4a\x0a\x8b\x8b\xef\
\xdb\x9e\xd8\x78\xed\x1a\x1f\xac\x5f\x8f\x5e\xaf\x47\x13\x1d\xdd\
\xed\xd4\x35\x0b\x26\x10\xac\x26\x10\x40\x1d\x12\xd2\xdd\x13\xcb\
\x2a\x2a\xd8\xba\x73\xe7\x7d\x47\xe2\xe9\x33\x67\xf8\x68\xc3\x06\
\xa3\xcb\xc5\xd7\x97\x8c\xa5\x4b\xbb\x89\x33\xcb\x6f\xf1\x1c\x12\
\x81\x60\x5c\x76\xcc\xcf\xc9\x41\x21\x97\x73\xaa\xbc\x9c\xc2\x1d\
\x3b\xee\x8b\xe1\xac\xd7\xeb\xd9\xf5\xcd\x37\xdd\xe2\x29\x26\x32\
\x92\x75\x2f\xbe\x68\x71\xe4\x99\x55\xb1\x1a\xea\x90\x10\x9e\xcb\
\xcd\x45\x21\x97\x73\xfa\xcc\x19\x36\x6f\xdd\x4a\xe7\x8f\xc3\x71\
\xc7\x8e\x93\xe0\xfa\x75\x3e\xd9\xb4\x89\xff\x1c\x3f\x8e\xb3\xb3\
\x33\x69\x29\x29\xe4\x64\x64\xe0\x62\x45\x14\x86\xd5\xc1\x2e\x53\
\x42\x42\x78\x3e\x2f\x0f\xa5\x52\xc9\xd9\xea\x6a\x36\x7e\xf9\x25\
\xed\xed\xed\x63\x8e\xbc\x53\xe5\xe5\x7c\xb8\x61\x03\x57\x1a\x1b\
\xf1\xf6\xf2\xe2\xa5\xfc\x7c\x12\x13\x12\xac\xae\x67\x48\xd1\x42\
\x21\xc1\xc1\xac\x79\xf6\x59\x3c\x3d\x3c\xa8\xa9\xaf\xe7\x93\x4d\
\x9b\x68\xb9\x7e\x7d\x4c\x10\xd7\xa1\xd3\x51\xb8\x63\x07\xff\x2c\
\x2e\xa6\x43\xa7\x33\x0e\xd9\x35\x6b\x18\x28\x9b\x4a\xd6\xd3\x23\
\x95\x76\x21\x10\x40\xe5\xef\xdf\x9d\x89\xd4\xd4\xd2\xc2\x47\x1b\
\x37\x0e\x6a\xf6\x8c\x34\xea\x1b\x1a\xf8\x60\xfd\x7a\x4a\xcb\xca\
\x70\x91\xc9\x58\xbe\x64\x09\x39\x19\x19\xb8\x2a\x14\x03\xde\x67\
\x26\x0f\xe5\x76\x23\x10\xc0\xcb\xd3\x93\x97\xf3\xf3\x79\x78\xda\
\x34\xb4\x5a\x2d\x9f\x15\x14\xf0\xcd\xfe\xfd\xa3\x4e\xb9\x74\x89\
\x22\x87\x8e\x1c\xe1\xe3\x4f\x3f\xe5\x7a\x6b\x2b\x01\x2a\x15\x6b\
\x57\xaf\x26\x7e\xe6\x4c\x8b\xee\xbf\xdb\xd6\xd6\xef\xb9\xde\xaa\
\xe6\x45\x40\x1d\xa7\xd1\xe0\x6d\xe1\xca\x9c\x4c\x26\x23\x26\x2a\
\x0a\x27\x41\xe0\x52\x6d\x6d\xb7\x01\x1e\x12\x14\x84\xc7\x84\x09\
\x23\x4e\xde\xad\xdb\xb7\xd9\x5c\x58\xc8\xf1\xd2\x52\x44\x51\x24\
\x31\x21\x81\xdc\x8c\x0c\xab\xda\x56\x50\x54\x24\x89\xa8\xbd\xc0\
\x67\x76\x25\x50\x9a\x68\x86\xaa\xd5\x3c\xa4\x56\x73\xb1\xa6\x86\
\xe6\x96\x16\xfe\x7b\xf2\x24\xad\x37\x6f\x12\xa8\x52\xa1\xec\x09\
\x5d\x1b\x56\x94\x57\x56\xf2\x59\x41\x01\x4d\xcd\xcd\xb8\xbb\xb9\
\x91\x9b\x99\x49\x62\x42\x82\x55\x81\xa2\x07\x8f\x1c\x91\x32\x07\
\xee\x00\xcb\x80\x1b\xf7\xbc\x7b\x6f\xf7\x17\x90\x34\x4b\xa3\x21\
\x73\xe9\xd2\xa1\x09\xe9\x8e\x0e\xbe\x3d\x78\x90\x63\xc7\x8f\xd3\
\x25\x8a\xdd\x4a\x67\xa2\xaf\xaf\xf9\xfa\xaa\xc3\x71\xbc\xb4\x94\
\xeb\xad\xad\x00\x4c\x7b\xe8\x21\xb2\xd2\xd3\xad\xce\x67\x29\xaf\
\xac\x64\x4b\x51\x11\xa2\x28\x8a\xc0\xd3\x40\xe1\x8f\x3a\x4f\xaf\
\xf2\xab\x18\xa3\xa2\x58\x98\x94\xc4\x13\xf3\xe6\x0d\xf9\x05\x9a\
\x5b\x5a\x38\x50\x52\x42\x79\x65\xa5\x14\x3c\x3e\xec\x70\x12\x04\
\x52\x93\x93\x49\x4c\x48\xb0\x3a\xb6\xbb\xea\xdc\x39\xbe\x28\x2c\
\x94\x2c\xae\x5f\xd3\x4f\x4e\x5d\x5f\xb5\xbe\x00\x7c\x02\x38\xc7\
\xc7\xc6\xda\x9c\xd2\xd0\xd6\xde\x4e\xf5\xf9\xf3\x34\x5c\xbd\xea\
\xd0\x18\xeb\xbe\x30\x23\x2a\x8a\xa0\x80\x00\xab\xef\xab\xa8\xaa\
\x62\xcb\xb6\x6d\x92\x32\x7c\x9f\x7e\x42\xdb\xfa\x23\x10\x60\x39\
\xf0\x25\xa0\x8c\x8c\x88\x60\xc5\x53\x4f\x59\x35\x3b\x1f\xcb\x28\
\x2d\x2b\x63\xdb\xce\x9d\x92\xf8\xf9\x0b\xf0\x06\x03\xec\xd9\xd0\
\x9f\xc1\x77\x16\x38\x08\x64\x34\xb7\xb4\x28\x2f\x5c\xba\xc4\xc3\
\xe1\xe1\x38\x32\x2e\x79\x34\xe0\xd0\xd1\xa3\xec\xdc\xbb\x57\x62\
\xeb\x0f\xc0\x2f\x07\x55\xa0\x83\x9c\x8f\x04\x76\x03\xa1\x9e\x1e\
\x1e\xe4\xe7\xe6\x12\x30\x84\x14\xfe\x51\xef\x50\x30\x18\xd8\xb9\
\x77\x2f\x27\x4a\x4b\xc1\x98\x62\xf6\x26\xf0\x67\x4b\xee\x1d\xcc\
\xe5\xd0\x8c\x71\xdf\x97\xf9\x1d\x3a\xdd\xa4\xd2\xb2\x32\x54\x7e\
\x7e\xf8\x0d\x63\xe8\xaf\xa3\x71\xb7\xad\x8d\x2f\x0a\x0a\xa8\xa8\
\xaa\x02\xe3\xfe\x5b\x79\xc0\x06\x4b\xef\xb7\xc4\x67\x73\xc7\x34\
\x79\x0c\x33\x18\x0c\x33\x4e\x57\x54\x20\x08\x02\xea\xc9\x93\x1d\
\x96\xb5\x34\x5c\xb8\xd2\xd8\xc8\x86\xcf\x3f\xe7\x6a\x53\x13\xc0\
\x15\x8c\xd9\xa8\xdf\x59\x53\x87\xa5\x71\x6c\x7a\x60\x2b\xc6\x24\
\x98\xc7\x2f\xd6\xd4\x38\xd5\xd6\xd7\x13\x1e\x16\xe6\xf0\x04\x1c\
\x47\xe1\x44\x69\x29\x9b\xb7\x6e\x95\x72\x93\x8f\x62\x4c\x77\xad\
\xb2\xb6\x1e\x6b\x03\x01\x4b\x30\x46\xcd\x2f\x6e\xbd\x71\xc3\xbd\
\xb4\xac\x8c\xe0\xc0\x40\x7c\xbc\xbd\xc7\x0c\x71\xba\xce\x4e\xb6\
\xef\xd9\xc3\x81\x92\x12\x49\xd3\x7e\x08\x3c\xd3\xdb\xc2\xb0\xd8\
\x0a\x1b\x62\x3b\x26\x99\xa6\x39\xf3\x00\x1e\x9b\x3d\x9b\x27\xe6\
\xcf\xc7\x45\x26\x1b\xd5\xe4\x5d\x6d\x6a\xa2\xa0\xa8\x48\xca\xcb\
\x6b\xc3\x98\x15\xbf\xd1\x96\x3a\x87\x1a\x8a\x7a\x1b\x63\xee\x06\
\xc0\x63\xb5\xf5\xf5\x4e\x67\x2a\x2b\x09\x50\xa9\xac\xb2\xa1\x87\
\x13\xc7\x4e\x9c\x60\xcb\xb6\x6d\x52\xb0\x64\xa5\x49\xde\xed\xb3\
\xb5\x5e\x7b\x68\x81\x47\x80\xf5\x40\x0c\x80\x26\x3a\x9a\x94\x85\
\x0b\x47\xcd\xa6\x3b\x77\xdb\xda\xd8\xbe\x7b\xb7\xf9\x86\x15\xeb\
\x81\x9f\x71\xef\x8e\x97\x23\x4a\x20\x80\x02\xe3\xce\x17\xbf\x02\
\xe4\x32\x99\x8c\x38\x8d\x86\xf9\x73\xe7\xe2\xe9\xe1\x31\x62\xe4\
\x9d\xad\xae\x66\xfb\x9e\x3d\xdc\xb9\x7b\x17\x93\x8c\x7b\x0d\x63\
\x32\xb5\xdd\x60\xef\x79\xc8\x34\x8c\xdb\x88\x3c\x23\xd5\xed\xea\
\xea\x4a\x70\x60\xe0\xb0\x93\x77\xe1\xd2\x25\xf3\xe2\x7e\xe0\x79\
\x4c\x01\xa4\x63\x01\x33\x31\xa6\xe7\xeb\x4c\x76\xe4\x48\xfd\x3a\
\x80\x9f\xe3\xc0\x7d\x12\x1d\x3d\x13\xf6\x05\x66\x31\x72\xbb\x05\
\x5f\xc0\x81\x1b\xd0\x8e\x63\x1c\xe3\x18\xc7\x83\x8e\xff\x03\xac\
\x37\x9f\x01\x8d\x77\x23\x7b\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x00\xb2\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x04\x0e\xa0\x53\x3f\x37\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x00\x0d\
\x49\x44\x41\x54\x08\xd7\x63\x60\x60\x60\x60\x00\x00\x00\x05\x00\
\x01\x5e\xf3\x2a\x3a\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
\x82\
\x00\x00\x05\xa5\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x86\x00\xaf\x00\xd2\x7d\x1c\x57\xe8\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x25\x2c\xf9\xac\x6b\x30\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x05\x00\
\x49\x44\x41\x54\x78\xda\xed\x9c\x6b\x50\x54\x65\x1c\x87\x9f\xb3\
\xbb\xdc\xe4\x26\x97\x55\x58\x14\x36\x20\x16\x48\x56\x65\x1d\x4c\
\x85\x14\x1c\x47\xd4\x2e\x86\x62\x32\x65\x25\x21\xcd\xa4\xf9\xa1\
\xc8\x99\xf2\x83\xa8\x35\x95\x4e\x33\x5a\x7d\xc8\x69\xc0\x69\xa6\
\x9c\x3e\x24\x5a\xd3\x4c\x65\xa2\x91\x95\x78\x0d\x47\x41\x4d\x0d\
\x75\x0c\x15\x50\x34\x4c\x94\xcb\x9e\x3e\xec\xb1\xd1\xc9\xcb\x0a\
\xbb\xeb\x2e\xfc\x9f\x99\xf3\x65\xf7\x9c\x77\xcf\x79\xde\xff\x9e\
\xf7\x7d\x7f\x67\x76\x41\x10\x04\x1f\x46\xef\x03\xe7\xb7\x0e\xf8\
\x07\x68\x94\xee\xba\x3f\x02\x81\xaf\x01\x55\xdb\x26\x8b\x12\xe7\
\x09\x05\xb6\xdd\x24\x4f\x05\xae\x03\x4f\x89\x9a\x7b\x13\x0d\xec\
\x01\xd4\xd0\x08\xa3\xba\x78\xcd\x46\x75\xdc\xf4\xa2\x1b\x12\xbb\
\x81\x79\x72\x0f\xbc\x33\xc3\x80\xed\x80\x35\x32\x66\x38\xa5\xef\
\x54\x62\x8c\x33\x63\xb1\xe5\xa0\xaa\x76\x1a\xeb\xf7\xe9\x80\x99\
\xc0\x45\x60\xb7\x08\xbc\x95\x14\x4d\x5e\x72\x8c\x39\x85\x92\x15\
\x15\x84\x47\xc7\xfc\xf7\x66\x62\x46\x16\x01\x41\xc1\x1c\xab\xfb\
\x4d\x01\xa6\x69\x15\x59\x23\x02\x1d\x64\x02\x5b\x81\xb8\x84\xd4\
\x51\x14\x97\xaf\x23\x38\x2c\xe2\x7f\x3b\xc5\xa7\x8e\x64\xb0\x31\
\x96\x23\x7b\x6b\x40\x55\x73\x81\x70\x60\xcb\x40\x17\xf8\x18\xf0\
\x03\x10\x95\x92\x99\xcd\xf3\x4b\x3f\x22\x30\x28\xe4\x8e\x3b\x9b\
\x12\x53\x19\x1a\x9f\x4c\xc3\xae\x6a\x54\xbb\x7d\x1c\x90\x00\x7c\
\xab\x55\xe4\x80\x13\xf8\xb8\x36\x55\x09\xb1\x66\xe7\x33\xf7\xf5\
\xd5\xf8\xf9\x07\xdc\xf3\xa0\x21\xc3\x13\x89\xb7\x8c\xe4\xd0\xce\
\xad\xd8\x7b\xba\x47\x01\x23\x80\xcd\x40\xcf\x40\x12\xf8\x2c\xf0\
\x25\x10\x90\x35\xb5\x90\x82\x85\xcb\xd1\x1b\x0c\x4e\x1f\x1c\x19\
\x33\x8c\xa4\x8c\x2c\x0e\xed\xac\xa6\xbb\xeb\x7a\x1a\x30\x0e\xa8\
\x02\xba\x06\x82\xc0\x45\xc0\xa7\x80\x7e\xd2\xac\x12\x66\x14\x2f\
\x41\xd1\xe9\xee\xbb\x91\xf0\xe8\x18\x2c\xb6\x6c\xea\x6b\xab\xe9\
\xbc\xd6\x91\x08\xe4\x6a\x12\xaf\xf5\x67\x81\xcb\x80\x55\x80\x32\
\xfd\xc5\x32\x72\xe7\x94\xf6\xa9\xb1\x90\xc1\x51\xa4\x65\xe5\x72\
\x78\x4f\x0d\xd7\xae\xb6\x0f\xd7\x46\xe8\xcd\xc0\x15\x4f\x5c\x8c\
\xe2\x41\x71\x0a\xb0\x06\x58\xac\xe8\x74\x14\xbc\x52\x8e\x6d\xf2\
\x4c\x97\x35\x7e\xb9\xf5\x1c\x95\xcb\x5f\xa6\xe5\x4c\x23\xc0\x71\
\x60\x0a\x70\xb2\xbf\x54\xa0\x01\xf8\x0c\x58\xa0\x37\xf8\x51\xf4\
\xc6\x07\x8c\xcc\x99\xe6\xda\x85\xf3\xa0\x10\xac\xd9\xf9\xfc\x79\
\x70\x37\xed\x6d\x2d\x91\xc0\x6c\xe0\x7b\xa0\xd5\xd7\x05\x06\x01\
\x5f\x01\x85\xfe\x81\x83\x78\x61\xe9\xc7\x58\x6c\x39\x6e\xf9\x20\
\xff\x80\x20\xac\xd9\xf9\x9c\x3e\x5a\xc7\xa5\x96\xb3\x61\xc0\x33\
\xda\xe4\xbc\xc9\x57\x05\x86\x69\x73\xb4\xa9\x41\xa1\xe1\x14\x2f\
\x5b\x87\x39\x3d\xd3\xbd\xa5\xee\xe7\x8f\x75\x42\x3e\x67\x4f\x1e\
\xe5\x42\xd3\xa9\x41\xc0\x5c\xa0\xd6\x5d\x5f\x67\x77\x0a\x34\x02\
\x3f\x02\xe3\xc3\x22\x87\x50\xb2\xb2\x02\x53\x62\xaa\x67\x46\x46\
\x83\x81\x8c\xf1\x53\xb8\x78\xee\x0c\xe7\x4f\x1f\x0b\xd0\x2a\xf1\
\x00\xf0\x87\xaf\x08\x8c\xd7\xe2\x28\x6b\x54\x6c\x3c\x0b\xde\xae\
\x20\xda\x94\xe0\xd1\xa1\x5e\xa7\xd3\x93\x3e\x36\x8f\x2b\x97\x2f\
\xf0\xd7\x89\x06\x3f\xa0\x10\x38\x01\x1c\xf4\x76\x81\xa9\x9a\xbc\
\xa4\x58\xb3\x85\x97\x56\x56\x10\x1e\x35\xf4\x81\x4c\x36\x15\x45\
\x21\x75\xcc\x44\xba\xbb\x3b\x39\x75\xf8\x77\x3d\xf0\x34\xd0\x0c\
\xec\xf5\x56\x81\x36\xa0\x1a\x30\x99\xd3\x32\x99\x5f\xfe\xc9\x6d\
\x43\x01\x4f\x93\x6c\x7d\x14\xbf\x80\x40\x8e\x1f\xa8\x55\xb4\xe5\
\x63\x27\xf0\x8b\xb7\x09\x9c\xa8\x85\x02\x11\x16\x5b\x0e\xf3\xde\
\xfa\xf0\xae\xa1\x80\xa7\x49\x48\x1b\x4d\x68\xa4\x91\xa3\xfb\x77\
\x80\xaa\x4e\x06\x82\xb5\x04\xc8\x2b\x04\x3e\xa9\x85\x02\xc1\x19\
\x13\xa6\x52\x54\xe6\x5c\x28\xe0\x69\xe2\x92\xd2\x31\xc6\x99\x39\
\xbc\x67\x3b\xaa\xdd\x3e\x01\x88\x05\xbe\xeb\x4b\x92\xe3\x0a\x81\
\xf3\x80\x0d\x80\xff\xd8\xfc\x39\x14\x2c\x5a\x81\x5e\x6f\xc0\x5b\
\x19\x1a\x9f\x4c\x5c\x52\x3a\x0d\xb5\xdb\xb0\xf7\x74\xdb\x00\x0b\
\xf0\x4d\x6f\x93\x9c\xbe\x0a\x7c\x15\xc7\x63\x47\x7d\x6e\x61\x29\
\xd3\xe7\x97\xa1\x28\x0a\xde\x4e\xb4\x29\x01\xf3\x23\x99\xd4\xd7\
\x56\xd3\xd3\xd5\x39\x02\x18\x03\x6c\xea\x4d\x92\xd3\x17\x81\xe5\
\xc0\xfb\x80\x32\xa3\x78\x09\x93\x66\x97\xe0\x4b\x44\x18\x4d\xa4\
\x8c\x1e\x4f\xfd\xae\x6d\x74\x5d\xef\x78\x18\x47\xb0\x5b\x85\xe3\
\xe9\x9f\x5b\xc3\x04\x1d\xb0\x16\x58\xa4\xe8\x74\xcc\x5a\xb8\x9c\
\xcc\x3c\xdf\x7d\xda\xd8\x7c\xa6\x91\xf5\xe5\xa5\x5c\xbe\x70\x1e\
\x60\xbf\x96\xe6\x34\xbb\x4b\xa0\x01\x58\x0f\x3c\xa7\x37\xf8\x51\
\x54\xb6\x9a\xf4\xb1\x79\x5e\x23\xa3\xbd\xad\x95\xbf\x2f\x36\xdf\
\xf7\x71\x6d\xcd\x4d\x6c\x58\xf5\xda\x2d\x83\x36\x70\xda\xd5\x02\
\xfd\xb5\x50\xe0\x89\x1b\x2f\x98\x92\xd2\x7b\x75\xa1\x05\x0b\xcb\
\x31\x3d\xe4\xfa\x65\xdd\x4f\x1b\x2b\xd8\xf2\xf9\x5a\x57\x34\x75\
\x09\x47\x38\x5b\xe7\x4c\x45\x39\x2b\xaf\x0a\x98\x71\xf3\x8b\x4d\
\x27\x1a\x7a\x75\x76\x9d\x1d\x57\x3d\x51\x90\xfb\x7a\x71\xcc\x60\
\x20\x49\x5b\xf2\xad\x01\x4a\xef\xb5\x7e\x76\x56\x60\x30\x8e\x24\
\x79\x59\x1f\x2f\x6a\x07\x8e\x78\xcb\xdd\xbc\x07\xbc\xe9\x89\x5e\
\x72\x56\x60\x5b\x2f\x7b\xf4\x76\x55\x91\x4d\x3f\x42\x87\x20\x02\
\x45\xa0\x08\x14\x81\x82\x08\x14\x81\x22\x50\x04\x0a\x22\x50\x04\
\x8a\x40\x11\x28\x88\x40\x11\x28\x02\x45\xa0\x20\x02\x45\xa0\x08\
\x14\x81\x82\x08\x14\x81\x22\x50\x04\x0a\x22\x50\x04\x8a\x40\x11\
\x28\x88\x40\x11\x28\x02\x45\xa0\x20\x02\x45\xa0\x08\xec\x3f\x3c\
\x90\x5f\x05\xd6\x6c\xaa\xe4\xd4\x91\x3a\x97\xb7\xfb\x73\x55\x65\
\xbf\xef\xb0\x1d\xdc\xfa\xaf\x94\xee\xda\xde\xed\xaf\x15\xf8\x05\
\xf0\xab\x27\x8a\x5c\x6e\x2e\x82\x20\x08\x82\x20\x08\x77\xe5\x5f\
\x8f\x64\x4e\x41\x71\xfe\x0d\xb2\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82\
\x00\x00\x05\xb6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x86\x00\xaf\x00\xd2\x7d\x1c\x57\xe8\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x25\x0b\x5c\xa6\xde\x5b\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x05\x11\
\x49\x44\x41\x54\x78\xda\xed\x9c\x79\x6c\x14\x75\x14\xc7\x3f\xbb\
\xdb\x52\x10\x1a\x5a\x40\x2e\xa1\xd4\x36\xd0\xba\x84\x1a\xab\x50\
\x88\x44\x61\x89\x06\x34\x80\x15\xa3\x21\xd1\x84\x60\xa5\x24\x55\
\x42\x54\x12\x43\x94\x42\x0c\x35\x48\x8c\x36\xf1\x0f\x68\xda\x94\
\x20\x10\x14\x2a\x47\x4c\x68\x6b\xe5\x90\xb5\x90\x6a\x8b\x5d\x7b\
\xa4\xf7\x01\x3d\xa8\x5b\x4a\xef\x6b\xbb\xe3\x1f\x9d\x4d\xaa\x09\
\xa1\xdd\xce\xce\x76\xf1\x7d\x93\xfd\x67\x93\x79\x6f\xde\x67\xde\
\xbe\xdf\xbc\xf7\xdb\x19\x10\x89\x44\x22\x91\x48\x24\xf2\x49\x19\
\x74\xf6\xb7\x13\x08\xd5\xc1\xcf\x55\x20\xf3\x51\xbc\x60\xd7\x01\
\x45\x87\xcf\x17\x7a\x05\xe4\xe7\x0d\x8a\x11\xcf\xbd\x40\xe8\x53\
\xd1\x9a\xdb\xbd\x96\x91\x46\x5f\x4f\xa7\xae\xb1\x78\x05\xe0\x8b\
\xb1\xdb\x09\x35\x6b\x0f\x50\x51\x14\xb2\x4f\x24\xeb\x1a\x8b\x51\
\x96\x01\x01\x28\x00\x05\xa0\x00\x14\x09\x40\x01\x28\x00\x05\xa0\
\x48\x00\x0a\x40\x01\x28\x00\x45\x02\x50\x00\x0a\x40\x01\x28\x12\
\x80\x02\x50\x00\x0a\x40\x91\x00\x14\x80\x02\x50\x00\x8a\x04\xa0\
\x00\x14\x80\x02\x50\x24\x00\x05\xa0\x00\x14\x80\x22\x01\x28\x00\
\x05\xe0\x23\xa4\xd1\xfe\xc9\x3c\x18\x08\xd3\xc0\xdf\xb3\xff\x57\
\x80\xdd\xc0\x01\xe0\x55\x1f\x89\xeb\x13\xe0\x25\x37\x8e\x0b\x02\
\xc2\x81\x7c\xa0\x0b\xd8\x01\x94\x6b\x01\x70\x00\x78\x1d\x38\x0b\
\x6c\x74\x7d\x39\x3f\xdc\xec\x56\x74\x93\xa6\x3c\xa6\x07\xc4\xf1\
\x64\x7b\x38\xb0\xf6\x61\xf0\x60\xec\x8f\x7a\xf9\x01\xe9\xc0\xdb\
\x26\x3f\x7f\xb6\x7e\x7c\x18\x73\x8c\x65\xc2\xa4\x5d\x67\x9b\x9d\
\x8e\x7b\x2d\x63\x3e\xae\xad\xa5\x91\x53\x5f\x7e\x38\xf2\xab\x45\
\x40\xfd\x68\x8e\x75\xe7\x59\x39\x23\x90\x0c\xbc\x6f\x30\x1a\xd9\
\x92\x70\x80\x68\xcb\x66\x9f\xad\x61\x2d\x77\x6a\x48\xdf\xbf\x83\
\xf6\xd6\xbb\x00\x05\xc0\x06\x60\xd4\x57\xc1\xe4\x86\x4f\x05\xb8\
\x04\x18\x50\x94\x35\x25\x79\x57\x98\x3c\x35\x90\x90\x88\x28\x9f\
\x83\xd7\x58\x5d\x4a\x5a\xe2\x7b\x74\xb6\xd9\x61\xf8\x39\xbe\xf5\
\xc0\xbd\xb1\xd8\x30\x8d\xc3\xff\x55\xd5\xd9\xfa\x8a\x5b\xbf\x19\
\x9c\xce\x21\xc2\x97\xad\xf0\x19\x78\x35\x25\xf9\xa4\x1f\xd8\x49\
\x6f\x57\x3b\x6a\x42\x6c\x52\x17\x0e\xf4\x02\x08\x90\x07\x54\x03\
\x1b\x6b\x4b\xf2\x8d\x5d\xed\xad\x2c\x89\x5e\x8d\xc1\x60\x98\xd0\
\xf0\xca\xf2\xaf\xf3\x5d\xd2\x2e\x06\xfa\x7a\x00\xbe\x07\xde\x02\
\xfa\xdc\xb1\x65\xd2\xe0\x7c\x6c\x40\x21\x10\xdb\x50\x59\xec\xf7\
\x77\x43\x0d\xe6\x15\x6b\x31\x1a\x4d\x13\x12\x9e\xcd\x9a\xc9\xe9\
\xaf\xf6\xe0\x18\x1c\x00\x48\x01\xde\x05\x1c\xee\xda\xd3\x2a\xca\
\x32\xc0\x0a\x6c\x69\xb9\x5d\x15\xd0\x58\x5d\x8a\x39\xc6\x82\xc9\
\xcf\x7f\x42\xc1\xcb\xcb\x3e\x4b\xc6\xb7\xfb\x70\x0e\x0d\x01\x1c\
\x06\x76\x03\xce\xf1\xd8\xd4\x32\x4d\xea\x80\x6c\x20\xb6\xb5\xa9\
\x7e\x6a\x6d\x71\x01\xe6\x95\x16\xfc\x27\x05\x4c\x08\x78\xbf\x9e\
\x4b\xe7\xa7\xb4\x43\xa0\x28\x00\x7b\x81\x44\x2d\xec\x7a\xa2\x58\
\x45\x02\x59\x40\xc8\xbc\xd0\x08\xb6\x25\x1e\x21\x30\x68\xa6\x57\
\xe1\x65\x9d\x48\xe6\x5a\x46\x1a\x6a\xb6\x25\x00\x47\xb4\xb2\xed\
\xa9\x6a\x1f\xa2\x42\x8c\x9c\x39\x2f\x84\xed\xfb\x8f\x12\x3c\xfb\
\x09\xdd\xc1\x39\x9d\x4e\x2e\xa6\x1c\x24\x2f\xeb\x0c\xc0\x20\xb0\
\x0d\x38\xa5\xa5\x0f\x4f\x55\xfa\x76\xe0\x07\xc0\xd2\xdb\xd5\x3e\
\xbf\x28\xf7\x67\x16\x47\x3f\xcf\xb4\xe9\x33\x74\x83\x37\xe4\x18\
\xe4\x6c\xf2\xa7\x14\x5c\xbe\x00\xd0\x0b\xbc\x01\x64\x68\xed\xc7\
\x93\x4b\x65\x0f\x70\x1a\x58\xd5\xdf\xdb\x1d\x6a\xb3\x66\x12\xb6\
\x74\x39\xd3\x67\xce\xf1\x38\xbc\xc1\xfe\x3e\x4e\x1e\xfe\x88\xe2\
\x9b\x39\x00\x1d\x6a\xff\x9e\xed\x09\x5f\x9e\xbe\xd7\xe8\x57\x33\
\x31\xca\x31\xd0\x1f\x61\xb3\x66\xb2\x70\xc9\x32\x66\xcc\x59\xe0\
\x31\x87\x7d\x3d\x5d\x1c\x3f\x98\x40\x65\xe1\x4d\x00\x3b\xf0\x32\
\x90\xeb\x29\x7f\x7a\xdc\xac\x39\x80\x33\x40\xd8\x90\x63\x30\xca\
\x66\xcd\x64\xce\xa2\xc5\xcc\x5e\xf0\xa4\xe6\x8e\xba\x3b\xda\x48\
\xdf\x1f\x4f\x7d\x99\x0d\xe0\x0e\x60\x51\xef\x53\xf1\x65\x80\xae\
\xd5\xef\x3c\x10\xac\x38\x9d\x31\x45\xb9\xd9\x04\xcd\x9a\xcb\xfc\
\xb0\x48\xed\x8a\xae\xbd\x99\xd4\x7d\x71\x34\xd7\x55\x00\x54\xaa\
\xe3\xa8\x4a\x4f\x07\xa6\x77\xbb\x30\xfc\x36\x21\x45\x59\x53\x9a\
\x77\x85\x80\x29\x53\x09\x89\x7c\x7a\xdc\x46\xed\x8d\x75\xa4\x7e\
\x16\xc7\xbd\xe6\xdb\xae\xce\xc8\xa2\x66\x20\x8f\x1a\x40\x80\x6b\
\x40\x2b\xb0\xa1\xe2\xcf\x5c\xc3\x90\x63\x90\xf0\xa8\x18\xb7\x8d\
\x35\xd7\x95\x93\xba\x2f\xce\x35\x07\xbc\xa1\xd6\x3c\xbb\x5e\xc1\
\x78\xab\x61\xcd\x53\x7f\x5e\x9b\x6a\x4b\x0b\x8c\x9d\xf7\xed\x2c\
\x79\x66\x35\x06\xe3\xd8\xf6\xb8\xea\xcb\x0a\x49\x4b\x8c\xa7\xa7\
\xf3\x3e\x40\x0e\xc3\x5b\x0e\x1d\x7a\x06\xe2\xcd\x8e\xff\x2f\xe0\
\x16\x10\xdb\x50\x55\xe2\x6f\x6f\xac\x23\x72\xf9\x1a\x8c\xa6\xd1\
\x9d\x52\x65\xe1\x4d\x8e\x7d\x9e\xc0\x40\x6f\x37\xc0\x8f\x0c\x6f\
\x39\xf4\xe9\x1d\x84\xb7\x47\x26\xe5\x0c\x0f\x32\xb7\xdc\xad\xaf\
\x0c\x68\xa8\x2a\xc1\xbc\xf2\xe1\x43\x88\xa2\x1b\x39\x9c\x3c\xb4\
\xdb\x35\x51\x39\x06\xbc\x33\x9e\x89\x8a\x2f\x03\x1c\x39\x84\x78\
\xad\xb5\xa9\x7e\x5a\x4d\xd1\x1f\x2c\x5d\xb5\xee\x81\x43\x88\xfc\
\x5f\xce\x73\x26\x79\xaf\x6b\xa2\xf2\xb5\xda\xdb\x3a\xbd\x75\xf2\
\x13\x65\x68\xd7\x04\x5c\x04\x36\xb5\xdb\x9b\x83\xca\x0b\xac\x98\
\x63\x2c\x04\xfc\x67\xf7\xce\x7a\xe1\x38\x17\x53\x0e\xba\x26\x2a\
\x89\xea\x54\x45\x34\x42\x0b\x80\x52\x40\x99\x31\x77\xa1\xb2\xe7\
\xe8\x25\x25\xe9\x9c\x4d\x49\x3a\x67\x53\x2c\x6f\xc6\xbb\xde\x0d\
\xe8\x04\x3e\x10\x54\x0f\xd6\x2c\xe0\x77\x40\x09\x0c\x7e\x5c\xd9\
\xf5\x4d\x86\xb2\xea\x95\xad\x2e\x78\x0e\xb5\xde\x89\x1e\xa2\x40\
\xe0\x32\xff\x7e\x2b\x65\x3f\xb0\x59\xd0\x8c\x5e\x93\x81\x0b\x23\
\x00\xae\x13\x24\xee\x2d\x72\x29\x6a\x6b\x26\x12\x89\x44\x5a\xeb\
\x1f\x35\x4e\xac\xc1\x8a\xf0\xc4\x68\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x06\x7d\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x06\x20\x02\x5b\x89\x46\xd4\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x05\xd8\
\x49\x44\x41\x54\x78\xda\xed\xdc\x7f\x8c\x1e\x45\x1d\xc7\xf1\xd7\
\x53\x6b\x05\xa5\x77\x90\xd2\xc8\xef\x08\x92\x18\xa5\x47\x22\xb1\
\x90\x28\x7f\x40\xab\x69\x0b\x15\x6c\x4d\x89\x45\x2d\x6a\x1a\x03\
\x28\x1a\x20\x31\xa2\x18\x02\x4a\xc0\x2a\x09\x04\x48\x80\xa8\x91\
\x1f\x46\x6c\x0d\x09\x4d\x8d\x02\x56\x90\x4a\xb0\x10\x02\xb9\x28\
\xa9\xa6\x58\x5b\xb0\x0d\x28\x2d\x0d\x3c\x45\x2a\xbd\xf1\x8f\x9d\
\x1b\x9e\xe7\xb8\xde\xee\x5e\xaf\xbd\x5b\x6e\x3e\xc9\x24\xbb\xcf\
\xcd\xce\xee\xbc\xf7\xbb\xf3\xe3\xfb\x9d\x39\xb2\xb2\xb2\x1a\xac\
\xd6\x01\xbe\xdf\xbb\x71\x62\x4c\xc7\x62\x26\x66\xe0\x3d\xd8\x83\
\x8d\xf8\x03\x9e\xc9\xaf\xe6\x2d\x1d\x8f\x2b\xf1\x28\x5e\x47\xa8\
\x90\xfa\xf1\xb9\x71\x78\xc1\x13\xca\x02\x8f\xc0\x8f\x23\x88\x77\
\xa5\x5f\x3f\x80\x13\x70\x1c\x8e\xc4\xa1\x98\x8a\xed\xd8\x82\x95\
\x78\x23\xe5\xfe\x13\x96\x61\xd3\x64\xb3\xba\x93\xb1\x2d\x59\xd4\
\xd9\x82\x5f\x0a\xfe\x25\x68\x97\xa4\x1d\x82\x15\x82\xde\x64\x8d\
\x3b\x30\x7f\x32\xc1\x3b\x04\xff\x40\x30\x4b\xf0\x74\x05\x68\x6d\
\xc1\x16\xc1\x53\x31\xff\x76\xc1\x66\xc1\xbc\x04\x71\x37\x96\x4c\
\x16\x80\xdf\x44\x70\x98\xe0\xa5\x0a\xe0\x1e\x12\x9c\x3a\xa4\x0d\
\x9c\x6a\xc0\x22\xc1\x33\x82\x8b\xbb\xfe\x36\x77\x98\xfb\xf5\x35\
\xd5\xca\xe6\x45\xab\x58\x12\xdb\xb9\xc1\xe3\xa2\xb2\xb7\x56\x80\
\xb7\x4a\xd0\x32\xd0\x01\xe8\x9f\x78\x35\x9d\x4f\xb7\xc7\xfd\x5d\
\x00\x6f\x1f\xe6\x59\x1e\x6b\x22\xc4\xbe\xd2\x9e\xf4\xc9\x12\x78\
\x9b\x05\x3d\x09\xde\x1a\x1c\xdc\x51\xfe\x51\x58\x3f\xa4\xcc\xbf\
\x63\xfa\x30\xcf\xd2\x8f\xad\x71\x58\xd4\x40\x80\x0b\x05\x8b\x3a\
\xd2\xe0\xef\x1b\x4a\x00\xfe\x20\xe5\xdd\xb4\x97\xd1\xc0\x14\xac\
\xed\x00\x78\xf2\x5e\x9e\xa5\x13\xf2\xcc\x66\x01\x3c\x69\x18\x30\
\x2f\x0b\x3e\x2c\x78\xbe\x04\xe0\xe9\xa9\xd2\x4b\x47\xb8\xcf\xf4\
\x38\xb8\xbe\x62\x84\x3c\x9b\x3b\x00\x3e\x8d\xde\x66\x03\x6c\x0b\
\xd6\x0a\xfe\x56\x02\x70\x46\xaa\xf4\x31\x25\xf7\xfa\x60\xc9\x78\
\xb5\x7f\x88\x15\xae\xc3\x7b\x0f\x14\x88\x29\xfb\xa5\xd4\x47\xf1\
\x4a\x49\x9e\xff\xa5\xa3\xd7\x4a\x72\x3e\x17\xc1\x8c\xac\xfb\xe2\
\xc0\x9c\xd3\xb1\x0a\xd3\x26\x3e\xc0\x1d\xc3\xa4\x75\xb8\xb6\xc2\
\xb5\x3d\xe9\xe8\x84\x31\xa9\xc9\xd1\xf8\x1d\x0e\x07\x67\xe1\xae\
\xae\x19\x50\xe3\x7a\xe1\x67\x4b\x3e\xe1\x25\x29\xef\xca\x11\xee\
\x73\x3e\xfe\x83\xdb\x4a\x3f\xe1\xf5\xb1\xdc\xc7\x04\xd3\x53\xef\
\x7e\xfb\x44\x9d\x4f\x7f\x24\xce\x5e\xb7\x47\xbb\xdb\xde\x91\x0a\
\x30\x6b\x4b\x00\x3e\x22\x68\x25\x88\xf7\x46\x1b\x82\xc3\xf0\x05\
\x3c\x31\xe4\xa5\xcc\xab\x04\xb0\x2d\x78\x50\x70\x50\x82\xf8\xc3\
\xa6\x8d\x11\xef\x44\xb0\xb8\xc2\x40\xfa\x47\x25\x56\x7c\xa8\x01\
\x47\x76\x0d\xb2\x7b\x2a\x01\x6c\x0b\xee\x8b\x33\x9a\xe2\xda\x6f\
\x37\x09\xe0\xc7\x89\x0f\x7e\x63\x05\x88\x0f\x08\x16\x08\x0e\x8e\
\xa0\xa6\xc5\xa9\xdd\xf5\x82\xad\x82\x5b\xba\xa0\x5e\x5a\x19\x60\
\x5b\x70\x67\xd7\x4c\xe7\xa2\x26\x41\xbc\x32\x55\x7a\x81\xe0\xaf\
\x15\x1d\x0a\xdb\x04\xaf\xc5\xe3\x7e\xc1\xdc\x2e\x78\x77\x47\xc7\
\x6b\x75\x80\x6d\xc1\xcd\xe9\xfa\x37\xf1\xf9\xa6\x39\x15\xfe\x9b\
\x00\x7c\x42\x70\x83\xe0\x71\xc1\xce\xbd\x54\xf6\xd5\xd8\x7e\x2d\
\xe9\x02\xb7\x13\x5f\xa9\xdc\x89\x0c\x97\xbe\x9f\xca\x7a\x03\x9f\
\x6e\x12\xc4\x13\x63\x9b\xb8\xbb\xab\x6d\x9b\x26\x38\x5e\x30\x5b\
\x70\x66\x9c\x95\x7c\xf4\x6d\x6d\xe0\x1e\xfc\x2c\x8d\xee\xf6\x05\
\x60\x5b\x70\x79\x2a\xb7\x8d\x33\x9b\xd6\xb1\x1c\x8e\x2f\xc7\xde\
\x76\x63\x6a\x23\x87\x4f\x1b\xb1\x02\x1f\xaa\x58\x76\x35\x80\x6d\
\xc1\xf2\x74\x8f\x57\x30\x7b\x2c\x2a\x36\x5e\x63\xa4\x1e\x45\xac\
\x64\x70\xf2\xff\xbe\x58\xa9\xe7\xf0\x42\xcd\xb2\xfa\xd1\x67\x3d\
\x66\x95\xe4\x1c\xc0\x72\xfc\x0a\xfc\x1b\x67\xe0\x59\x93\x5c\xd5\
\x2d\x70\x30\x64\xb0\x20\x59\xe2\xf3\x8a\x28\xcd\xa8\x35\xb5\xe4\
\xef\xf3\xe3\x5b\x9a\xe8\x8e\x8d\xea\x9a\x16\x27\x79\x8b\xb1\xce\
\x31\x78\x28\xce\x9f\x5f\xdc\x1f\x0f\x77\x9d\x6a\x61\xc8\xf1\x4f\
\x55\x2d\x70\x30\x6d\x15\x9c\xd2\x15\x46\xed\xdd\x1f\x16\x58\xa8\
\x17\x97\x4f\x70\x3b\x7c\x7f\xcd\xfc\xbd\xd1\x83\x33\x1f\x1b\xf4\
\xe1\x01\xcc\xc1\xae\xb1\x07\x78\x59\x03\x00\x8e\x46\x33\xb1\x1a\
\x9f\xc4\x16\xa7\xe1\x7e\x9c\x1d\x87\x5d\xe3\xe8\x0f\x6c\x92\x8e\
\x56\x44\x64\x66\x0a\x11\xe5\xbd\x75\xdc\x60\x19\x20\x85\xcf\x7b\
\x8d\x96\x1e\x01\x8b\xf0\xd3\xaa\x43\xbc\x0c\x70\x50\xb3\xb0\x5a\
\xcb\x41\x02\x2e\xc0\x0d\x19\x60\x5d\xcd\xc6\x2a\x2d\x53\x93\xe7\
\xe7\x7b\x19\x60\x5d\xcd\xc1\x5d\x5a\x91\xcc\x35\xb8\x24\x03\xac\
\xab\x73\x71\x6b\x3a\xbb\x09\x5f\xcc\x00\xeb\x6a\x59\x74\x69\x14\
\x9d\xc9\xcf\x71\x4e\x06\x58\x57\x5f\xc3\x77\x12\xa7\x5f\xc7\x0f\
\x3c\x03\xac\xa5\xef\xe2\x42\x14\xcb\x93\xd7\x0e\xf5\x0d\x64\x80\
\x55\xf4\xa5\xae\xb3\xf3\x33\xc0\x3a\xda\x44\x5c\x34\x25\x4e\xfc\
\x2e\xca\x00\xab\xea\xc5\xd8\x75\x6c\xd3\x52\xec\x1e\x38\x4f\x11\
\x6a\xc8\x00\x4b\xb5\x13\x0b\x15\x8b\x95\x8b\x20\xff\x62\x9d\xcb\
\xdf\x33\xc0\x11\xb4\x2b\xe2\x2a\x9c\xfd\x1b\x22\xca\x9d\x79\x18\
\x53\x45\xbb\x15\xd1\xe3\x3f\xa3\x70\xf9\x7f\x4a\x11\x3f\xc9\x03\
\xe9\x52\xed\xc1\x57\xf1\x20\x11\xda\x1c\x25\x41\xae\x0c\xb0\x53\
\x97\x29\x56\x16\x16\x9f\xeb\x3c\x45\x88\x35\x3b\x13\x2a\xe9\x2a\
\xfc\x24\xb5\x80\xe7\x2a\x96\x0b\xcb\x00\xab\xe8\x26\xc5\xa6\xb4\
\x62\xdd\xec\x52\xfc\xb1\xea\xa5\x19\xe0\xdd\x69\xbe\x1b\x14\xab\
\x27\x56\xd7\xb9\xbc\x5a\x50\xe9\x61\x9c\x32\x81\x21\x1c\x82\x53\
\x47\x71\xdd\x1a\x5c\x9c\xce\xbe\x81\x5f\x8c\xf5\xa3\x35\x23\x2e\
\x7c\x52\xcd\x98\x70\x5b\xf0\x9b\xae\x05\x98\x57\x8d\x16\x50\x99\
\x05\x6e\xc4\xef\x27\xb0\xed\xf5\xa9\x1f\x11\xe6\x49\x9c\x27\x78\
\x53\x0b\x37\xe3\xea\xc9\xda\x82\xf5\xd5\xb6\xc0\x27\x04\x33\x92\
\xe5\xdd\x63\x1f\x17\x58\x4d\xae\x4e\x64\x33\x3e\x83\x97\xb5\x62\
\x67\x71\x81\x2a\x7b\x50\x32\xc0\x38\xaf\x58\xa8\xd8\x96\x58\x74\
\x8b\x4b\x87\x7a\x56\x32\xc0\x6a\x9e\x95\xa7\x14\xc1\xf3\x5d\x63\
\x51\xf4\x3b\x1f\xe0\x2e\x7c\x16\x7f\x41\xb1\x65\x76\xc1\xde\x3c\
\x2b\x19\xe0\x70\x9e\x95\x65\x78\x9c\xe8\x14\x98\x3b\x92\x67\x25\
\x03\x1c\xea\x59\xb9\x10\xbf\x4d\x2d\xe0\x5c\xf5\x97\x0f\x4f\xe2\
\x61\xcc\xf2\xae\x6d\x12\x1f\xcb\xa8\xea\x00\xfc\x56\xd7\x96\x86\
\x39\x19\x53\x1d\x80\x2b\xba\x76\x26\x9d\x93\x11\xd5\x01\x78\x47\
\x82\x37\xa0\x61\xdb\xba\xc6\x1f\xe0\x4a\xc1\x94\x04\xf0\xeb\x19\
\x4d\x1d\x80\xba\x3c\x2b\x57\x67\x2c\xa3\x01\x58\xa4\x5b\x32\x92\
\xd1\x03\xdc\x67\xcf\xca\x64\x06\xb8\x5a\xb1\x7a\x2a\x6b\x14\x00\
\xd7\x38\x40\xff\xe2\xe4\x9d\xa8\xde\x0c\x2f\x2b\x2b\x2b\x2b\x2b\
\x2b\x2b\x2b\x2b\xab\x81\xfa\x3f\x62\xdc\x0c\x6d\x17\x60\x15\xa5\
\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x0c\xee\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x08\x25\xa0\x5a\x89\x7b\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0c\x49\
\x49\x44\x41\x54\x78\xda\xed\x9c\x7b\x70\x54\xd5\x19\xc0\x7f\xe7\
\xde\xbb\x9b\xcd\xee\x66\x93\x4d\x02\x79\x10\x20\x81\x10\x5e\xe1\
\x51\x62\x04\x14\x95\xaa\x88\x50\x8b\x20\xb5\xb5\x2f\xb5\x56\xad\
\x74\x5a\xdb\xd2\x6a\x6b\x55\x6a\x5b\xeb\xb4\xa3\xed\x4c\x7d\x8c\
\xd6\x22\xda\x76\x5a\xb1\xa5\xd5\x5a\x1f\x28\xbe\x5a\xab\x80\xa0\
\x68\x84\x00\x81\x40\x5e\xe4\xfd\xd8\x4d\xf6\x9d\xdd\x7b\xfb\xc7\
\xbd\x1b\x90\x82\x24\xe4\x6e\x12\xd6\x7c\x33\x3b\xbb\x7b\x67\xf7\
\xdb\x73\x7f\xfb\x9d\xf3\x7d\xe7\x3b\xe7\x3b\x30\x2a\x49\x29\x63\
\xcf\x94\x86\xca\x23\xb0\x4d\x0b\x81\xed\x80\x13\x78\x6d\xd4\x96\
\x06\x26\x5f\x06\x7a\x01\xcd\x78\xdc\x39\x8a\xa4\x7f\x22\x80\xbb\
\x01\x15\xd0\x52\xec\x4e\xed\x18\x88\xb7\x8e\xe2\xf9\x78\xb1\x03\
\x7f\x07\x34\x21\x84\xb6\xe2\xc6\xdb\xb5\x7b\x9e\xae\xd0\xae\xfc\
\xce\x3d\x9a\x90\xa4\x38\xc4\xef\x8e\x8e\x81\x27\x96\x02\x60\x33\
\x70\x91\xd5\x66\xe7\x9a\x3b\x1e\x62\xf6\xa2\x4b\x01\xc8\x2b\x2c\
\xc1\x95\x35\x96\x7d\x3b\xde\x00\x58\x0a\xb4\x01\x3b\x46\x01\x1e\
\x95\x32\xe0\x15\x60\x5a\x66\xee\x78\xae\xff\xf9\x06\xc6\x97\xcc\
\xfa\xc8\x07\xc6\x4d\x9a\x8e\xd3\x9d\xcd\xfe\x9d\xff\x11\xc0\x72\
\xa0\x11\x78\x6f\x14\x20\x7c\x0e\x78\x16\xc8\x9a\x54\x5a\xce\xb5\
\xeb\x1e\xc6\x3d\x36\xff\xc4\x26\x5a\x3c\x93\x54\xa7\x8b\xaa\x5d\
\x6f\x09\xe0\x32\xa0\x06\xf8\xe0\x93\x0a\x50\x00\xb7\x01\x8f\x00\
\xd6\xf2\x25\xab\xf9\xc2\xda\x5f\x61\xb3\x3b\x3f\xf6\x4b\xe3\x4b\
\x66\x63\xb5\xa5\x72\xf0\x83\xad\x02\xf8\x2c\x70\x10\xf8\xf0\x93\
\x06\x30\x05\x78\x02\xf8\x9e\x90\x24\xb1\xec\xea\xef\xb1\xf4\xab\
\xdf\x45\x92\xfb\xd7\x84\x89\xd3\xe6\x22\x2b\x16\xaa\x3f\xdc\x2e\
\x01\x2b\x81\x4a\xe3\xf1\x89\x00\x38\x06\x78\x09\x58\x6e\xb5\xa5\
\x6a\x5f\xfa\xc1\x7d\xa2\xec\xa2\x55\x03\x56\x52\x38\x63\x1e\x1a\
\x1a\x87\xf7\xec\x94\x80\x55\x86\x15\xee\x4b\x76\x80\xb3\x80\xd7\
\x81\xd2\xf4\xec\x5c\xae\xff\xd9\x7a\x51\x34\xf3\xac\xd3\x56\x36\
\xa9\xb4\x9c\x68\x34\x42\xed\xde\x5d\x32\x70\x85\xe1\x54\x0e\x24\
\x2b\xc0\x15\xc0\x73\x40\x4e\xc1\x94\x59\xdc\x70\xf7\x06\x32\x73\
\x0a\x06\xad\xb4\x78\xf6\x02\xc2\x41\x3f\x75\xfb\x3f\x90\x0d\x87\
\xb4\x03\xa8\x4e\x36\x80\xdf\x07\xd6\x03\xa9\x73\xce\x5f\xce\x57\
\x6f\xbb\xff\x94\xce\x62\x40\x10\xe7\x2e\x24\xd8\xe3\xa5\xe1\xc0\
\x6e\x05\x58\x0d\x6c\x03\x0e\x27\x03\x40\xab\xe1\x65\x7f\x04\x48\
\x4b\xbe\xfc\x6d\x3e\x73\xdd\xad\xc8\xb2\xb9\x3f\x25\x84\xa0\x64\
\xde\x22\xfc\xde\x4e\x8e\x1c\xdc\x63\x31\x2c\xf1\x4d\xa0\xee\x4c\
\x06\x98\x0d\x3c\x03\xac\xb6\x58\x6d\x7c\x61\xed\x2f\x99\xbf\xf4\
\xf3\x08\x21\x12\x13\x13\x09\xc1\xd4\xb2\xf3\xe8\x6e\x6f\xa1\xf1\
\xf0\x3e\x0b\x70\x25\xf0\x6f\xa0\xfe\x4c\x04\x58\x82\x9e\x7e\x2a\
\x73\x65\xe5\xf0\xb5\x75\x0f\x33\x65\xee\xc2\xc4\x07\x96\x42\x30\
\xb5\xec\x7c\x3a\x5b\x8e\xd0\x5c\x5b\x65\x35\x2c\xf1\x55\x63\xd6\
\x72\xc6\x00\xbc\xd0\x98\x96\xe5\xe7\x4f\x9e\xc1\xd7\xef\x7a\x94\
\xb1\xe3\x27\x0d\x5d\x74\x2e\x49\x4c\x2f\x5f\x4c\x7b\x63\x2d\x2d\
\x75\x07\x6d\x06\xc4\x97\x81\xe6\x33\x01\xe0\x1a\xe0\x49\x20\x75\
\xe6\x82\x8b\xb9\xfa\xf6\xfb\x71\xb8\xdc\x43\xee\x0d\x85\x24\x31\
\x7d\xfe\xa7\x69\xad\xab\xa6\xad\xe1\x50\xaa\x01\x71\x33\xd0\x32\
\x52\x01\xca\xc0\x83\xc0\x5d\x80\x74\xc1\x15\xd7\xb1\x72\xcd\x3a\
\x14\xc5\x32\x6c\x41\xad\x24\x49\xcc\x98\x7f\x21\x4d\x35\x55\xb4\
\x37\xd6\xd8\x0d\xef\xfc\x3c\xd0\x3e\xd2\x00\xa6\x03\xff\x04\xae\
\x92\x15\x85\x2b\x6f\xfe\x05\x8b\x56\x5c\x9d\x30\x67\x31\x20\x88\
\xb2\xcc\xcc\x05\x17\xd3\x70\x70\x0f\x9d\xcd\xf5\x0e\x03\xe2\x73\
\x40\xc7\x48\x01\x58\x0c\x6c\x01\x16\x38\x5c\x6e\xbe\xf6\x93\xdf\
\x31\xb5\xec\xbc\x91\x94\x61\x42\x92\x65\x4a\x17\x2e\xa1\xe1\xc0\
\x87\x74\xb6\x34\x38\x8d\x69\xdf\x3f\x81\xae\xe1\x06\xf8\x69\x63\
\x5c\x29\xcc\x99\x30\x85\x1b\xee\xde\x40\xce\x84\x62\x46\xa2\xc8\
\xb2\xc2\xcc\x85\x17\x53\xbb\xf7\x7d\x3c\x6d\x8d\x2e\x23\x01\xf1\
\x0c\xe0\x19\x2e\x80\xd7\x01\x4f\x01\x69\xd3\xce\xba\x80\x6b\xef\
\x7c\x08\x67\x7a\x26\x23\x59\x64\xc5\xc2\xac\x73\x96\x70\xb8\xf2\
\x5d\xbc\xed\xcd\xe9\xc0\xe5\xc0\x3f\x80\x6e\xd3\x9c\x57\x3f\x21\
\xff\x02\xf8\x21\xc0\xa2\xcb\xaf\xe1\xd2\x01\xa4\xa1\x46\x82\x84\
\x02\x3e\x1e\xff\xe9\x4d\xd4\x57\x55\x80\x9e\x4b\xbc\xc0\xac\x38\
\xf1\x54\x00\x9d\xc0\x9f\x81\x15\xb2\xa2\xb0\xe2\xc6\xdb\x29\x5f\
\xb2\x9a\x33\x51\x42\xfe\x1e\xd6\xff\xe4\x06\x1a\xab\x2b\x41\x4f\
\x81\x2d\x36\x23\xc4\xf9\x38\x80\x05\xc0\x0b\xc0\x2c\x87\xcb\xcd\
\x55\x3f\xb8\x97\xc9\xb3\xce\xe6\x4c\x96\x40\x8f\x97\xc7\xd6\x5d\
\x4f\x53\xcd\x7e\xd0\x93\xb1\x8b\xd1\x17\xab\x4c\x07\xb8\x00\xf8\
\x17\x90\x9d\x9d\x5f\xc8\x35\x77\x3c\x48\x56\xde\x84\x11\x03\xc2\
\xdb\xd1\x82\xb7\xad\x99\x98\x1a\x25\x1c\xf0\x9f\xf0\x33\x8a\xc5\
\x8a\x62\xb1\xfe\xdf\xf5\xa0\xbf\x9b\x3f\xdd\x73\x73\xfc\xad\x0f\
\x28\x1c\x4c\x88\x73\x22\x80\x37\x00\x8f\x1e\x7b\x21\x65\x80\x69\
\xa8\x70\xc0\x87\x3d\x2d\x83\x8b\xbf\xf8\x4d\x16\x2c\xbb\xca\x74\
\x80\x3f\x5e\x35\xdb\x4c\x75\x15\x46\x74\xd1\x79\x3a\x5f\x56\x8e\
\x1b\xef\x1e\x06\xbe\x72\x22\x20\x03\xef\x2e\x1e\xc6\x4d\x9e\x91\
\x10\xeb\x3b\x89\x3c\x7f\xdc\x7b\x1b\xfa\x3a\xcc\xb1\xf7\x1a\x35\
\x9e\x1d\x40\x9e\x91\x3d\x12\xc0\x6f\x80\x1b\x81\xc8\x60\x00\x46\
\x80\x6f\x19\x8f\xb8\x75\x6a\xa7\x71\x8f\x13\x80\x0a\x8b\xd5\xc6\
\xb8\xc9\x33\x4d\x07\xd8\x5c\x53\x05\x80\xbd\xa8\x9c\x58\xc0\x43\
\xb8\xe5\x00\xc0\xd9\x0c\xd3\xa2\xfb\xf1\x00\x23\x26\xe8\x9c\x03\
\x30\x79\xce\x82\x84\x84\x3a\x2d\x75\x07\x75\xf3\xca\x29\xa6\x6b\
\xe7\xdf\xe3\x97\x87\x6d\x61\x49\x4a\x80\xce\x05\x00\x13\x4a\x66\
\x27\xa4\xc1\xed\x47\x6a\xf4\x86\xdb\xd2\xd0\xa2\x11\x80\x56\xa0\
\x27\x99\x00\x9e\x05\x50\x50\x52\x9a\x90\x06\x77\x34\xeb\x19\x7b\
\x21\xf7\x75\x9e\xc3\x0c\xa3\x48\x09\x18\x12\xe6\x00\x14\x24\x60\
\xfc\x03\x68\x33\x2c\x50\xc8\x7d\x69\xb3\x9a\x64\x02\x38\x15\xb0\
\x65\x8c\xc9\xc3\xe6\x48\x33\xbd\xb1\xbd\xe1\x10\x3e\x4f\x07\x08\
\x09\xd4\x58\xfc\x72\x63\x32\x01\x9c\x01\x90\x5b\x38\x35\x21\x8d\
\xed\x6a\xd5\x59\x59\x32\xf2\x88\xfa\xfa\x72\xa4\x75\xc9\x04\xb0\
\x18\x20\x3b\x41\xb3\x16\x9f\x57\x8f\x75\x2d\xae\x1c\xa2\xbe\xbe\
\xb8\xb7\x25\x99\x00\x16\x01\x64\xe6\x16\x24\xa4\xb1\xdd\x9d\x3a\
\x2b\xc5\x35\x86\xa8\xaf\x6f\xf6\xd5\x9c\x4c\x00\x27\x02\xa4\x67\
\xe5\x24\xa4\xb1\x7e\xc3\x02\x15\xbb\x9b\x58\xc0\xdb\xe7\x98\x93\
\x09\x60\x3e\x40\xc6\x98\xfc\x84\x65\x53\x00\x64\x7b\x3a\xb1\xa0\
\x37\xee\x45\x7a\x92\x09\x60\x3a\x90\x10\x0f\x0c\x10\x0e\x06\xf4\
\x46\xa7\xa6\xa1\x86\xfd\xaa\x71\xd9\x93\x4c\x00\x5d\x80\xa9\x9b\
\x88\x3e\x12\xc6\x44\x42\x7a\xa3\x2d\x76\xd4\x68\x38\xde\xf6\x60\
\xd2\x59\x60\xaa\xd3\x95\x90\xc6\x86\xfc\x7a\x6f\x95\x6d\x0e\x50\
\x63\xf1\x89\x76\x28\x99\x00\x26\x54\x34\x4d\x33\x9e\xd5\x11\xd3\
\xa6\x33\x0a\x60\x5c\x84\x64\x49\x5a\x80\x1a\x80\x1a\x8b\xf1\x49\
\x11\xc5\x64\x7d\x1e\xc0\x1d\x0e\xfa\x13\x32\x0e\x5a\x52\x6c\x00\
\xa8\x91\x00\x42\xb6\xa0\xc5\x7a\x01\xca\x87\x60\x1c\xac\x04\x62\
\x43\x01\xb0\x0d\x70\xf7\x78\x3a\x12\x02\xd0\x9a\x92\xaa\x03\xec\
\x0d\x22\xa5\x38\xb4\x58\xc0\x23\x80\x77\x86\xc0\xd0\x4e\x9a\xf1\
\x36\x1b\x60\x0b\x50\xe2\xf3\xb4\x33\xb6\xa0\xc8\xf4\xbb\xb0\xa7\
\xa5\x03\x10\x0b\x78\x91\x6d\x69\x22\x16\xf0\x20\x64\x45\x53\xd2\
\xf3\x02\x68\xaa\x8a\xa6\xc6\x40\x08\x24\x49\x16\x42\x92\x11\x92\
\x24\x84\x24\x23\x49\x32\x9a\xa6\xa1\x69\xaa\xa6\xa9\x2a\x9a\xa6\
\x22\x84\x24\x24\x59\x46\x48\xff\x97\x36\x37\x96\x09\x8e\x95\x3f\
\xa3\x6f\x20\x4d\x38\xc0\x3a\x80\xce\xe6\x06\x26\x95\x96\x27\x0e\
\xa0\xbf\x13\xd9\xe1\x86\xce\x7a\x0a\xaf\x7f\x5c\xd8\x27\xcc\x71\
\xf4\xc7\xf7\xf4\x77\xcc\x6f\x7e\xfe\x5e\x3a\xde\xfe\x13\xae\xd2\
\x4b\xe8\xde\xfd\x32\x20\x7a\x4e\xb6\x3c\x64\xb6\x13\x39\x00\xd0\
\xda\x70\x28\x21\xfd\xc8\x99\x9e\xa5\x07\xd4\xde\x16\x14\xe7\xd1\
\xd7\x66\x8b\xda\x1b\x8c\xbb\xfb\xbe\x69\xf8\x50\x79\xe1\x0a\x38\
\xba\xf0\x63\xb6\xb8\x73\xc6\xe9\xd0\x3c\x8d\xaa\x25\x23\x4f\x7f\
\xdd\x6d\x7e\x32\x26\xea\xef\x3a\x36\xa8\x00\x34\xef\x50\x01\xdc\
\x09\x50\xbb\x77\x57\x5f\xd0\x6b\xa6\x64\xe6\x8e\xd7\xc7\xa8\xf6\
\x5a\xcd\x9a\x59\x60\x8c\x57\xe6\xd7\xd7\x44\x7b\xda\x0c\x03\xec\
\x1b\xe1\x3a\x87\x0a\x60\x3d\x50\x1f\x09\x05\xe2\xfb\x4f\x4c\xee\
\xc2\x99\xa4\x3a\x5d\x68\xbd\x21\x59\x4a\xd1\xe7\xdb\xe1\x36\xf3\
\xd7\x94\x7a\x3d\x8d\x27\xba\xaf\x21\x9b\x89\xbc\x0c\x50\xf5\xde\
\x5b\x09\xe9\xc6\xf9\x45\xd3\x8d\x5e\xa5\x4f\xe7\x42\x4d\xfb\xd0\
\x54\xf3\xa6\x76\x6a\x24\x40\xb4\xa7\x1d\x24\x05\xb5\xb7\x2f\xbc\
\x3c\x34\x94\x00\x5f\x04\xd8\xb3\x75\x4b\x42\x00\xc6\x97\x4b\x23\
\x9d\xf5\x28\xe9\x39\x68\xbd\x21\xc2\x6d\xe6\x75\xe3\xe0\x11\xbd\
\x82\xd6\x96\x53\x4c\xa4\xa3\x6f\xb9\x65\xdf\x50\x03\xf4\x1f\xa9\
\xae\xa4\xa3\xc9\xfc\x82\xa1\x89\x53\xe7\x02\xe0\x3b\xb8\x55\x73\
\x14\xea\x55\x9f\xfe\x43\xe6\xed\xea\x08\xd4\xe8\x27\x0a\xd8\x72\
\x4b\xe2\xc3\x43\x94\x8f\xa9\x90\x4f\x04\xc0\x00\xf0\x37\x80\x1d\
\x2f\x6f\x32\x5d\x79\x51\x69\x39\xb2\xa2\x10\x6a\xdc\x8b\x2d\x7f\
\x1a\x00\x3d\x95\xe6\x9d\xcf\xe3\x3b\xf0\xb6\xfe\x42\x56\x40\x8d\
\x82\x90\x2a\x87\x32\x8c\x89\xcb\xef\x01\xb6\x6d\xde\x48\x24\x14\
\x30\x55\x71\x4a\xaa\x9d\xa2\xd2\x72\xd0\x34\xa1\xc5\xa2\x20\x24\
\x02\xb5\xbb\x88\x06\xbc\x83\xf7\xbe\xbe\x0e\x02\xb5\xef\x21\x64\
\x05\x11\x8f\x01\x35\xf5\x95\xe1\x48\x67\xbd\x0d\xbc\x1d\x09\x05\
\xd9\xfa\xe2\x46\xd3\x95\x97\x2e\x5c\xa2\x5b\xde\xde\xd7\x43\x8e\
\xc9\xf3\xd1\x62\xbd\x78\xdf\x7f\x6e\xd0\x7a\xbb\x76\x3e\xad\x7b\
\xfb\x92\xf3\x8e\x5a\xa2\xbe\xd1\x74\xc8\x01\x82\xbe\x31\x9d\x37\
\x36\xad\x27\xe8\xef\x36\x55\xf1\xec\x73\x97\xa2\x58\x53\x08\xd6\
\x57\xd8\xec\x13\xe7\xe9\x81\xda\xf6\xa7\x06\x15\x7b\x6a\xb1\x5e\
\x3a\xb7\x3d\xa9\x5b\xf9\xd8\x49\xf4\x7a\x1a\x11\xd6\x54\x1f\x7a\
\x09\xed\xb0\x00\x7c\x01\x78\x23\x1c\xf0\xf1\xfa\x5f\x1f\x35\x55\
\xb1\xcd\x91\xc6\xdc\xf3\x96\xc7\xbd\xb1\x6a\xc9\xc8\x23\xd2\x5e\
\x83\xb7\xe2\x85\xd3\xd6\xd9\xf9\xce\x26\xa2\x3d\x6d\x58\xc7\x14\
\x11\xe9\xd0\x9d\x9f\x6c\xb5\xff\xe1\x64\x69\xac\xa1\x00\x08\xb0\
\x16\x50\xff\xfb\xec\x1f\x69\x3c\xb4\xd7\x54\xc5\x8b\x56\x5e\x8b\
\x10\x02\xef\xae\x67\x45\xfa\xec\x65\x00\xb4\xbe\xf4\x5b\xd4\x48\
\xf0\xb4\xc6\xbe\xd6\x2d\xf7\x03\x90\x3e\x7b\xb9\x9e\x40\x10\x42\
\x8d\xfa\x3a\xee\x3d\xd5\x77\x13\x5d\xec\xd1\x0c\x64\x01\xf3\x0f\
\x56\x6c\xa3\xec\xa2\x55\x28\x16\x73\xd2\xf1\x0e\x97\x5b\x2f\x6f\
\xad\x3d\x20\x24\x5b\x9a\x26\x14\xab\x88\x74\xd4\x11\x0b\x78\x48\
\x9b\x76\x41\xff\xbb\xae\xaa\xd2\xb0\xf1\x16\xc2\xad\xd5\xd8\x27\
\xce\x23\xe6\xeb\xd0\x63\x4c\x67\xd6\x26\x35\x12\x5c\x3f\xdc\x00\
\x41\xaf\x20\x5f\x19\xf4\x75\x8f\xed\x68\xaa\xa3\xf4\x9c\x25\xa6\
\x15\x25\x16\x4c\x29\x65\xc7\x96\x4d\x5a\xb0\xa5\x5a\x64\xcc\xbd\
\x8c\x50\x63\x25\xc1\x86\xdd\x28\x0e\x37\xa9\x05\xfd\xdb\x9f\xd8\
\xf4\xcc\xcf\xe8\xfe\xf0\x25\x64\x7b\x06\xee\xf2\xd5\x74\x6d\x7f\
\x0a\x24\x39\xa4\x86\xfd\xcb\xd0\x77\xf1\x0f\x3b\xc0\x28\x7a\x31\
\xf6\x35\xad\xf5\xd5\x29\x9a\xaa\x9a\x56\x6f\x62\xb3\x3b\xb1\x39\
\x5c\x62\xff\xbb\x6f\x12\x6a\xda\xab\x66\xce\xbf\x4a\x04\xeb\x2b\
\xf0\x55\xbd\x89\x50\xac\xd8\x27\x7e\xea\xa4\x7f\x96\x1a\x09\x72\
\x64\xd3\x9d\x78\x76\x3d\x8b\x90\x15\x72\x2e\x5d\x4b\xcb\xe6\xfb\
\xf4\x29\xa2\xa6\xdd\x8c\x7e\x54\x0b\x23\x01\x20\xe8\xfb\x57\x2a\
\x81\xcf\xd7\x54\xbe\x2b\x39\x33\xb2\x28\x28\x36\x67\x03\xe6\xb8\
\xe2\x99\xb4\x35\x1c\xa2\xa5\xb6\x4a\x44\xda\x6b\x34\xf7\x59\xab\
\x44\xb0\x61\x37\xfe\xea\xed\x74\xef\x79\x15\x6b\x76\x21\x96\x8c\
\xfc\x3e\x90\xb1\x70\x80\xae\x9d\x9b\xa8\x7b\xe2\x26\x42\x8d\x7b\
\x91\xac\x76\x72\x96\xad\xa5\xed\xb5\x47\x50\xc3\x7e\xd0\x0b\x12\
\x6f\xe9\xef\xef\x0f\x75\x81\xef\x1a\xe0\x21\x40\x5c\x7e\xd3\x9d\
\xcc\x5f\x7a\xa5\x29\x4a\x23\xa1\x00\x1b\xee\xfa\x06\x75\xfb\x3f\
\x40\x4a\x71\xe2\x3e\xfb\x73\x74\xbd\xb3\x09\x35\x7c\xb4\x07\x2a\
\xe9\x39\x10\x8b\x1e\xbb\xab\x8b\x94\x9c\x29\x64\x2d\xba\x9a\x96\
\x17\x7f\x4d\x2c\xe0\x01\x78\x17\xbd\x7a\xa9\xdf\x75\x1d\x43\x5d\
\x31\xb8\x13\xf0\x02\x4b\xf7\xef\xfc\x8f\x90\x14\x85\xa2\x19\x65\
\x83\x56\x2a\x2b\x16\x4a\xcf\xb9\x84\xfa\xaa\x0a\xad\xb3\xa9\x46\
\x04\xeb\xde\x27\x6d\xfa\x62\xec\x13\xe6\x12\x0b\xf6\xa0\x86\xba\
\x51\xc3\xfe\x3e\x0f\x6d\x2f\x2c\x23\xfb\xfc\xeb\x90\x6c\x4e\x5a\
\x5f\x79\x10\x4d\xbf\xbe\x1d\x58\xc2\x00\x37\x2b\x0d\x57\x89\xf9\
\x1a\xe0\x01\x40\x2e\x99\xb7\x88\x95\x6b\xd6\x91\x91\x9d\x3b\xf8\
\xc1\xb6\xb7\x97\x2d\x7f\x79\x80\x37\x9f\x79\xa2\xef\x9a\xab\xf4\
\x12\xe4\x54\x17\xb2\xc3\x8d\x10\x02\x21\x5b\x08\xb7\x1e\xc2\x5b\
\xf1\x62\x9f\x23\x46\x3f\xba\xe0\x16\x20\x3c\xd0\xdf\x1c\xce\x1a\
\xfd\x15\xe8\xab\x5d\x4e\x49\x56\xf8\xd4\xe2\xcb\x38\xf7\xb3\x5f\
\x21\x77\x62\xc9\xa0\x15\x1f\xa9\xae\x64\xcb\x5f\x1e\xe4\xc0\xae\
\xb7\x4e\x35\x3b\x79\x0b\xfd\xa0\xdb\xd7\x4f\xdb\xfa\x87\x11\xe0\
\x7e\x03\x60\x91\xa6\xa9\xd3\x9a\x0e\xef\x63\xfb\xe6\xbf\xb2\x7b\
\xeb\x2b\xf4\x74\xb5\x21\x49\x12\x8e\x74\x37\xf2\x00\x0f\xb1\x88\
\x45\x7b\x09\xf4\x78\xb1\x58\x53\xf0\x77\x77\xd1\xdd\xd9\x7a\xfc\
\x47\x9e\x44\x3f\x86\x6f\x0d\x7a\x89\x57\xcd\x60\x6e\x62\xf8\x4f\
\x89\xd0\x65\x16\xf0\x0d\xf4\x63\x90\x33\xfa\xa6\x49\x92\x4c\x66\
\xee\x78\xb2\xf2\x27\x90\x91\x9d\x87\x23\xdd\x4d\x4a\xaa\x03\x49\
\x92\x90\x64\x85\x70\x30\x40\xb4\x37\x4c\x77\x47\x2b\x3d\x5d\x6d\
\xb4\x37\xd5\xd1\xd1\x58\x7b\x22\xfd\x15\xc0\x46\xe0\x31\xf4\xc2\
\x1c\xd3\x64\xa4\x00\x8c\x4b\x2a\xfa\x81\xb3\x4b\xd1\xb7\x6c\xcc\
\x61\xe0\x6b\xd7\x1a\xfa\x49\x6e\xdb\x8c\xac\xd0\x16\xf4\x2a\xf5\
\x84\xc8\x48\x03\x78\xbc\xd8\x81\xe9\xc0\x24\x20\x07\xfd\x20\x47\
\xb7\x01\x55\x43\x3f\xfb\x20\x64\xc4\x99\x75\x40\xad\x01\xcf\xc7\
\xa8\x8c\xca\xa8\x8c\xca\xa9\xe5\x7f\xa2\x3a\x37\xce\x5b\xef\x21\
\x51\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x05\x80\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x86\x00\xaf\x00\xd2\x7d\x1c\x57\xe8\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x26\x06\x09\x3a\xf1\x25\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x04\xdb\
\x49\x44\x41\x54\x78\xda\xed\x9c\x6d\x50\x54\x55\x18\x80\x1f\x59\
\x50\x57\x67\x31\xfc\x40\xcd\xd0\x9d\x9c\x50\x69\x74\x9c\xc5\x89\
\x69\x24\x3f\x28\x3f\xca\x14\xcb\x74\xd2\xc0\x01\x93\x48\x0c\x6d\
\x92\xc8\xc8\x64\xc1\xd0\x19\x3f\x83\xc8\xc0\x19\x81\x41\xc3\xfc\
\x2c\xb5\x41\x21\x75\x14\x9d\xb1\x31\xf9\xa1\x53\x3a\x36\x16\xe9\
\x90\xe3\xa4\x86\x19\xe0\xc2\xc2\xde\x7e\xec\xdd\xe2\x1f\x7b\xd6\
\xdd\x80\xe5\x7d\x66\xee\x8f\xfb\xe3\x9e\xb3\xfb\xec\x3d\xe7\x7d\
\xef\x7b\xcf\x59\x10\x04\x41\x10\x04\x41\x10\x04\x41\x19\x43\x17\
\xff\xfc\x21\x80\x03\x68\xed\xa8\x0f\x10\xd0\xc5\x05\x3e\x09\x1c\
\x02\x7a\xca\x58\xf0\x8c\x48\x40\x03\x8e\x00\x81\xa2\xc3\x73\x81\
\x1a\xb0\xcb\x0f\x46\x54\x87\x0a\xd4\x80\xcf\x44\x89\x87\x02\x0d\
\x81\x41\x2e\x89\x56\xd1\xa2\x28\xf0\xf1\x91\x11\x5a\xdc\xea\x4f\
\xb5\x1e\x01\x01\x2e\x89\xa9\x12\x85\x15\x89\x88\x8a\x61\xde\xf2\
\x2c\xd7\x69\x2e\x10\x2f\x02\x15\xb1\xc4\xc4\x32\x6b\x49\x3a\x40\
\x0f\xa0\x08\x98\x23\x02\x15\x99\x38\x3b\x8e\xa9\xf3\xdf\x42\x4f\
\x6b\xf6\x02\x93\x45\xa0\x22\xd3\x16\xbd\x43\xd4\xcc\x05\x00\xbd\
\x81\xa3\xfa\x5c\x29\x02\x55\x98\x9d\x94\xc1\xd8\x89\x33\x00\x4c\
\xc0\x31\x60\xb4\x08\x54\xf9\x62\x01\x01\x2c\x78\x77\x3d\xa3\x22\
\x9f\x03\x18\x04\x54\x00\xc3\x45\xa0\x02\x86\xc0\x20\x16\xbe\xbf\
\x19\xf3\x18\x0b\xba\xbc\x0a\x5d\xa6\x08\x74\x97\x9e\xbd\x8c\xc4\
\x7f\x94\xc7\x50\xf3\x28\xf4\x61\x7c\x0c\x08\x16\x81\x0a\x18\xfb\
\x06\x93\x90\x59\xc0\x80\xa1\xc3\x5d\xc9\xf7\x61\xc0\x28\x02\x15\
\x30\x3d\x36\x80\x25\xd6\x42\x82\xfb\x87\x02\x4c\xd1\x53\x9c\x40\
\x11\xa8\x40\x48\xe8\x30\x12\xad\x85\x18\x4d\xfd\x00\x66\x03\xc5\
\x7a\xd2\xed\x31\xed\xfd\x02\x6f\x03\x6f\x74\xf2\x67\x61\x25\x06\
\x87\x8d\x24\x61\xcd\x76\x76\x66\x26\xd1\x6c\x6b\x8c\x03\xfe\x04\
\x56\xfa\x4a\xa0\x19\x88\xf6\xb7\x3b\x31\x2c\x7c\x2c\xf1\x1f\xe6\
\x52\xb2\x2e\x85\xd6\x16\xfb\x0a\x5d\x62\x96\x2f\x04\x02\x30\x6a\
\xc2\x24\x26\xbf\xb2\xa4\xf3\x46\x5a\x63\x1f\xe5\x6b\x46\x8e\x8b\
\xe2\xf5\xb4\x4d\x94\x6d\x7c\x0f\xcd\xe1\xb0\x02\xf7\x80\x7c\x9f\
\x08\x34\x8f\xb1\x60\x8e\xb0\xf8\xdd\x9c\xf8\x74\x54\x0c\xaf\xa6\
\x58\x39\x98\xbf\x16\x20\x0f\xa8\x03\xbe\x94\x20\xa2\x32\x89\x3e\
\x3f\x97\x97\x12\xd2\xd0\x83\x49\x09\xf0\xb2\x08\x54\x24\x3a\x76\
\x31\x53\xe6\x2d\x75\x8d\xc8\x7d\xc0\x24\x11\xa8\xc8\xf4\xb8\x15\
\x3c\x33\x63\x3e\x7a\x82\x7d\x14\xb0\x88\x40\x45\xe6\x24\x65\x30\
\x2e\x7a\x26\xfa\xa3\x5e\x39\x10\x2e\x02\x55\xe6\x33\x83\x81\xd7\
\x56\xe4\x10\x6e\x89\x06\x18\x0c\x54\x02\x4f\x88\x40\x95\xb4\x24\
\x28\x88\x45\xe9\x5b\x18\x31\x7a\x3c\xc0\x08\xe0\x3b\x60\xa0\x08\
\x54\xc9\x2b\x7b\x19\x59\xbc\x26\x9f\x21\xe6\x70\xf8\xaf\x82\x63\
\x12\x81\x0a\x18\xfb\x06\x93\xb8\xb6\x80\xfe\x43\xc2\x00\x26\xe0\
\xac\xe0\xf4\x16\x81\x0a\x98\x42\x06\xf2\x66\xd6\x0e\x4c\x21\x83\
\x00\xa6\xe2\xac\xe0\x18\x44\xa0\x02\x21\xa1\xc3\x48\xcc\x2c\xf8\
\x37\x50\x03\x5f\x88\x40\x45\x7e\xa8\x3c\xd0\xf6\xf4\x2b\x11\xa8\
\xc0\x89\x3d\x9f\x73\xbe\x7c\x0f\x40\x33\xf0\x02\x70\x4a\x04\xba\
\xc9\xb9\xc3\xa5\x9c\xda\x57\x08\xce\x15\xb0\x0b\x80\x93\x12\x44\
\xdc\xa4\xfa\xe4\x37\x94\x97\x6c\x06\xe7\x62\xa5\x44\x3d\x0a\x4b\
\x1a\xe3\x0e\x3f\x9e\x3f\xc1\xa1\xed\x56\xd7\xe9\x4a\x9c\x8b\x37\
\x25\x91\x76\x87\xeb\x97\xbe\x67\xef\xd6\x74\x34\x87\x03\x20\x93\
\x76\x16\x6d\x8a\xc0\x36\xdc\xbc\x76\x89\x5d\x1b\x56\xd2\xda\xd2\
\x02\xb0\x0d\xc8\x96\x62\x82\x9b\xdc\xbe\xf1\x33\x25\xeb\x96\x63\
\x6f\x7a\x08\xce\xc2\xea\x2a\xb7\x0a\x10\xa2\x0e\xee\xde\xba\x41\
\x91\x35\x19\x5b\xc3\x03\x70\x6e\x9b\x58\xaa\x07\x0f\x11\xd8\x1e\
\x7f\xdd\xbd\x4d\x91\x35\x99\xfa\xfb\xf7\x00\x4e\x00\x0b\x51\xd8\
\xb8\xe3\xd6\x4b\xa5\x33\x07\x77\xa2\x69\x5a\xa7\x16\x11\x19\x13\
\x8b\x29\x64\xa0\xd2\x35\x0d\x0f\xea\x28\xca\x4a\xe6\xfe\x9d\x5b\
\x00\xe7\x81\xb9\x7a\xc2\x8c\x57\x05\xda\x1a\xff\xa6\x72\x77\x6e\
\xa7\x16\xf8\xd4\xf8\x67\x95\x04\xda\x1a\xeb\x29\xc9\x5e\xc6\x9d\
\xda\x1a\x80\xcb\xc0\x2c\xa0\x41\xb5\xdf\xf6\x04\x9e\x76\x77\x2e\
\xe8\x40\x56\xab\x5e\x60\x6f\xb2\xb1\x6b\x7d\x2a\xbf\xff\x72\x05\
\xe0\x3a\x30\x03\xe7\x2b\x4d\xbc\x2d\xf0\xb8\x7e\x74\x66\xa6\xa1\
\xb0\xc4\xa3\xb5\xc5\x4e\xd9\xe6\x34\x6a\x7e\xaa\x06\xa8\xd5\xaf\
\xbf\xed\x69\xe7\xdd\x2a\x88\x38\x1c\x0e\x0e\xe4\x7d\xcc\xb5\x8b\
\x55\x00\x77\x81\xe9\xc0\x6f\x8f\xd2\x66\xb7\x12\x78\x64\x47\x0e\
\x97\xce\x96\x03\x3c\x00\x5e\x04\xae\x3e\x6a\x9b\xdd\x46\x60\xc5\
\xee\x5c\x2e\x54\xec\x07\x78\x08\xc4\x02\x17\xbd\xd1\x6e\xb7\x10\
\x58\xf5\x75\x31\x67\x0e\xee\x04\xb0\xe3\x2c\x4b\x9d\xf6\x56\xdb\
\x7e\x2f\xf0\x42\xe5\x01\x8e\x97\x6e\x03\xe7\xce\xf6\x04\xe0\x5b\
\x6f\xb6\xef\xd7\x02\x2f\x9f\x3b\xce\xe1\xc2\x4f\x5c\xa7\xcb\x81\
\x32\x6f\xf7\xe1\xb7\x02\xaf\x55\x9f\x65\x7f\x6e\x86\xab\x2c\x95\
\x01\x14\xf8\xa2\x1f\xbf\x14\x58\x73\xa5\x9a\xb2\x8d\xab\x5c\x65\
\xa9\x4d\xc0\x06\x5f\xf5\xe5\x77\x02\x6f\xfd\x7a\x95\xd2\x9c\x54\
\xec\xcd\x36\x80\x1d\xc0\x07\xbe\xec\xcf\xaf\x04\xfe\x51\x5b\x43\
\x71\xf6\x32\x9a\x1a\xeb\xc1\xf9\x12\x3c\xa5\x0b\x3c\x8a\x76\x38\
\x17\x01\x6d\x51\xfa\x56\xad\xdf\x80\xc1\xae\x1d\xeb\xe5\xc8\x5f\
\xa1\xa8\x09\x6c\x73\x54\x01\x7d\x44\x8b\xfb\x5c\x6f\x23\xaf\x1a\
\xe8\x27\x4a\xd4\x68\x7b\xf7\x85\x8a\x0e\xcf\x86\x70\x1d\x3e\xd8\
\x0b\xdc\x5d\xa2\x70\x3d\xce\xa5\x67\x37\xe5\x5e\xf2\x8c\x70\x51\
\x20\x08\x82\x20\x08\x82\x20\xfc\xdf\xfc\x03\x73\x7b\x4e\x1e\xbb\
\xf0\x15\x2f\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x07\x91\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x05\x07\x25\x26\x00\xff\x83\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x06\xec\
\x49\x44\x41\x54\x78\xda\xed\x9b\x79\x50\xd4\x55\x1c\xc0\x3f\xc2\
\x72\xa9\xa1\x28\x0a\x8a\x72\x88\x2c\x57\x2a\x2c\x68\x24\x1e\xe5\
\x68\x65\x65\x69\x35\x8d\xa2\xa9\x89\xd3\x54\x1e\x33\x4d\x5a\x8a\
\x62\x92\x4e\x69\x9a\xe2\xa8\xe8\x40\x1e\x59\x96\x95\x67\x56\x6a\
\x78\x60\xda\x68\xd7\xa4\x42\xa3\x99\x59\xe3\x81\x18\x10\x90\x22\
\xb0\xb2\xbb\xfd\xb1\x6f\x8d\x96\x45\xfd\xed\xc5\xb2\xf3\x3e\x33\
\x3b\x0c\xbf\xc7\xbe\xfd\xfd\x3e\x7c\xdf\xf5\x7d\x6f\x41\x22\x91\
\x48\x24\x12\x89\x44\x22\x91\x48\x24\x12\x89\x44\x22\x91\x48\x24\
\x12\x67\xe0\xe9\xe6\xcf\xe7\x05\x0c\x01\x46\x03\xc5\x40\x85\xfc\
\x97\xdf\x99\x6e\xc0\x64\x60\x2b\x50\x09\x18\xc4\xab\x1e\xd8\x04\
\xa8\xa5\xa2\xff\xa3\x02\x06\x01\x6f\x01\xa7\x1a\x08\x33\x00\x86\
\xa0\xd0\x28\x43\x2b\x0f\x0f\x83\x87\xa7\xaa\xa1\xc8\xcd\x40\xac\
\x3d\x3e\xbc\x55\x0b\x95\x16\x0c\x3c\x06\x0c\x07\x86\x02\xed\x4c\
\x05\xde\xbe\x7e\x44\xf6\x4e\x21\x26\x79\x10\xea\xc4\x54\xda\x05\
\x06\x03\x50\xf1\xd7\x65\x0e\x6f\x5b\xc7\x4f\x07\x77\xa2\xab\xaf\
\x07\xd0\x8b\x28\x5d\x08\x14\xba\xbb\x40\x15\xd0\x1f\x78\x44\xbc\
\x12\x1a\xde\x7b\xa7\x90\x70\xa2\x93\x06\x11\x9d\x34\x90\xb0\x58\
\x0d\x2a\x2f\xaf\x26\x2b\xaa\x2c\xbd\xc2\xe1\xed\xeb\xf9\x71\xff\
\x76\x74\xf5\x37\x11\x51\xb9\x43\x88\xfc\xd9\x9d\x04\x06\x37\x10\
\x36\x0c\xe8\x70\x6b\x64\xf0\xf1\xa3\x67\x9f\x14\xd4\x89\xa9\xa8\
\x35\xa9\x04\x74\x0e\x51\x5c\x79\x55\xf9\x55\xbe\xd9\xb1\x81\x1f\
\xf2\xb7\x51\xaf\xad\x33\x89\xdc\x0d\x2c\x00\x7e\x6c\x89\x02\x3d\
\x81\x7e\xa2\x59\x3e\x0a\x68\xcc\xa3\x4c\xad\x19\x88\x3a\x31\x95\
\xf0\xf8\x24\xbc\xbc\x7d\xec\xf2\xa1\xd7\x2a\xca\xf8\x66\xe7\x06\
\xbe\xdf\xb7\x95\x9b\x75\x35\xa6\xcb\x7b\x80\x37\x81\xe3\xae\x2e\
\xb0\x13\xf0\x30\xf0\x78\xa3\x28\xf3\xf6\x25\xe2\xde\x64\xa2\x35\
\x03\x89\xe9\x3b\xc8\xaa\x28\x53\xc2\xf5\xca\x72\x8e\xee\xda\xc4\
\xf1\xbd\x5b\xd0\xd6\xde\x12\x99\x2f\x44\x1e\x75\x15\x81\x9e\x42\
\xd8\x3c\xe0\x3e\x4b\x7f\x10\x14\xda\x13\xb5\x66\x00\x11\x71\x49\
\xa8\x9a\x88\xb2\xf6\x81\xc1\x04\x86\x84\x2b\xfa\xe0\x0b\x67\x4e\
\xb2\xfb\xbd\x45\xe8\xf5\xfa\xdb\xfe\x5d\x5d\xcd\x75\xfe\x2e\xb9\
\xd8\xa8\xc5\x03\x59\x62\xb0\x29\x02\x4a\x9c\x25\x30\x14\xc8\x01\
\x82\x44\x9f\xd6\x19\xf0\xb6\xa5\xc2\xce\xdd\x23\x99\xbc\x60\x1d\
\x6d\xdb\x75\xb8\xeb\xf7\x54\xfc\x55\xcc\x8a\xe9\xa3\xd0\xfe\xd7\
\x44\x6d\x61\x81\x08\x80\x5b\xa3\x9b\x23\x68\x0b\x0c\x06\xc6\x8a\
\xe9\x86\xdd\x50\x2a\xaf\xb6\xfa\x1a\x79\x73\x27\xd9\x4b\x9e\xc9\
\x59\x80\x69\x55\xe3\xe1\xa8\x2e\x05\xf8\x12\x78\xdb\x5e\x15\x06\
\x85\x46\x91\xb1\xb1\x40\x91\x3c\xbd\x4e\xc7\xfa\xac\x17\xa9\x2c\
\x2d\xb6\xe7\xb3\x15\x35\x5c\x12\xaa\x68\x01\xb4\xef\xdc\x95\xf4\
\x37\xf3\x14\xc9\x03\xd8\xba\x2a\x93\x4b\xbf\x35\x39\x47\xde\x6f\
\xe5\xed\x94\x98\x87\xa3\x23\xb9\x00\x3c\x6b\xc5\xfb\x02\x44\x3f\
\x13\xd2\xbe\x53\x17\xc6\xcf\x59\xa5\x58\xde\x81\x4f\xd7\x72\xa2\
\xe0\x0b\x4b\x45\x2f\x03\x6b\xec\xf5\x80\xae\x38\x91\xee\x0a\x1c\
\x04\xa2\x83\xc3\xd5\xa4\x67\xe5\xd1\xc6\x3f\x40\x51\x05\xbf\x1c\
\x3f\xc0\xe6\xc5\xaf\x58\x2a\x5a\x09\x4c\xb7\xe7\xcd\xba\x9a\xc0\
\x10\x21\x4f\xdd\x25\x22\x86\xf4\xf9\xb9\xb4\xf6\x6f\xaf\xa8\x82\
\x8b\x67\x4f\xb1\x76\xf6\x78\x0c\x8d\xa7\x2b\xbb\x81\x51\x80\xce\
\x5d\x05\x76\x13\xf2\xa2\xba\x44\xc4\x90\x9e\x95\x47\xeb\x7b\xda\
\x29\x5b\x9e\x95\x95\xb0\x7c\xfa\x28\xb4\x35\xd5\xe6\x45\xdf\x61\
\xcc\x0b\xde\x70\xc4\x22\xdd\x15\xe8\x0e\x1c\x02\x22\xbb\x46\xc6\
\x91\x3e\x3f\x17\xbf\xb6\xfe\x8a\x2a\xa8\xad\xbe\xc6\xda\xd9\x13\
\x2c\xc9\xfb\x13\x18\xe1\x08\x79\xae\x22\x30\x54\xc8\xeb\x11\x12\
\x19\xc7\xa4\xac\x5c\xfc\xda\x28\x93\xa7\xd7\xe9\xd8\xb8\x70\x0a\
\x55\x65\x57\x2c\xad\x20\x9e\x00\x4a\x1d\x75\xf3\x1e\x2e\x23\xaf\
\x67\x3c\xe9\x59\x79\x8a\xe5\x01\x7c\xb6\x22\x83\x0b\x67\x4e\x98\
\x5f\xd6\x02\x4f\x61\x43\xae\xcf\xd5\x05\x86\x01\x05\x40\x8f\x6e\
\x51\xbd\x48\x9f\x9f\x8b\x6f\x9b\x7b\x14\x57\x52\xb0\x6d\x1d\x27\
\x8f\xec\x31\xbf\x6c\x00\x26\x89\x3e\xd5\xa1\x34\x57\x13\x0e\x17\
\x91\x17\xde\x5d\xdd\x9b\xe7\xe7\xad\xb1\x4a\x5e\xd1\xb1\x7c\xbe\
\xfe\x70\x85\xa5\xa2\x45\x18\xd3\xf6\x0e\xa7\x39\x46\xe1\x08\x21\
\x2f\x2c\x34\xba\x0f\x13\x33\x73\xac\x92\x77\xf9\xfc\x69\x72\x66\
\x8e\xb1\x34\x5d\xd9\x0c\x3c\x27\xa2\xd0\xed\x04\xf6\x10\xf2\x42\
\xc3\x62\x12\x98\x90\x99\x83\x6f\xeb\xb6\x8a\x2b\xa9\x2a\x2b\x61\
\xf9\xb4\x91\x68\x6b\x1b\x0d\xac\x07\x31\x26\x64\xb5\xce\x7a\x20\
\x67\x0a\x8c\x14\xf2\xba\x87\xc5\x26\x32\x31\x33\x07\x1f\xbf\x36\
\x8a\x2b\xd1\xd6\xd5\xb0\x6c\xca\x13\xfc\x53\x7e\xd5\xbc\xe8\x1c\
\x90\x2c\x46\x5e\xa7\xa1\x72\xa2\xbc\x02\xa0\x5b\x78\xac\x86\x09\
\x99\x39\xf8\xf8\xb5\x56\x5c\x89\x5e\xa7\x63\xdd\x1b\x2f\x58\x92\
\x57\x2a\x22\xaf\xca\xd9\xfd\x91\x33\x46\xe1\xa8\x5b\xf2\xe2\x92\
\x98\x38\xcf\x3a\x79\x00\x9f\x66\xcf\xe6\xe2\xaf\x27\xcd\x2f\xdf\
\x10\x13\xe5\x73\xcd\x31\x1a\x3a\x5a\xa0\x5a\x34\x5b\xa3\xbc\xcc\
\xd5\x78\xfb\x5a\x27\xef\xf0\xf6\xf5\x9c\x3a\xba\xd7\xd2\x74\x25\
\x4d\x2c\xd5\x9a\x05\x47\x36\xe1\x68\xd1\xa9\x77\x8d\x88\x4f\x66\
\x42\xe6\x6a\xbc\x7d\xfc\xac\xaa\xa8\xf0\xdb\x7d\xec\xfb\x20\xdb\
\x52\x51\x06\xb0\xab\x39\x57\x02\x8e\x1a\x44\x62\x84\xbc\x2e\x3d\
\x7a\xf5\x63\xfc\x9c\x95\x56\xcb\x2b\xfe\xe3\x34\x39\x33\xd2\xd0\
\xeb\x1b\x25\x51\xd6\x60\xcc\xed\xe1\x6e\x02\x63\x85\xbc\xe0\xc8\
\xde\x29\x3c\x97\xb1\xc2\x6a\x79\x55\x65\x25\x2c\x9b\xfa\x64\xc3\
\xfd\x5a\x13\x9f\x8b\x65\x9a\xce\xdd\x04\xc6\x8a\x3e\x2f\xa8\x67\
\xc2\xfd\x8c\x9b\x95\x6d\xb5\x3c\x6d\x5d\x0d\xcb\xa7\x8d\xa4\xaa\
\xb4\x51\x82\xa0\x10\xb8\x1f\xa8\x76\x85\x34\x92\x3d\xfb\xc0\x38\
\x11\x79\x41\x51\x09\xfd\x19\x37\x2b\x1b\x2f\x1f\x5f\xab\x2a\xd2\
\xeb\x74\xe4\xcd\x4d\xb7\x24\xef\x12\xc6\x53\x0b\x2e\x21\xcf\x9e\
\xa3\x70\xbc\x29\xf2\x6c\x95\x67\xcc\xae\xcc\xe1\xf2\xb9\xa2\x46\
\x2d\x5a\xc8\xbb\x84\x0b\x61\x8f\x08\xec\x05\x1c\x00\x3a\x45\x25\
\xa6\x1a\xe5\xd9\x70\x6e\xe5\xd0\x67\x79\x9c\x3c\xf2\x95\xf9\x65\
\x1d\xf0\x0c\x0e\x4e\x4d\x35\x87\xc0\x3e\x18\xb7\x07\x03\xd5\x9a\
\x01\x8c\x9b\x95\x8d\xca\xcb\xfa\x83\x07\x45\xc7\xf6\x93\xff\xd1\
\x4a\x4b\x45\xd3\xb0\x7e\x1b\xd2\x65\x05\x26\x60\x3c\x7c\x13\x18\
\x9d\x34\x90\xb1\xaf\x67\xdf\xf6\x5c\xde\x1d\xb3\x2b\xbf\xff\xc2\
\xc7\x4b\x67\x5a\x2a\x5a\x84\x1d\xb7\x21\x5d\x65\x14\x4e\x10\x11\
\xd1\x31\x26\x79\x30\x69\xaf\x2d\xb3\x49\xde\xf5\xca\x72\x96\xbc\
\x38\x9c\x9b\x75\xb5\xe6\x45\x4e\x4d\x4d\x39\x4b\x60\xa2\x88\xbc\
\x8e\x31\x7d\x1f\x20\x6d\xe6\xbb\x36\xc9\xbb\x4d\x76\xc5\x61\x3b\
\x69\xcd\xd9\x84\x35\x42\x5e\x87\xd8\x7e\x0f\x32\x66\xc6\x52\x9b\
\xe4\x19\x0c\x06\x72\x33\x26\x36\x95\x9a\x1a\xe1\xea\xf2\x94\x0a\
\x4c\x12\xf2\x02\xe2\xee\x1b\xc2\xe8\x57\x97\xd8\x24\x0f\xe0\x93\
\xe5\xb3\x28\x3e\x7f\xda\xfc\xb2\x29\x35\x55\x4a\x0b\xe0\x6e\xe7\
\x81\xc9\xa2\xcf\x0b\x88\x4f\x19\x6a\x17\x79\xfb\xb7\xac\xe1\x54\
\xe3\xcd\x20\x2d\xf0\x34\xcd\x94\x9a\x72\x54\x04\x26\x8b\x79\x9e\
\xbf\x51\xde\x62\x3c\x55\xb6\xc9\x2b\x3c\x96\xcf\xc1\x4f\x2c\x0e\
\xac\x93\x80\x23\xb4\x20\xee\x14\x81\x29\x22\xf2\xfc\xef\xed\xff\
\x10\xa3\x67\xbc\x63\xb3\xbc\x0b\x67\x0b\xd9\xb2\xc4\xe2\x74\x65\
\x36\x4e\xda\x49\x73\xd6\x28\x9c\x02\x1c\x33\xfd\x32\x2c\x6d\x2a\
\x1e\x9e\xb6\xcd\xbb\xab\xff\xa9\xe0\xe8\xae\xf7\x2d\x15\xad\x05\
\x5e\xc2\x8d\x58\x84\xf1\x2b\x51\x06\x27\xbc\x0e\x60\xe3\xb9\x69\
\x57\xc3\x1b\xd8\xeb\x24\x79\x85\x34\xf8\x9a\x96\x3b\x31\xdd\x09\
\xf2\xca\x31\x1e\x69\x6b\xd1\x78\xd8\x79\x89\x77\xd7\xab\x37\x31\
\x51\xbe\xd4\xd2\x05\x36\x25\x2a\x18\xe3\x69\x51\x3d\x70\x4d\xfc\
\xb4\x95\x6a\x31\xcf\x6b\x05\xd4\xe1\x42\x49\x51\x89\x44\x22\x91\
\x48\x24\x12\x89\x44\x22\x91\x48\x24\x77\xcf\xbf\xad\x86\x46\x8a\
\xe2\xff\x93\x30\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
\x00\x00\x0c\xe6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x03\x34\x2b\x31\x5e\xcb\x06\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0c\x41\
\x49\x44\x41\x54\x78\xda\xed\x9c\x79\x70\x14\x55\x1e\xc7\x3f\xdd\
\x3d\x77\x26\x99\xc9\x4c\x0e\xc8\x1d\x20\x10\x02\x22\x20\xc1\x08\
\xba\x78\x81\x82\x96\x8a\xa2\x82\xca\x2a\xde\xa5\x78\xec\xaa\xb5\
\x2a\xba\xde\xe8\x6a\x69\x81\xeb\x8d\xba\x02\xe2\xaa\x0b\x0a\x2a\
\x08\x78\x12\x05\x43\x40\x25\x31\xa2\xe1\x26\x04\x72\x91\x63\x92\
\xb9\x92\x39\x7a\xff\xe8\x9e\x80\x72\xe5\x98\x40\x20\xf3\xad\xea\
\x9a\xab\xba\x5f\xf7\x67\xde\x7b\xbf\xe3\xfd\xba\x21\xa2\x88\x22\
\x8a\x28\xa2\x88\x22\x3a\x36\x12\xba\xe8\xb8\x51\xc0\xc9\x40\x36\
\xd0\x07\x48\x05\x6c\x20\x58\x94\xdf\xe4\x68\xe0\x6a\xe0\x27\x20\
\x10\xf9\x1b\x40\x02\xce\x04\x9e\x47\x10\x8b\x00\x1f\x20\xb7\x61\
\x3b\xe9\x78\xbf\x70\x4d\x27\xf7\x4f\xd7\x98\xed\xf7\x05\x5a\xdc\
\xd7\xca\x2d\x1e\x33\x00\x72\x10\x44\x0d\xfa\xf8\x4c\x74\xf6\x34\
\x44\xad\x41\xfd\xda\xaf\x74\x78\x39\x48\x63\xc9\xca\x13\xa6\xe7\
\x74\x14\x60\x6f\x8d\xd9\x3e\xdb\xef\xaa\xbb\xcc\xef\xac\x15\x01\
\xb4\xd6\x24\xcc\x59\xa3\x90\xe5\x20\x04\xfc\x78\x2b\x37\xd1\xf4\
\xfb\x2a\x08\xfa\x4f\xe8\xa1\xd7\x5e\x80\x02\x70\x2b\xa2\xf4\x82\
\xdf\x59\x6b\x00\x88\x19\x3c\x0e\x9d\x3d\x95\xe6\xea\x6d\x34\xfc\
\xb4\x18\x39\xf0\x47\x60\x9a\xe8\x38\xb4\xd6\x24\x34\xd1\xf1\x68\
\xa2\x62\x11\xb5\x46\x6a\xd7\xcc\xef\x91\x00\xcd\xc0\x7c\xe0\x12\
\x82\x01\xcc\x59\xa3\x31\xa6\x0d\xc5\x51\xbc\xec\x0f\x43\xd2\x94\
\x3e\x1c\x73\xd6\x28\x4c\x19\xc3\x31\x26\xe7\x20\xea\x4c\x07\x1c\
\xc8\xb9\xb5\x80\xe6\xaa\xcd\x3d\x0a\xa0\x05\xf8\x0a\x38\x45\x90\
\x34\x24\x8c\xbb\x9b\xa6\x8d\x5f\x53\xf3\xd5\xcb\x6a\x2f\x8b\xc7\
\x96\x37\x85\xd8\x11\x13\xd1\x98\xed\x3d\xca\x7a\xb6\x05\xa0\x1e\
\x58\x01\x9c\x22\x45\xd9\x48\x38\xe7\x36\xaa\xbf\x7c\x89\x80\xbb\
\x01\x51\x1f\x45\xc2\xd8\x3b\xb1\x8d\x9c\x84\x20\x69\x8f\xe5\x75\
\xe8\x80\x96\xee\x0a\xf0\x39\xe0\x54\xc9\x64\x25\xfe\xec\x5b\xa8\
\x5c\xfa\x0c\x72\xc0\x8f\xb9\xff\xe9\x24\x5f\xf6\x44\x77\xe9\x71\
\x6f\x00\x7f\x07\xea\x8e\x76\xc3\xe2\x11\x7e\x3f\x0b\x98\x8e\x28\
\x91\x38\xfe\x1e\xaa\x57\xcc\x46\x0e\xf8\x89\x1d\x71\x19\x69\x53\
\x5f\xea\x4e\xc3\x75\x38\xf0\x0d\x60\xef\x6e\x3d\xf0\x09\x40\xb0\
\xe5\x4d\xa1\xf6\xfb\x79\x04\x5b\xdc\x58\x86\x4c\x20\x69\xe2\x23\
\x9d\x6b\x55\x0e\x06\x54\xe7\x3b\x5c\x0a\x39\xe4\x3b\xd4\xc8\xa7\
\xa6\x3b\xf4\xc0\x4c\x60\x34\x80\x3e\x2e\x9d\xe6\xaa\xcd\x88\x3a\
\x63\xe7\xe1\x29\xfc\xc2\x1d\xbe\xed\xdd\xcf\x53\xf8\x16\x48\xec\
\x0e\x00\x27\x02\x58\x86\x8c\xc7\x51\xbc\x1c\x80\x84\xf3\xee\x46\
\xd4\x19\x3b\xdf\xaa\x2c\x07\xc3\x7c\x1d\x15\xfb\xbd\xcf\x51\x21\
\x26\x1d\x6b\x80\x23\x00\xf4\x09\x7d\x70\xef\xf8\x11\x00\xeb\xb0\
\x8b\xc3\x94\xc2\x10\xc4\x30\x5f\x87\x0b\x60\xea\x83\x2f\xd2\x3b\
\x63\x00\x6a\x12\x63\x95\x9a\xc4\x38\x26\x00\x13\x80\x29\x00\x72\
\xc0\xa7\x4c\x96\x66\x3b\x92\xde\x14\x2e\x7e\xe1\x06\xe8\x07\x30\
\x46\xc5\x70\xc3\xe3\x6f\x92\xd4\x37\x07\xa0\x9f\x0a\x31\xe3\x58\
\x00\xbc\x61\xdf\x68\x93\xd5\x7c\x8b\x26\x7c\xad\x86\xbf\x07\xb6\
\x9e\x9c\x29\xda\xc2\x8d\x8f\xcd\x21\xb5\xff\x90\xd0\x3c\xbe\x0a\
\xe8\x7b\xb4\x01\x4e\x0e\xbd\x09\xb8\xea\x95\xbf\xd8\x51\x85\x1c\
\x0c\x86\x0b\xa0\xd0\x15\x3d\x30\x24\x43\x54\x34\xd3\x1e\x79\x8d\
\xf4\x81\xc3\x00\xd2\x54\x88\x03\x8e\x16\xc0\x7e\xc0\x90\x56\x80\
\x9e\x46\xb4\xb1\x29\xca\x44\xb3\x7d\x5d\x78\x5a\x0d\x06\xbb\x3c\
\x89\x6a\x30\x99\x99\xf6\xcf\x57\xc9\x1c\x34\x02\x20\x59\x35\x2c\
\x03\x8f\x06\xc0\xb1\x00\x29\x59\x83\x11\x04\x81\xc6\x92\x95\x98\
\xfb\x9e\x0a\x40\xe5\xd2\x67\xf7\x0d\xe9\xce\x19\xe1\xa3\x92\x85\
\xd6\x19\x4c\x5c\xfb\xf0\xcb\xf4\x3b\x39\x0f\xa0\x97\x0a\x71\x48\
\x57\x03\x1c\x05\x30\xfc\xac\x8b\xc8\x1a\x36\x5a\xe9\x85\xde\x26\
\x44\xbd\x99\xe6\xaa\xcd\xec\xcd\x7f\x3b\x0c\x6e\x4c\x30\xdc\x6e\
\x4c\x33\x80\xdf\x77\x60\x38\xac\xd3\x1b\x99\xfa\xe0\xbf\x43\xd7\
\x92\x00\x7c\x0d\x0c\xeb\x4a\x80\x79\x00\xe9\xd9\xc3\x18\x7b\xd5\
\x74\x00\x1a\x4b\x56\x12\x3b\x72\x12\x00\xd5\x2b\x67\x53\x57\xf0\
\x7e\x77\xeb\x81\xde\x43\x01\x04\xd0\xea\xf4\x4c\x7d\xe0\x45\xb2\
\x73\xcf\x44\x0d\xf7\xbe\x02\x72\xbb\x02\xa0\x39\x64\xb1\x12\x52\
\xfb\x90\xdc\x37\x87\x33\x2e\xb9\x0e\x80\xfa\xc2\x85\xd8\xf2\x14\
\xdb\x52\xf1\xe9\x4c\xf6\x2c\x7e\x9c\x60\x8b\xa7\xdb\xce\x81\x07\
\x98\x69\xad\x96\xab\xee\x7b\x9e\x41\x79\xe7\x02\xc4\x02\x5f\x84\
\x46\x5b\x38\x01\xf6\x05\x04\x7b\x52\x3a\x92\x46\x49\x4f\x8d\xbd\
\xea\x0e\xfa\x0c\xce\x95\x83\xcd\x4e\x1c\x45\xcb\x64\xfb\xa8\xa9\
\x08\x92\x96\xfa\x75\x0b\xd9\x32\xeb\x62\x1a\x8a\x96\x76\x60\x5e\
\x0c\xc3\x44\xda\x41\x88\x93\xef\x7d\x96\x21\xa7\x9f\x0f\x4a\x8e\
\x73\x05\x70\x46\x38\x01\xa6\x03\xc4\xf5\x4e\xfb\x43\xa3\xd7\x3c\
\x30\x5b\x48\x1b\x70\x32\x01\x4f\xa3\x50\x57\xf8\x41\xd0\x96\x37\
\x05\x7d\x62\x16\x3e\x47\x25\xbb\x3f\x7c\x80\x2d\xb3\x2e\xa6\x76\
\xcd\x02\xfc\x6e\x47\x1b\xdd\x18\x51\xe2\x18\x49\x92\x34\x5c\x71\
\xf7\xd3\x0c\x1d\x73\x61\x68\xc4\x2d\x07\xce\x09\x17\xc0\x34\x80\
\xe8\xd8\xf8\x03\x5c\x82\xeb\x1f\x7d\x9d\x93\x46\x8f\x43\xf6\xb7\
\x88\xb5\xab\xe7\xa1\xb5\xf6\x96\xe3\xfe\x72\x3d\x5a\x6b\x6f\x5a\
\xf6\xee\xa0\x72\xe9\xbf\xd8\xf4\xcc\xd9\xec\x78\xeb\x46\x6a\x7f\
\x78\x0f\x6f\xd5\xe6\x43\xdb\x8a\xf0\x45\x22\xd1\xea\x5c\x76\x41\
\xbb\x2e\x5a\x92\x98\x74\xc7\x13\x8c\x38\x67\x22\x80\x09\xf8\x14\
\x38\x2f\x1c\xe9\x2c\x3b\x40\x8c\x3d\xe1\xa0\x2e\xc1\xe4\x7b\x9e\
\x23\x73\x50\x2e\xcb\xe7\xbd\x20\x3b\x4b\xf3\x05\x67\x69\xbe\x6c\
\x19\x76\x91\xac\xb3\xa5\x8a\xee\x9d\x3f\xe1\xda\xba\x16\xd7\xb6\
\x42\x5c\xdb\x0a\x15\x4e\x5a\x03\x86\xde\xd9\xe8\xe3\x33\xd1\x27\
\xf6\x45\x1b\xd3\x0b\xad\x25\x11\xbf\xa3\x22\x14\x13\x1a\x0e\xe6\
\xc2\x01\x46\xc0\xaa\x02\xb2\xab\x2e\x48\xa2\xfa\x07\x27\xa9\xe1\
\x59\xa6\x6a\x55\x3b\xd6\x73\x24\x89\x89\xb7\x3f\x8a\xa4\xd5\xb2\
\x76\xf9\x87\x46\x60\x09\x70\x29\xb0\xac\x33\x00\x0d\xca\xb0\xd5\
\x1f\x32\x80\xc8\x1b\x7f\x25\xd9\xb9\x63\x84\x15\xf3\x67\x51\xfc\
\xdd\xe7\x82\xe3\xe7\x4f\x04\x00\x63\xea\x10\x6f\xc2\xd8\x3b\x0c\
\x82\xa4\xc1\xbb\xe7\x77\x5c\x3b\xd6\xe3\x77\x54\xe1\x29\xdb\x80\
\xa7\x6c\xc3\x01\x87\x52\x5f\x0b\x3b\x15\xd0\x68\x74\xe8\xec\xe9\
\xad\x0b\x54\x7a\x53\x54\xbb\x03\xa2\x8b\x6e\x9e\x81\x28\x4a\xfc\
\xb0\xec\xbf\x7a\xe0\x63\xe0\x4a\x60\x71\x47\x01\xc6\x00\xe8\x8d\
\x87\x4f\x1a\x58\xe3\x7a\x71\xe5\xdf\x9e\xe1\xac\xcb\x6f\xe1\xfb\
\xc5\xef\xb0\xe1\xbb\x65\x78\x76\x15\x1b\x3c\xbb\x8a\x41\x10\x64\
\x43\xd2\x40\xac\x43\x2f\x14\x74\xb6\x54\x10\x44\x82\xcd\x4e\x5a\
\xea\xca\xf1\x35\x54\xe0\x77\xd6\x12\x70\xd5\x13\xf0\x36\xc9\xc1\
\x66\x97\x10\x4a\x56\xec\xd7\x35\x02\xa2\x46\x1f\x14\xf5\x51\xa2\
\x64\xb4\x48\x92\xc9\x82\xc6\x6c\x47\x63\xb6\xa1\x31\xc7\x81\x28\
\x21\x07\x7c\xc8\x01\x3f\x41\x6f\x13\xde\xaa\x2d\xfb\xe6\x37\xb1\
\xfd\xf1\xba\x20\x08\x5c\x78\xe3\xfd\x48\x1a\x2d\xdf\x7f\x32\x4f\
\x07\x7c\x08\x5c\x05\x2c\xec\x08\x40\x01\x20\x18\x68\xdb\x62\x78\
\x42\x4a\x26\x97\x4e\x7f\x8c\x09\xd3\xee\xa5\x78\xf5\x0a\x4a\x7e\
\xf8\x82\xed\x25\xeb\x04\xef\xee\x8d\x78\x77\x6f\xdc\x77\x50\xad\
\x21\xa0\x8f\x4b\x17\xb4\xd6\x24\xd1\x98\x9c\x83\x14\x65\x43\x32\
\x59\x04\x51\x6b\x6c\x5d\xf6\x94\x83\x3e\x04\x41\x24\xe0\x75\x49\
\x41\x9f\x5b\x0a\x7a\x9a\x08\xb8\x1d\xf8\xdd\xf5\xf8\x1b\x6b\xf0\
\xec\xfe\x15\x5f\x43\x85\x52\xf9\x70\x08\x59\xe2\x7b\x75\x38\x34\
\x9f\x30\xed\x5e\x24\xad\x96\x55\x8b\xde\xd2\x02\xef\x03\x7f\x05\
\xde\x6b\x2f\x40\xbf\xe2\xa6\xb5\x2f\x50\x30\x44\x45\x33\x72\xdc\
\x24\x46\x8e\x9b\x44\xb3\xc7\xcd\xf6\x92\x75\xec\x2c\xdd\x40\xf9\
\xa6\x12\xf6\x6c\xff\x0d\x8f\xb3\x51\xf2\x56\x94\xe2\xad\x28\xed\
\xb4\xd5\x30\x5b\xed\xc4\x27\x67\x60\xef\x95\x46\x5c\x72\x06\x89\
\x69\xfd\xe8\x95\xd1\x1f\x8b\xbd\xf3\x49\xe8\xf3\xae\xb9\x0b\x49\
\xa3\xe5\xeb\x0f\x5e\x93\x80\x79\x80\x16\x98\xdb\x1e\x80\xf5\x00\
\xcd\x1e\x57\x87\x4f\x42\x6f\x34\x91\x9d\x3b\x86\xec\xdc\x31\xad\
\xdf\x39\x1d\x75\xd4\x55\xee\xa2\xbe\x6a\x37\x4e\x47\x2d\xee\x26\
\x07\xee\x26\x07\x2d\xcd\x1e\x7c\xcd\xde\x3f\xf4\x04\x43\x54\x34\
\x5a\x9d\x01\xbd\xd1\x84\x29\xda\x42\x94\xc5\x46\x8c\x2d\x11\xb3\
\xc5\x46\x6c\x42\x12\x5a\xbd\xa1\x4b\xdd\x9c\x73\x27\xdf\x86\x46\
\xa3\x63\xe5\x82\x17\x25\xe0\x3f\x28\x4b\xa6\x73\xda\x0a\xb0\x06\
\xc0\xe5\xa8\x0f\xeb\x49\x99\x2d\x36\xcc\x16\x1b\x69\x03\x4e\xe6\
\x78\xd0\x99\x93\x6e\x44\xd2\x68\xf8\x7c\xee\x0b\x02\xf0\xba\xda\
\x13\x5f\x39\xa8\x5f\x79\x10\x47\xfa\x72\xb3\xd5\xce\xd0\xbf\x4c\
\xa0\x27\x2b\x3d\x7b\x28\x46\x73\x0c\x9b\x7e\x5e\x2d\x00\x13\x00\
\x07\x50\x70\x24\x80\x46\xe0\x66\x01\x81\xd3\x2e\x98\x42\x4f\x57\
\x6a\xff\x21\x98\x63\xe3\x28\x5d\x9f\x2f\x00\xe7\x03\x1e\x60\xf5\
\xe1\x00\x3a\x80\x7f\x78\x5d\x4d\xe2\xe9\x97\x5c\xdb\x1a\x0f\xf7\
\x64\xa5\xf4\x1b\x44\x4c\x5c\x22\xa5\x3f\xe6\x83\x2c\x8f\x05\x82\
\x40\xfe\xa1\x00\xfa\x80\x8b\x65\x59\x4e\xca\x1a\x3a\x8a\xd8\x84\
\x24\x22\x82\xe4\x3e\x03\xb1\x25\xa6\xb0\x71\xed\x57\xa0\x54\x6b\
\x68\xd5\xbc\xe2\x41\xf3\x81\xeb\x00\xb6\x14\x15\x44\xc8\xed\xa7\
\x61\x67\x5e\x88\xde\x64\x0e\x7d\x9c\x1e\x0a\x23\x0f\x06\x70\x05\
\xc0\xc6\xb5\xdf\x44\xa8\xed\xa7\x82\xcf\x3f\xa0\xd9\xed\x0c\xf9\
\xca\xe3\x81\xea\xc3\x01\x6c\xa8\x2a\xdb\x4c\xe5\xce\x4d\x11\x72\
\xea\x68\xfc\x74\xce\x4c\x50\x0a\xe3\xaf\x03\x7e\x38\xd4\x1c\x18\
\x22\x9c\x0a\x8c\xf4\xfb\x5a\xc8\x19\x79\x56\x8f\x86\x57\x5d\xbe\
\x9d\xb7\x1e\xb9\x89\x80\xdf\x07\x30\x13\x98\x7d\xb8\x7c\x60\x48\
\xaf\x03\xfc\xfc\xed\x67\x34\xec\xad\xec\xb1\xf0\x9c\x8e\x3a\xe6\
\x3d\x35\x9d\x16\xaf\x1b\xe0\x23\xe0\xe1\x23\xf9\x81\xad\xe0\x81\
\xa1\xb2\x1c\xcc\xae\xd9\xbd\x9d\xa1\x63\x2e\xe8\x71\xf0\xfc\x3e\
\x1f\xef\x3e\x7d\x17\x7b\xb6\xfd\x06\xb0\x1e\xb8\x48\xf5\x52\xda\
\x04\x10\x75\x9c\xdf\x54\x5b\x51\xa6\x13\x35\x1a\x32\x73\x4e\xe9\
\x51\x00\x97\xbc\xfe\x24\xbf\x16\x7c\x09\x50\x8e\xb2\x56\x5e\xdb\
\x96\x50\xee\xcf\x4e\xf5\xaf\xc0\x15\xdb\x7e\x29\x14\xcd\xb1\x71\
\xa4\xf4\x1b\xd4\x23\xe0\x7d\xb7\xf8\x1d\x56\x7d\xf4\x36\x80\x1b\
\x25\xd5\x7f\xc8\x34\xd2\x91\x16\x77\x4a\xd5\x04\xc3\x84\xd2\xf5\
\xf9\x82\xd9\x6a\x3f\xe1\x21\xfe\x56\xf8\x0d\x1f\xbd\xf2\x58\xa8\
\xaa\xea\x6a\x94\x35\x64\x3a\x0a\x30\x34\xfe\x1d\xc0\x79\xa5\x3f\
\xe6\x0b\xc1\x60\x80\x3e\x83\x73\xbb\xa0\x3e\xe8\xd8\xab\x72\xe7\
\x26\xe6\x3e\x79\xbb\x1c\xf0\xf9\x04\x60\x06\x4a\xf1\x3a\x9d\x05\
\x88\x9a\x85\xa8\x06\xce\xdf\xb1\xf1\x47\xb1\x7a\xd7\x36\xfa\x0f\
\x3f\x1d\x8d\xf6\xc4\x89\x95\x9d\x8e\x3a\xe6\x3c\x74\x3d\xee\xc6\
\x06\x01\x58\x00\xdc\xd3\x96\xfd\xda\xb3\x3e\xbb\x1e\xd8\x00\x5c\
\x50\xbd\x6b\xab\xfe\x97\xd5\xcb\xc9\xc8\x19\x7e\xc0\x12\xe8\xf1\
\x6a\x71\xdf\x7e\xf4\x16\x6a\xca\xb7\x85\x3a\xcb\xa5\xfc\xa9\x64\
\x2e\x1c\x00\x43\x73\xe2\x47\xc0\xd9\x1e\x67\x63\x42\xe1\xca\x85\
\x34\x7b\x5c\xa4\xf4\x1f\x8c\x56\xa7\x3f\x2e\xe1\xc9\xb2\xcc\xc2\
\x17\x67\xb0\xf9\xe7\xd5\x00\x3b\x81\xb3\x81\xc6\xb6\xee\xdf\x91\
\x0a\x81\x5a\x94\x54\x77\x34\x90\x5b\x56\x5a\x24\xac\x5d\xfe\x21\
\x82\x28\x90\x94\x39\xe0\xb8\x4b\x81\x7d\xbb\xe8\x4d\xd6\x7c\xb6\
\x00\x15\xda\x58\x60\x7b\x7b\xf6\xef\x68\x89\x85\x1f\xa5\x24\xe2\
\x53\x60\x40\xc0\xd7\x92\xb1\xb5\xa8\x80\x35\x4b\x17\xe0\x75\x39\
\x89\x4d\x4c\xc1\x14\x6d\x39\x2a\x00\x82\x81\x00\xe5\x5b\x4a\xf8\
\xad\xf0\x1b\x52\xb2\x06\xb7\x6b\xdf\x5f\xd6\xac\x64\xc9\x6b\x4f\
\x82\x72\xd7\xfc\x64\xe0\xbb\xf6\xb6\x1f\x2e\x53\x3a\x41\xb5\x5a\
\xad\xd5\x4e\xc9\x7d\x73\x18\x74\xda\x58\xfa\x0f\x1f\x4d\xef\x8c\
\x01\x61\xb3\xda\x5e\x57\x13\xe5\x5b\x7f\xa5\x7c\x53\x09\x65\x9b\
\x8a\xd9\x5a\x54\x80\xaf\xc5\x8b\x29\xda\xca\x43\xf3\xf2\xdb\x7c\
\x9c\xf2\xcd\x25\xcc\x79\xe8\x7a\x7c\x2d\x5e\x80\x7b\x81\xe7\x3b\
\x72\x3e\xe1\xf6\x45\x46\x01\x37\x01\x97\xa3\x3c\x37\x01\x50\xca\
\x42\xd2\x07\x0e\x23\x31\xad\x1f\x09\x29\x7d\xb0\xf5\x4a\xc1\x6c\
\x8d\x23\xda\x6a\x47\x6f\x8c\x42\x94\xf6\x0d\x04\x8f\xb3\x11\xaf\
\xdb\x89\xd7\xd5\x44\x43\xcd\x1e\x1c\xb5\x55\xd4\x55\x96\xb3\xb7\
\xa2\x8c\xca\x1d\xa5\x34\xd4\x54\x1c\xb2\xf1\x99\x1f\x17\xb7\xe9\
\x24\x1d\x7b\x2b\x79\xf5\xfe\xa9\x34\xd6\x56\x01\xbc\xa9\x9e\x33\
\xdd\x01\x60\x48\x26\x94\x9c\xd9\x78\x60\x1c\xe1\xbd\x5f\xc3\x0b\
\x14\xa9\x5e\x41\x81\xfa\xbe\x58\x6f\x32\xf3\xc8\x82\x35\x47\xdc\
\xb9\xa5\xd9\xc3\x1b\x33\xa6\xb1\x67\xeb\x46\x50\xb2\xca\xe3\xe9\
\xc4\x9d\x9e\x9a\x2e\x02\xe8\x06\x16\xa9\x1b\x2a\xc0\x11\x28\xf5\
\xc9\x59\x28\x45\x42\x89\x40\x3c\x4a\x11\x91\xf0\xa7\x10\xb2\x51\
\x7d\xdd\xa3\x5a\xc6\xed\xc0\x16\x60\xa3\xea\x09\xec\xef\x62\xb4\
\x79\xb2\x95\x65\x99\xff\xcd\x9a\x11\x82\xb7\x05\xa5\x0e\xa6\x53\
\xb7\xc9\x76\x15\xc0\x3f\x6b\x97\xba\x7d\x7c\x2c\x2d\xee\xca\x77\
\x67\x87\x12\x04\x0e\x94\x92\xb8\xbd\x9d\x3d\xa6\x48\x0f\xd1\x86\
\x55\x4b\x43\x09\x82\x80\xea\x28\x87\x25\xdd\xde\x23\x00\x96\x95\
\x16\xb1\xe8\xa5\xd6\x5c\xe8\x1d\xea\xdc\x47\x04\x60\x1b\xd4\x50\
\x53\xc1\xfc\x99\x77\x12\xf0\xfb\x41\x29\xcf\x78\x35\x9c\xc7\x3f\
\xa1\x01\x36\x7b\x5c\xcc\x7d\x72\x3a\xae\xc6\x7a\x50\xaa\xf2\xef\
\x0c\x77\x1b\x27\x2c\xc0\x60\x20\xc0\x07\x2f\xdc\x4f\x55\xd9\x66\
\x50\x12\xc3\x97\xd3\x05\xcf\xe9\x3a\x61\x01\x2e\x9f\x3f\x8b\xdf\
\xd7\xaf\x02\x25\x21\x7c\x89\x6a\x79\x89\x00\x6c\x83\xd6\x7d\xb1\
\x88\xef\x97\xcc\x05\x65\x11\xe8\x4a\xd5\xe7\x23\x02\xb0\x0d\xda\
\xfa\x4b\x21\x9f\xbc\xf1\x54\xe8\xe3\xad\x28\x4f\xf3\x88\xe8\x30\
\xb2\x00\xb2\xde\x64\x96\xef\x79\xe5\x33\x39\x2a\x26\x36\xf4\x68\
\xbd\x67\x22\x68\xda\x01\x10\x90\xe3\x92\x32\x42\xf0\x96\x10\xde\
\xc7\xaa\xf4\x0c\x80\xea\x56\x8c\x72\x0b\x57\x44\x6d\x94\x75\x3f\
\x78\x35\x40\x4a\x04\x49\xc7\x7b\x60\x5e\x04\x47\xc7\x01\xde\x14\
\x41\xd1\x71\x80\xf3\x23\x18\x3a\x2e\x5d\xc4\x68\x44\xd4\x73\xf5\
\x7f\x57\x4a\x20\x48\x6a\x48\xa8\x3d\x00\x00\x00\x00\x49\x45\x4e\
\x44\xae\x42\x60\x82\
\x00\x00\x08\x2b\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x05\x14\x19\x68\x80\xc2\x96\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x07\x86\
\x49\x44\x41\x54\x78\xda\xed\x9b\x7b\x54\x54\xd7\x15\xc6\x7f\xc3\
\xcc\xf0\x0e\x04\xd1\x80\x04\x4d\x82\x8f\x68\x12\xb0\xb5\x55\xb2\
\x5a\x5a\x69\xb2\x6a\x49\x5d\xe6\xa1\x56\x8d\x98\xa9\x5a\xb5\xb5\
\x9a\xda\x88\xf8\x08\x21\xcb\x36\xd6\x18\xac\x12\xc5\x28\xa9\x84\
\x20\x60\x50\x1a\xdb\x80\x29\x18\xd3\xa8\x01\xaa\x98\xe5\x23\x9a\
\x18\xc5\xc4\x18\x6d\x7c\x05\x09\x2f\x45\x60\x66\x98\xfe\x31\x17\
\x42\x2f\x03\x33\x73\x65\x06\x66\x3c\xdf\x5a\xfc\x31\xfb\xce\xfd\
\xe6\xdc\x8f\x73\xf7\xd9\x7b\x9f\x7d\x40\x40\x40\x40\x40\x40\x40\
\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\x40\xc0\x65\xa0\x72\xa3\
\x67\x19\x0c\x24\x5a\xf9\x4e\x03\xd0\xd4\xc5\x75\x2d\xd0\x08\x34\
\x03\xdb\x80\x2f\x6e\x97\x89\x10\x04\x9c\x05\x4c\xdd\xf4\xf7\x5f\
\x20\xc4\x96\x1f\xd6\xb8\x81\x78\x9e\xc0\x3f\x80\x08\x80\x71\xb3\
\x12\xd1\x7a\xf9\x58\xfc\xa2\xbe\xe9\x26\x06\xbd\xde\xe2\xb5\xf7\
\x72\x5e\x6d\xff\xd1\x1b\x78\x08\xb8\x06\x18\xdd\x5d\xc0\x0c\x20\
\x36\x20\x38\x84\x79\xab\x73\x08\xec\x1b\x6a\x37\xc1\x9e\x6d\x1b\
\xda\x7f\x6c\x91\x74\x31\xd9\x72\xaf\x87\x8b\x8b\xb7\x0c\x78\x46\
\xeb\xe9\x8d\x2e\x29\x4d\x91\x78\x67\x8e\xfe\x87\xfd\x6f\x67\xc8\
\x35\xf1\x01\xae\x58\x9b\x7d\xae\x2e\xe0\x14\x60\x95\xca\xc3\x83\
\xa9\x09\xaf\x10\x76\xdf\x30\xbb\x09\x6a\xab\xae\x92\xf3\xf2\x1f\
\x2c\x5d\xd2\x01\x9f\xb9\xf3\x0c\x8c\x06\xde\x04\x54\x8f\xe9\x16\
\x31\x7c\xf4\xcf\xec\x26\x30\x1a\xf4\x6c\x4a\x9c\x86\xd1\xd0\xc1\
\x27\xbe\x0c\xe4\xdb\xca\xe3\x8a\x02\xde\x0b\xec\x02\x7c\xa2\xe3\
\x26\x13\xf3\x84\x4e\x11\x49\xd6\xca\xf9\xd4\x57\x57\x76\x70\x87\
\x40\xb2\x3d\x3c\xae\x26\x60\x20\x50\x08\xf4\x1b\x14\xf5\x30\xe3\
\x67\x2f\x57\x44\xf2\xef\xed\x9b\x38\x7b\xbc\x5c\x6e\x3e\x07\x4c\
\xb3\xc5\xef\xb9\xaa\x80\x6a\x60\x27\x10\x19\x32\x70\x08\xf1\x4b\
\xd6\xe2\xa1\x56\xdb\x4d\xf2\xc5\x89\x72\xf6\xee\x48\xb7\x14\x60\
\x4f\x04\xaa\xec\xe5\x73\x25\x01\xd3\x80\x47\xfd\x02\x82\xd0\x25\
\x6d\xc0\xdb\xef\x0e\xbb\x09\xea\xaa\x2b\xc9\x5e\xb9\xc0\xd2\xa5\
\xdf\x02\xc7\x94\x0c\xca\x55\x04\x5c\x0c\xcc\xd3\x78\x7a\x99\x74\
\x49\x69\x04\xdd\x75\xb7\xfd\x8b\x86\xd1\xc0\xe6\xc4\x78\x0c\xfa\
\x66\xf9\xa5\xf5\x40\xae\xd2\x81\xb9\x82\x80\x8f\x03\xab\x01\x26\
\x3d\xbb\x52\x35\x60\x68\x94\x22\x92\x9c\x55\x0b\xa9\xad\xba\x22\
\x37\x97\xd8\x90\x3f\xbb\xb4\x80\x23\x81\x3c\x40\x3d\x76\xfa\x42\
\xa2\x62\x7e\xa1\x88\x64\xff\xce\x0c\xce\x1c\x2d\x95\x9b\xbf\x06\
\x26\x03\x7a\x77\x15\x30\x1c\x28\x00\x7c\xbf\x1f\x3b\x9e\xd8\x89\
\xbf\x51\x44\xf2\xe5\xa7\x87\xd9\x93\x9b\x26\x37\x37\x03\xbf\x02\
\xae\xde\xea\x20\x7b\xab\x80\xbe\x40\x11\x10\x1e\x11\x39\x9a\xa7\
\x7e\xbf\x42\x11\x49\x7d\x4d\x15\x59\x2f\xcd\xb3\x94\xd6\xce\x07\
\xca\xbb\x63\xa0\xbd\x51\x40\xb5\xf4\xda\x46\xf6\x09\x1d\x40\xfc\
\x92\x75\x68\xb4\x5a\xbb\x49\x5a\x8c\x46\xd2\x97\x4e\xc7\xd0\xdc\
\x64\xa9\xf8\x90\xd1\x5d\x83\xed\x8d\x02\xae\x05\x1e\xf7\x0b\x08\
\x62\xe6\x8b\x9b\xf1\xf1\x0f\x50\x44\xb2\x2d\x65\x11\xd5\xdf\x5c\
\x94\x9b\x0f\x49\xb3\x0f\x77\x15\x70\x1e\xb0\x50\xad\xd1\xf0\x74\
\xe2\x5a\x82\xfb\x0f\x54\x44\x52\x5a\xb0\x95\x53\x1f\xed\x93\x9b\
\xbf\x01\x26\x49\xfe\xcf\x2d\x05\x8c\x93\x82\x65\x26\x2e\x78\x89\
\x88\x87\x7e\xa8\x88\xe4\xfc\xe9\x8f\x29\xde\xba\x4e\x6e\xd6\x4b\
\x8b\xc6\xd7\xdd\x3d\xe8\xde\x22\x60\x24\xb0\x1d\x50\xc7\x4e\x9a\
\xc3\xf7\xc6\x8c\x53\x44\x72\xbd\xf6\x5b\x32\x57\xcc\x05\x53\x87\
\x45\x23\x51\x8a\xf9\x70\x47\x01\xfb\x49\x2b\x6e\xe0\x88\x9f\xfe\
\x92\x9f\x4f\x5b\xa0\x88\xa4\xc5\x68\x24\x7d\x99\x0e\x7d\x53\x63\
\x07\x77\x28\x65\x1b\xb8\xa3\x80\xbe\x98\x4b\x53\xe1\xe1\x43\x22\
\x99\x30\xff\x4f\xa8\x54\xca\x36\x0a\xf3\xfe\xba\x98\x6f\xaf\x5c\
\x90\x9b\x3f\x06\xe6\x3a\xf2\x01\x7a\x52\x40\x15\x90\x03\x44\xf7\
\x09\x1d\x80\x2e\x29\x0d\xad\xa7\x97\x22\xa2\x83\x45\x79\x9c\x2c\
\xff\x40\x6e\xae\x02\x26\x48\x95\x16\xb7\x14\x70\x15\x30\xc1\xcb\
\xd7\x9f\x67\x96\xaf\xc7\x3f\xb0\x8f\x22\x92\x0b\x15\x27\xd8\x95\
\xb1\xba\x43\xed\x00\x88\xc7\x5c\xe3\xc3\x1d\x05\x9c\x05\x2c\x53\
\x6b\x34\x4c\x5f\x9a\x4a\xc8\xc0\xc1\x8a\x48\x1a\xea\x6a\x3a\x5b\
\x34\x92\x81\xf7\x9c\xf1\x20\x3d\x21\xe0\x23\xc0\x66\x80\xf1\x73\
\x9e\x67\x50\x54\xb4\xf2\x45\xe3\x79\x1d\xcd\x8d\x1d\xde\xd0\x9d\
\xad\xd5\x1b\x77\x14\x70\x08\xe6\x4d\x70\xcf\x31\x13\x66\x31\x7a\
\xec\x24\xc5\x44\x3b\x5e\x5d\xce\xb5\x8b\x5f\xc9\xcd\x9f\x01\x33\
\xb1\x71\x4f\xd7\xd5\x04\x6c\x0b\x57\x86\x8d\x8a\x65\xec\xf4\x85\
\x8a\x89\xca\x8b\xf3\xf9\xa4\x6c\xb7\xdc\x5c\x0b\x3c\x05\xd4\x3b\
\x73\x46\x38\x4b\xc0\xd6\xf6\x8b\xc1\xe1\x43\x22\x99\x9a\xf0\x8a\
\xe2\x70\xe5\xe2\xd9\x93\x14\x6e\xf9\x8b\xdc\x6c\x02\x66\x00\x67\
\x9c\xed\x8f\x9c\x21\xa0\x0a\xc8\x04\x62\x02\x82\x43\x88\x5f\xba\
\x0e\xcf\x4e\x7a\x57\xac\x2e\x1a\xf5\xb5\x64\x24\xcf\xb6\xb4\x68\
\xac\x04\xde\xe9\x89\xd5\xd0\xd6\xde\x98\x91\x40\x1f\xcc\xed\x5f\
\xf6\x56\x70\xff\x08\x8c\xf3\xf2\xf1\x33\xcd\x48\x7e\x4d\x15\x18\
\x1c\xa2\x68\xa0\x2d\x46\x23\x79\x6b\x16\xd3\x74\xf3\x86\xfc\x52\
\x31\xb0\xc2\x06\x8a\x07\x31\x37\x0d\x1d\xe9\x09\x01\x47\x48\xb3\
\x48\xd9\x14\x54\xa9\x98\xf2\xdc\x6a\x55\xe8\x3d\x43\x15\x0f\xb4\
\x28\x6b\x2d\x67\x3f\x39\xd4\xa6\xa7\xf4\xf6\xe8\x81\xe1\xc0\xe7\
\x9d\xdc\x76\x87\xe4\x7b\x5b\x71\x53\x8a\x0d\x77\x48\x85\x8b\x6a\
\x67\x08\x38\x13\x48\x69\x6f\x18\x14\xf5\xb0\x5d\x3f\x12\xf5\x93\
\x38\x86\x8d\x1a\xa3\x78\x90\x15\x47\x4a\x39\xf0\x6e\xae\x25\xd7\
\xa3\xc5\xdc\xa9\x60\x8f\x2f\x6e\xc0\xdc\xba\x66\xec\x2e\xff\x64\
\x0d\x99\x92\x88\x6d\x98\x9a\x90\x42\x54\x4c\x9c\xd3\xfc\x4c\x7d\
\xf5\x35\x4b\x45\x82\x0e\x38\x7d\xb8\x84\xfd\x3b\xb7\x70\xbd\xa6\
\xcb\xfd\xf1\x53\xc0\x6c\xcc\xc5\x55\xa3\x33\x04\x0c\x96\x5e\x91\
\xa0\x56\x83\x97\x8f\x1f\x2f\x64\x97\xa0\xd6\x68\xe9\x69\x18\xf4\
\xcd\x94\x15\x66\x53\x56\x90\x4d\x43\x7d\x8d\xb5\xaf\x7f\x04\xa4\
\x03\xd9\xce\x9c\x81\x00\x73\x80\xbf\xb5\x37\xfc\xe0\xd1\x27\x99\
\xb8\xe0\xcf\x3d\x26\x5c\x7d\xf5\x35\x76\x67\xa7\x72\xa2\x6c\xb7\
\xa5\x0e\x2b\x79\x5e\xfc\x4f\x20\x15\x38\xe0\x88\x10\xc3\xd6\x70\
\xe7\x20\x30\xba\xdd\xca\xc0\xa2\x8d\x85\xf4\x0d\xbb\xc7\xa9\xc2\
\x5d\xa8\x38\x41\xd1\x9b\x6b\xb8\x50\x71\xdc\xaa\xc6\xc0\x1b\xd2\
\x62\xf1\xa5\x23\x63\x34\x5b\x31\x52\x7a\x05\xda\x3a\x7a\xfa\xdd\
\x7d\x1f\xcf\x6d\x2c\x70\xb8\x68\x2d\x46\x23\x47\xf7\x15\xb2\x37\
\x3f\x9d\x9a\xca\xcb\x56\x35\x96\x44\xdb\x22\x65\x27\x0e\x85\x3d\
\xed\x4d\x97\x31\x77\xae\x8f\xfa\x2e\xb0\xad\x21\xb0\x6f\x28\x61\
\x11\xc3\x1d\x32\xb8\x9b\x37\xea\x78\xff\xad\x8d\xbc\xb5\x26\x81\
\x4f\x0f\xbe\x4f\x63\xc3\x75\x6b\xfe\x6d\x11\xe6\x8d\xa9\x32\xba\
\x3e\xce\xd0\x23\x33\x10\xe0\x4e\x29\x5d\x6a\x8b\xad\xb4\x5e\xde\
\xbc\x90\x5d\xaa\xb8\x18\x6a\x09\x95\x17\xcf\x51\xbc\x35\x95\x8a\
\x23\x25\x98\x5a\x5a\xac\xf9\xb7\x02\xcc\x5b\xa1\x07\xe8\x01\x28\
\x49\x48\x7f\x0d\x64\xb5\x37\x44\xc6\xc4\xf1\x74\x42\xca\x2d\x0d\
\xc4\x64\x32\x71\xfa\x48\x09\x7b\x72\x37\x70\xf5\xfc\xe7\xb6\xf8\
\xb7\x4c\x60\x83\x23\xfd\x9b\xa3\x04\x54\x61\xde\xe1\x8a\x69\x6f\
\x7c\x36\xf5\xef\xf4\xbf\xf7\x7e\xbb\xc9\x9a\x1b\x1b\x28\x2f\xce\
\xa7\xe4\x9d\x4c\x1a\xea\xac\x86\x21\x4e\xf5\x6f\x8e\x12\xb0\x35\
\xb5\x3b\xdc\x3e\x93\xb9\xf3\xae\x30\x96\xbc\xbe\xdb\x66\x82\x9a\
\xca\xcb\xec\xdd\xf1\x3a\xc7\x3e\xdc\x65\x2d\x0c\x69\xf5\x6f\xeb\
\x30\x17\x4b\x0d\xf4\x22\xa8\x15\xde\x77\x55\x0a\xb0\xdb\x72\xba\
\xc6\x1b\xf5\x78\xf9\xfa\x31\xf0\xfe\x11\x5d\xde\xf8\xd5\xa9\x63\
\xe4\xaf\x4f\xe2\x5f\x99\x29\x5c\x3a\x77\xaa\x2b\x1f\xd7\x1a\xbf\
\xcd\x05\x5e\x04\x4e\x4a\x39\x70\xaf\xc2\xad\x1c\x36\x0c\x00\x2a\
\x80\xb6\xd3\x2d\x6a\xad\x96\xa4\xac\x0f\xf1\xf6\xf5\x97\x65\x0b\
\x7a\x8e\x97\x16\xf1\xc1\xf6\xcd\xd4\x54\x5e\x72\x19\xff\xe6\x68\
\x01\xc1\xdc\xd5\xbe\xad\xbd\x61\xe8\xc8\x18\x66\x24\x6f\x02\xe0\
\x7a\x4d\x15\x65\xbb\x72\x29\x2f\xca\xb3\xb4\x77\x21\xc7\x79\x60\
\x63\x6f\xf2\x6f\xce\xfa\x07\xec\x43\x76\xda\xf1\xc9\xdf\x25\x9b\
\x1e\x88\x7e\xc4\xa4\x52\x79\xd8\x72\x32\xf2\x10\xe6\xbe\x15\x0d\
\xb7\x29\x1e\xc4\xdc\xf1\x64\xcf\x71\x52\x03\xf0\x36\xf0\x63\x04\
\x00\x58\x63\xa3\x70\x75\x52\x52\x1f\x21\x24\xfb\x7f\xf8\x4b\xa9\
\x5e\x67\xc2\x5d\xc2\x7c\x54\x21\x50\x48\xd5\x39\xa6\x74\xe2\xdf\
\x26\xdf\xce\xfe\xcd\x5e\xec\x91\xfc\xe1\x5e\xe0\x47\x42\x0e\xfb\
\x11\x06\xf4\x17\x32\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\
\x08\x08\xf4\x62\xfc\x0f\x26\xe8\x67\x77\xd3\x1a\x91\x04\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x0b\xf1\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x50\x00\x00\x00\x50\x08\x06\x00\x00\x00\x8e\x11\xf2\xad\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\x00\x00\x00\x00\x00\xf9\x43\xbb\x7f\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xdc\x01\x1e\
\x04\x36\x20\x91\xf5\x66\x89\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x0b\x4c\
\x49\x44\x41\x54\x78\xda\xed\x9c\x79\x58\x55\x65\x1e\xc7\x3f\x17\
\x51\xd9\x65\x93\x4d\x45\x45\x05\x0d\xb1\x5c\xc2\x05\xd3\xd2\x34\
\x4d\x1d\xd3\x6c\xb1\xc5\x27\x9d\x56\xcb\x99\x51\x6b\x4a\xab\xf1\
\x19\x97\x0c\x5b\xa7\x66\xca\x9e\x71\x14\x4d\x0b\x9d\xb4\x5c\x92\
\xb2\xc5\x25\x4c\x71\x43\xdc\xc0\x1b\x21\x20\x20\x08\x5c\xe0\xb2\
\x5c\x2e\x97\x7b\xcf\xfc\x71\xcf\xb1\x5b\x79\xcf\xb9\xc0\x05\x6e\
\xcd\xf9\x3e\xcf\x7d\x9e\xf7\x9c\xf3\x2e\x87\xef\x79\xcf\xf9\x7d\
\x7f\xbf\xf7\xf7\x02\x2a\x54\xa8\x50\xa1\x42\x85\x0a\x15\xbf\x49\
\x68\xda\x79\xfc\x50\x20\x0c\x08\x04\x02\x80\x0e\x36\xd7\x1a\x80\
\x2a\xa0\x0c\xb8\x2c\x96\xff\xaf\x09\x1c\x00\x8c\x05\xe2\x81\x1b\
\x81\x18\xc0\xbb\x09\xed\x75\xc0\x05\xe0\x14\x70\x14\xf8\x16\x28\
\xf9\x3d\x13\xa8\x01\x6e\x01\x66\x03\x93\x80\x5e\xbf\xac\xd0\xc9\
\xc3\x0b\xff\xe0\x30\x7c\xfc\x83\xe8\xe8\xe1\x89\xbb\x7b\x47\x34\
\x6e\xd6\x49\x68\x32\x1a\xa8\xab\xa9\xa2\xae\xba\x0a\x7d\x59\x09\
\xa6\x86\xfa\x5f\x36\xb7\x00\x27\x81\x5d\xc0\x26\x20\xff\xf7\x42\
\x60\x67\xe0\x21\xe0\xaf\x40\xb4\x74\xd2\xdb\x2f\x80\xa8\xb8\x78\
\x7a\x0e\x18\x4c\x44\xd4\x00\x42\x7b\xf4\xc1\xd3\xc7\xcf\xe1\x4e\
\xf5\xba\x52\x8a\xf3\xb4\x5c\xd6\x9e\x25\x2f\xf3\x14\x79\x99\xa7\
\x6d\x49\xb5\x00\x9f\x00\x89\xe2\x0c\xfd\x4d\x12\xe8\x0e\x3c\x0e\
\xbc\x04\x84\x03\x78\xf9\xfa\x33\x74\xfc\x5d\x0c\x1a\x3d\x89\x88\
\xa8\x01\x68\x34\xce\x1b\xce\x64\xac\x47\x9b\x7e\x98\x73\x47\xbe\
\x22\xe3\xd0\x5e\xdb\x4b\x7b\x81\x85\x80\xf6\xb7\x44\x60\x2c\x90\
\x04\x0c\x03\x08\xef\x15\xc3\x98\x19\x73\x19\x98\x30\x91\x0e\x1d\
\xdc\x5b\xfd\x8f\xd0\xeb\x4a\x49\xdd\xb9\x91\xd4\x5d\x9b\xa4\x53\
\x46\xf1\x41\xbe\x29\xce\x4e\x97\x25\x50\x03\x2c\x06\x56\x02\x9d\
\xbd\xbb\x04\x32\xfd\x89\x17\x89\x1d\x71\xbb\x53\x67\x9b\xa3\xa8\
\xd5\x57\xb0\x67\x5d\x22\x19\xdf\x5d\x9b\x91\x87\x80\xfb\x81\x2b\
\xae\x48\x60\x67\xf1\xe3\x7d\x2f\x40\xfc\xc4\x59\x4c\x7e\x64\x31\
\x9d\x3d\xbd\x69\x6f\x5c\x3c\xf9\x1d\xdb\xde\x5e\x82\xa1\x46\x0f\
\x50\x04\x4c\x04\xce\xbb\x12\x81\xbe\xc0\x4e\xe0\x36\xf7\x8e\x9d\
\xb8\x6f\xf1\x1a\x62\x87\x8f\x73\x29\x7d\x56\x53\x59\xce\xc6\x55\
\xcf\x50\x98\x7d\x5e\x92\x40\x13\x5a\xc3\xc0\x34\x87\x40\x1f\xe0\
\x2b\x60\x84\x6f\x40\x30\x73\x97\x7d\x40\x58\xcf\x7e\xcd\xbe\x81\
\xea\x8a\x32\x74\x25\x05\xd4\x55\x57\xd2\xd8\xd0\x70\xed\xbc\xa7\
\x8f\x1f\x7e\x81\x21\x04\x86\x75\xc7\xbd\x63\xa7\xe6\x19\x9a\x06\
\x23\x1f\xbf\xf6\x2c\x59\x27\x0e\x02\xe8\x81\xd1\xc0\xd9\xf6\x24\
\xb0\x03\xf0\x19\x30\xd5\x2f\x28\x94\x27\x5e\x49\x22\x20\xa4\x9b\
\xc3\x8d\x2d\x16\x0b\x45\x3f\x5e\x20\xeb\xe4\x21\x72\xce\x1c\xa3\
\xe8\x52\x26\x0d\xf5\x06\xf9\x1b\xd4\x68\x08\x08\xed\x46\x64\xcc\
\x4d\xf4\x1f\x36\x96\xe8\x21\x09\x78\x78\xf9\x38\x3c\xa6\xb9\xd1\
\xc4\x87\xab\xff\x8c\xf6\x54\x2a\x40\x9e\x68\xe8\xca\xda\x8b\xc0\
\xd7\x80\x67\x3d\x7d\xfc\x78\xf2\xd5\x0f\xe9\xda\xad\xb7\x43\x8d\
\x8c\x86\x3a\x8e\xed\xfb\x2f\x47\x53\xb6\x52\x51\x52\x70\x3d\x0f\
\xa3\x00\x28\xb6\x71\xd7\xdc\x81\x10\xf1\xd7\x0b\xe8\x78\x4d\x2b\
\x75\xec\x44\xdc\xe8\x49\xdc\x7a\xf7\x1f\x1d\x1e\xbf\xd1\x64\xe2\
\x83\x25\x0f\x53\xf8\xe3\x05\x80\x7d\xc0\x9d\x80\xb9\xad\x09\x9c\
\x2e\xce\x3e\x1e\x5b\xb9\x9e\xde\xb1\xc3\x94\x67\x9c\xd9\xcc\xd1\
\x94\x64\xbe\xd9\xfa\xbe\x60\xa8\xd1\x4b\x63\x95\x01\xdb\x80\xaf\
\x81\x54\xa0\xd4\x01\x7d\x39\x10\x98\x0c\x4c\x01\x12\x00\x34\x6e\
\x6e\x0c\xb9\xed\x0f\x4c\x9e\xb3\x08\x2f\x3f\x7f\xc5\x7b\xa9\x2a\
\x2b\xe6\x9d\x85\xb3\x24\xc3\xb2\x04\x78\xb5\x2d\x09\x0c\x04\xb2\
\x80\xae\x53\xe6\x3d\x47\xc2\xb4\x87\x15\x1b\x54\x5c\x2d\x64\xdb\
\xdb\x4b\xc9\xcb\x4c\x97\x4e\x1d\x16\x3d\x85\xcf\x5b\xa8\xcd\xfa\
\x01\x8b\x80\x27\x01\xfc\x02\x43\xb8\x6f\xd1\xab\x0e\x3d\x50\xed\
\xa9\x54\x92\x56\xcc\x97\x74\xe2\x00\xe0\x52\x4b\x09\xec\xe0\x60\
\xbd\xb5\xc0\xa8\xa8\xb8\x78\xa6\x3f\xf1\x92\xa2\xc6\xcb\xcd\x4c\
\x67\xdd\xcb\xf3\x84\xb2\xa2\x3c\x8d\xe8\xf0\x3f\x02\x3c\x27\x7a\
\x07\x42\x0b\xef\x59\x27\x3e\x84\x8f\x81\x91\x46\x43\x6d\xc4\xe9\
\x83\x9f\x13\x10\x12\x41\x78\xaf\x18\xd9\x86\x41\xe1\x91\xe8\xae\
\x16\x52\x9c\x7b\xd1\x1d\xe8\x0b\x7c\xd4\x16\x04\x0e\x07\xde\x71\
\x73\xeb\xa0\x99\xbb\x6c\x2d\x5e\xbe\xf2\xaf\x4b\xce\xb9\xe3\x24\
\x2d\x7f\x4a\x30\x1a\x6a\x35\xc0\x7e\x31\x02\xd3\x1a\xfe\x69\x39\
\xb0\x01\x08\x10\x04\xcb\xf0\xcc\xe3\x07\x08\x0e\x8f\x54\x54\x04\
\x91\xd1\x83\x38\x9a\x92\x8c\xc5\x6c\x8e\x06\x0e\x02\xb9\xad\x4d\
\xe0\x46\x20\x6a\xcc\x8c\xb9\xc4\x25\xdc\x21\x5b\xf1\xca\xa5\x8b\
\xfc\x67\xd9\x63\x98\x1a\xea\x35\xc0\x7a\x51\x64\xd7\xb5\xa2\xdc\
\xb3\x00\x29\x40\x03\x82\x30\x3e\xeb\xc4\x01\xa2\xe2\xe2\xf1\xef\
\x1a\x6e\x5f\xfd\x7b\x7a\x21\x08\x02\x39\xe7\x8e\x03\x44\x8a\xce\
\x40\xb3\xe1\xa6\x70\x7d\x34\x30\xde\xc3\xcb\x97\x31\x33\xe7\xc9\
\x56\x34\xd4\xea\xd9\xb2\x66\x21\x26\xa3\x01\xe0\x53\xe0\x51\x67\
\x59\x3a\x07\xb0\x1a\x58\x6b\x6e\x6c\x64\xdb\x5b\x4b\xa8\xaf\xad\
\x96\xad\x3c\x72\xca\x6c\xc9\x63\x1a\x07\x0c\x6e\x4d\x02\x9f\x05\
\x18\x71\xe7\xfd\x78\x7a\xcb\x87\x9e\xf6\xac\x4b\x44\x57\x5c\x00\
\x70\x0e\x78\xc0\x09\xdf\xba\xa6\xe2\x4f\xc0\xe9\xca\xd2\x22\xbe\
\xdc\xfc\x0f\xd9\x8a\x9e\xde\x7e\x0c\x19\x37\x5d\x3a\x5c\xd0\x5a\
\x04\x76\x07\xa6\x02\x24\x4c\x7b\x48\xe1\xbb\x77\x82\xf4\x03\xbb\
\xa5\x57\x6a\x26\x50\xdf\x0e\xde\x9b\x09\x78\x10\xe0\xf8\xbe\xed\
\x5c\x2d\x90\x37\xb0\xa3\xa6\x3c\x20\x15\xef\x01\xbc\x5a\x83\xc0\
\x47\x80\x0e\x71\x09\x13\xf1\xf6\x0b\xb0\x5b\x49\x10\x04\x52\x92\
\x5e\x97\x0e\x57\x02\x3f\xb4\xa3\x0b\x7c\x01\x58\x6f\xb1\x98\x39\
\xb8\x7d\x9d\xa2\x45\xee\x11\x33\x48\x72\x4d\xa7\xb5\x06\x81\xb3\
\x01\x06\x8f\x95\xef\xfb\x87\xf4\xc3\x92\xc2\x2f\x77\x96\x38\x6d\
\x21\x96\x03\x9c\x49\x4d\xa1\xa6\xb2\x5c\xb6\x62\xec\xf0\xf1\x52\
\xf1\x6e\x67\x13\x18\x0d\xdc\xe0\xe1\xe5\x4b\xbf\x21\x09\xb2\x1d\
\x1c\xdc\xb1\x5e\x2a\x26\x02\x06\x17\x20\x30\x0f\xd8\x6d\x6e\x6c\
\xe4\xe4\xfe\x9d\xb2\x15\x07\x8e\x9c\x20\x15\x27\x38\x60\x0f\x9a\
\x44\xe0\x54\x80\xe8\x21\x09\xb2\x11\x65\x5d\x71\x01\x97\xce\x9f\
\x40\x34\x18\x6b\x5d\x28\x9a\xb5\x01\xe0\x6c\xea\x97\xf2\xee\x55\
\x58\x77\x29\x18\xe2\xdf\x5c\x6b\x6c\x8f\xc0\x71\x00\xd1\x83\xe5\
\x67\xdf\xd9\x23\xfb\xa4\xe2\x36\xa0\xda\x85\x08\x4c\xb1\xea\xd2\
\x2c\x6a\xf5\x15\xb2\x15\x7b\xc5\x0e\xb5\x95\x6c\x4e\x21\x50\x03\
\x8c\x04\x88\x8a\x8b\x97\x6d\x9c\x9d\x7e\x44\x2a\xee\xc0\xb5\x50\
\x0f\x1c\x14\x04\x81\xcb\x5a\xf9\xf0\x5f\x8f\x7e\x03\xa5\xe2\x10\
\x67\x11\xd8\x0f\x08\xf4\x0d\x08\x96\x55\xf4\xa6\x06\x23\xb9\x99\
\xd7\x3c\xb4\xaf\x71\x3d\x9c\x02\x28\xc8\x3e\x27\x5b\x29\xbc\x77\
\x7f\xa9\x38\xc8\x59\x04\xde\x04\x10\xa6\xe0\x98\x5f\xc9\xc9\xc2\
\xdc\x68\x92\xa4\x83\xce\x05\x09\x4c\x07\x28\x55\xd0\x83\xa1\x3d\
\xfa\xd8\x1a\x4e\xa7\x10\xd8\x1f\x20\x34\xb2\xaf\x6c\xc3\xa2\x4b\
\x59\x52\xf1\x38\xae\x09\x2d\x40\xf9\x15\xf9\x84\x05\x0f\x6f\x5f\
\x3c\x7d\xbb\x20\x8a\xe9\x30\x67\x10\x18\x05\x10\x1c\xd1\x53\xb6\
\x61\x69\x41\x8e\xad\x78\x75\x45\x14\x02\x54\x57\x94\x2a\x56\xf4\
\x0b\x08\xb1\xf5\xbe\x5a\x4c\x60\x77\x40\x71\xad\xa3\xa2\xf4\xda\
\x52\x6b\xbe\x8b\x12\x58\x06\x50\x57\xad\x9c\xd4\xe5\xfd\x53\x44\
\x3b\xd0\x19\x04\x06\x03\x78\x77\x09\x90\x6d\x58\x53\x59\xf6\xb3\
\x27\xed\x82\xa8\x07\xa4\xef\xb4\x7c\x70\xc1\xa7\x8b\x54\x0c\x68\
\xea\x20\xd7\x53\xc9\x5d\x01\x3c\x3c\xe5\x57\xbe\x4c\x46\xa3\x54\
\xac\x6d\x43\x52\xba\x63\x8d\x22\x7b\x8b\xb2\xe3\xa4\x33\x3a\xb5\
\x59\x36\x4d\xc6\x1a\x39\xc7\x8e\xbc\x93\xc6\x2c\xc5\x9a\xf1\x50\
\x75\x3d\x02\x1b\xaf\x55\x97\x41\x43\x7d\x9d\x6d\xc7\x6d\x85\x02\
\xe0\x75\xac\x8b\xfa\x00\x43\x9b\x40\x8e\x5d\x18\x6a\xf5\xb6\x87\
\x4a\x7d\x0e\x05\x46\x20\xae\x20\x5e\x8f\x40\x1d\x10\x59\xa7\xaf\
\x24\x30\xb4\xbb\xcc\xb4\xf7\xa3\xe2\x6a\xa1\xbd\x3e\x5a\x13\xbb\
\x80\xbf\x49\x41\x83\x3b\xe6\xfc\x85\xbe\x83\x46\xd8\xad\xac\x71\
\x53\x76\x71\xa7\x3d\xfa\x02\xf5\x75\x35\x76\xaf\xa7\xa5\x6c\xe5\
\xc4\x37\x9f\x4a\x87\xf7\x00\x69\x72\xaf\xf0\x55\x40\xd1\x05\xf2\
\xf1\x0f\xb2\x7d\xad\xd2\xda\x98\xc4\x15\xa2\xec\x78\xe1\xc0\x27\
\xeb\x88\x19\x32\x9a\xb0\x9e\xd1\xcd\xee\x2c\x28\x3c\xd2\xee\xb5\
\xcc\x63\xfb\x6d\x83\x12\x73\xb0\xe6\x21\xca\x1a\x91\x7c\x80\xca\
\xb2\x62\xd9\x41\x6d\x16\xb5\xfb\xb7\x93\x91\x58\x0a\x6c\x31\xd6\
\xd5\x90\xb4\xe2\x69\xc5\xfb\x6d\x0e\x7e\x3c\x93\xc6\x96\xc4\x45\
\x08\x16\x8b\x34\xde\x87\x8e\x58\xe1\x5c\x80\xb2\xc2\x5c\x05\x17\
\x28\xe6\x67\x9e\x4b\x3b\x40\x00\xe6\x01\xfb\xf5\xe5\x25\x6c\x5c\
\x31\x5f\x71\x2d\xa4\x29\x28\xce\xd3\xb2\x39\x71\x21\x16\x8b\x19\
\xe0\x7d\xac\xeb\x2e\x0e\xc9\x98\x4c\x80\xe2\x5c\xf9\x04\xcf\x88\
\xa8\x01\x52\xf1\xb6\x76\x94\x2a\x0d\xc0\x0c\xe0\x7c\x49\x7e\x36\
\x9b\x13\x17\xd2\x68\x32\xb5\xb8\xd3\xaa\xb2\x62\x92\x56\x3c\x8d\
\xd1\xfa\x5d\xdc\x8e\xcc\xba\xc9\xf5\x08\x3c\x66\x75\xd5\x32\x11\
\x04\xfb\xeb\x42\xa1\x91\x7d\xf1\xee\x12\x08\x10\xd4\x8e\xb3\x10\
\xd1\x1a\x4e\x02\x0a\x72\xce\x1e\x63\xfb\x3f\x5f\x96\xbd\x6f\x25\
\xd4\x54\xe9\x48\x5a\x31\x1f\x7d\x79\x09\x58\x77\x02\x3c\x80\xcc\
\xea\xa2\x9b\x1d\xa9\x50\x6c\xa8\xd1\x53\x2a\xf3\x1a\x6b\x34\x1a\
\x62\x47\x5c\x0b\x89\x3f\xd4\xce\xa2\xb9\x00\x6b\xc2\x90\x3e\xe3\
\xd0\x5e\xf6\x29\xac\xca\xd9\x9d\xce\x46\x03\x9b\x56\x2d\xa0\x24\
\x3f\x1b\xac\x69\x70\x33\xc5\x59\xde\x24\x4f\x04\xac\x2b\xf6\x64\
\x67\x1c\x91\x1d\x70\xd8\xed\x33\xa5\xe2\xe3\x34\x6d\xcf\x47\x6b\
\xe0\xac\xf8\x3a\x37\x1c\xdc\xb1\x9e\xa3\x29\x5b\x9b\xd4\xd8\x62\
\x36\x93\xfc\xc6\xf3\x14\xfc\x70\xd6\xf6\x81\x28\xfa\x81\xf6\x32\
\x13\x7c\x80\xbb\x04\x41\x60\xf0\xd8\xa9\xf6\x9d\xf0\xc0\x10\xb4\
\xe9\x87\xd1\x97\x97\x74\x06\x2a\x81\xef\xdb\x99\xc4\x4b\xe2\x6f\
\x86\x36\xfd\xb0\x26\xa2\x77\x8c\xc3\x29\x70\xbb\xfe\xfd\x0a\x19\
\x87\x3e\x47\xf4\x32\xc6\xe0\x60\xca\x87\xbd\x19\xb8\x07\x30\x67\
\x9f\xfe\xfe\x97\x2a\xfd\x57\xb8\x7d\xf6\xd3\x52\x71\x4d\x73\xa2\
\x19\xad\x80\x2d\xc0\x52\xc1\x62\x21\xf9\x8d\xe7\xb9\xac\x3d\xa3\
\xd8\xe0\xeb\xe4\xf7\x48\xfb\x62\x1b\x58\xd3\x50\xa6\x01\xd9\x8e\
\x0e\x66\x6f\x06\xd6\x61\x4d\x0a\xea\x1d\x18\xda\x9d\x6e\x7d\x6e\
\xb0\x2f\x42\xc3\x7a\x50\x98\x93\x49\x59\x51\x2e\x62\x9b\x8d\xb4\
\x5d\x4a\x87\x3d\xa4\x02\xa1\x16\x73\xe3\xcd\x99\xc7\xf6\x13\x3b\
\x62\x3c\x5e\xbe\x5d\xae\x5b\xf1\x68\xca\x56\xbe\xd8\xf4\x16\xe2\
\x3d\xdf\x2b\x1a\x8e\x16\x45\x63\x24\x6c\x06\x38\xf9\xcd\x67\x8a\
\x9d\xcc\x98\xbf\x0c\xdf\x80\xae\x92\x9f\xb8\x1b\xf0\x70\x81\x99\
\xb8\x00\xd8\x55\xab\xaf\x60\xc3\xf2\x27\xa9\xa9\xfa\x75\xd0\xfc\
\x42\xda\xb7\xec\x5e\xb7\x5a\xd2\x94\xcf\x88\x6e\x22\xce\x22\x30\
\x19\xd0\x5d\xd6\x9e\x21\x2f\xeb\xb4\x6c\x27\xbe\xfe\x41\xcc\x79\
\xf1\x5d\x3c\x7d\xfc\x04\xac\x6b\xac\x5a\xac\x9b\x09\xdb\x13\x66\
\xac\xc9\x01\x69\xba\xe2\x02\x36\xad\x5a\x40\x83\xf1\xa7\x65\xeb\
\xfc\x8b\x19\x24\xbf\xf9\xbc\x60\xe3\x65\x34\x6b\x59\x56\x2e\xbd\
\xad\x51\x0c\x6d\x8d\xaa\xab\xae\xe4\xc6\x5b\x26\xcb\x76\xe4\x17\
\xd8\x95\xde\x37\x0c\xd5\x88\x4e\x77\x17\xe0\x4b\xda\x68\xbb\x95\
\x5c\xd4\x4d\x8c\xdc\xcc\xd4\xeb\xae\x06\x16\xe7\x65\x13\x37\x6a\
\x22\x25\x97\xb3\x59\xf7\xf2\xa3\x98\x8c\x06\x8d\x48\xdc\x92\xe6\
\x0e\xa0\x14\x8a\x0a\x17\xad\x5a\xe7\xa7\x12\xb7\xd0\x23\x3a\x4e\
\xb6\xf2\xde\x0d\xaf\x4b\xdb\xad\xd2\xb1\x66\xc3\x5b\x70\x0d\xf4\
\x05\x8e\x00\xc1\x31\x43\x6f\xe1\x4a\xae\x56\x12\xca\xbb\x44\xad\
\xd7\xec\x6f\xb6\x52\x82\x65\x8d\xa8\xef\x46\x5f\xc9\xbd\xc8\xcd\
\x13\xee\xb6\x9b\xde\x5b\x94\x93\xc9\xf6\x7f\x2d\x03\x41\x30\x8b\
\x96\xac\x08\xd7\x81\x0e\xeb\xb6\xaf\x07\xcb\xaf\xe4\x77\x34\x1a\
\x6a\x25\x43\x73\x97\x92\x50\x6e\xc9\x37\x50\xc2\x6a\xe0\x6a\x61\
\xf6\x79\x8e\xec\xfd\xd8\xae\x08\xdd\xf1\xde\xdf\xa5\xa8\xc5\xbb\
\xb4\xf1\x96\x53\x07\x91\x26\x7e\x13\xc1\x9a\xc3\x38\x15\x27\x64\
\xcf\x3a\x92\xe2\x6b\x14\x43\x5c\xf7\x5c\x3a\x77\x82\x01\xf1\xb7\
\xda\xc6\x02\x01\x38\xbc\x67\x33\xa7\xbe\xdd\x29\x85\xc2\x66\xb5\
\xf4\xa9\xb6\x22\x2e\x62\xfd\xf7\x01\xcb\x51\xde\x5e\xe1\x34\x02\
\xc1\xba\x51\x2f\xd2\x62\x6e\x1c\x9c\x79\xec\x00\x37\x8e\x9d\x42\
\x67\x0f\x6b\x4e\xa2\xae\xa4\x80\x8f\xd6\x2c\xc6\x62\x6e\x04\x6b\
\x82\xe3\x79\x5c\x1b\xe9\x58\xb7\x7d\xb5\x39\xbc\x80\x0c\x40\x08\
\x8d\xec\x2b\x2c\xdd\xb0\x5f\x58\xb5\x23\x43\xe8\x13\x37\x5c\x10\
\x75\xd4\x47\xa8\x50\x44\x37\xac\xf1\x42\xc1\x37\x20\x58\x88\x9f\
\x38\x4b\x22\xaf\x14\x71\x39\x54\x85\x32\x42\x44\x23\x21\xd8\xfc\
\x66\xa9\xb4\x34\x0d\xde\xc0\x07\x22\x79\xeb\x55\x3a\x9a\x8f\x88\
\x26\x18\x22\x15\x2a\x54\xa8\x50\xa1\x42\x85\x0a\x15\x2a\x54\xa8\
\x50\xa1\x42\x85\x0a\x15\x2a\x54\xb4\x2f\xfe\x07\x9e\xbb\xc6\xbd\
\x95\x4e\xb5\xb4\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
"
qt_resource_name = "\
\x00\x09\
\x0a\x6c\x78\x43\
\x00\x72\
\x00\x65\x00\x73\x00\x6f\x00\x75\x00\x72\x00\x63\x00\x65\x00\x73\
\x00\x12\
\x00\x20\xd5\xa7\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x2e\x00\x70\x00\x6e\
\x00\x67\
\x00\x0f\
\x05\xf1\x15\x67\
\x00\x72\
\x00\x6f\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x78\x00\x5f\x00\x6e\x00\x65\x00\x67\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0f\
\x04\xa5\x8e\xc7\
\x00\x61\
\x00\x72\x00\x6d\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x5f\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x09\x84\xcf\xc7\
\x00\x61\
\x00\x72\x00\x6d\x00\x5f\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x5f\x00\x6f\x00\x66\x00\x66\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x05\xf2\xd3\x27\
\x00\x72\
\x00\x6f\x00\x74\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x79\x00\x5f\x00\x6e\x00\x65\x00\x67\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x05\x90\x96\x27\
\x00\x61\
\x00\x72\x00\x6d\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x5f\x00\x6f\x00\x66\x00\x66\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x10\
\x05\xf2\xdd\x27\
\x00\x72\
\x00\x6f\x00\x74\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x7a\x00\x5f\x00\x6e\x00\x65\x00\x67\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0f\
\x00\x79\xd5\xe7\
\x00\x61\
\x00\x72\x00\x6d\x00\x5f\x00\x67\x00\x72\x00\x69\x00\x70\x00\x70\x00\x65\x00\x72\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x09\
\x07\xbc\x8f\xc7\
\x00\x65\
\x00\x6d\x00\x70\x00\x74\x00\x79\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x0d\x98\xa0\x27\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x75\x00\x70\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x12\
\x0d\x56\x2a\x87\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x64\x00\x6f\x00\x77\x00\x6e\x00\x2e\x00\x70\x00\x6e\
\x00\x67\
\x00\x10\
\x0b\x64\xcb\x47\
\x00\x61\
\x00\x72\x00\x6d\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x5f\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x06\x2e\xd3\x27\
\x00\x72\
\x00\x6f\x00\x74\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x79\x00\x5f\x00\x70\x00\x6f\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x13\
\x02\x80\xed\xc7\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x2e\x00\x70\
\x00\x6e\x00\x67\
\x00\x10\
\x0e\xda\xa0\x27\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x69\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x10\
\x06\x2e\xdd\x27\
\x00\x72\
\x00\x6f\x00\x74\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x7a\x00\x5f\x00\x70\x00\x6f\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x11\
\x03\x78\x2f\x67\
\x00\x74\
\x00\x72\x00\x61\x00\x6e\x00\x73\x00\x6c\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x6f\x00\x75\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\
\x00\x0f\
\x06\x35\x16\xe7\
\x00\x72\
\x00\x6f\x00\x61\x00\x74\x00\x65\x00\x5f\x00\x78\x00\x5f\x00\x70\x00\x6f\x00\x73\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct = "\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x12\x00\x00\x00\x02\
\x00\x00\x00\x18\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x24\x00\x00\x00\x00\x00\x01\x00\x00\x40\xc0\
\x00\x00\x01\xfc\x00\x00\x00\x00\x00\x01\x00\x00\x6c\x94\
\x00\x00\x02\x74\x00\x00\x00\x00\x00\x01\x00\x00\x86\x97\
\x00\x00\x00\x66\x00\x00\x00\x00\x00\x01\x00\x00\x10\xf8\
\x00\x00\x00\xd6\x00\x00\x00\x00\x00\x01\x00\x00\x2c\x12\
\x00\x00\x00\x42\x00\x00\x00\x00\x00\x01\x00\x00\x05\x4d\
\x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x1f\x2c\
\x00\x00\x00\xfe\x00\x00\x00\x00\x00\x01\x00\x00\x34\x44\
\x00\x00\x01\xd6\x00\x00\x00\x00\x00\x01\x00\x00\x5f\xa2\
\x00\x00\x02\x4e\x00\x00\x00\x00\x00\x01\x00\x00\x79\xad\
\x00\x00\x02\x9c\x00\x00\x00\x00\x00\x01\x00\x00\x8e\xc6\
\x00\x00\x01\x48\x00\x00\x00\x00\x00\x01\x00\x00\x4d\x08\
\x00\x00\x00\x8a\x00\x00\x00\x00\x00\x01\x00\x00\x17\x5b\
\x00\x00\x01\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x59\x21\
\x00\x00\x01\x86\x00\x00\x00\x00\x00\x01\x00\x00\x53\x67\
\x00\x00\x01\x60\x00\x00\x00\x00\x00\x01\x00\x00\x4d\xbe\
\x00\x00\x02\x28\x00\x00\x00\x00\x00\x01\x00\x00\x72\x18\
"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| ajibawa-2023/Python-Code-Large/train/row_99275 | 9 | 2,644 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99275:ImportFrom_L10_C0", "label": "from PyQt4 import QtCore", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0038, 0.0004, 0, 0.66, 0.0, 154, 0, 1, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:Assign_L12_C0", "label": "qt_resource_data =", "type": "assigned_variable", "loc": [12, 2529], "level": 0, "parent": null, "vector": [14, 0, 0.4805, 0.9523, 0, 0.66, 0.1667, 131, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "qt_resource_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "qt_resource_data = \"\\\n\\x00\\x00\\x05\\x49\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x50\\x00\\x00\\x00\\x50\\x08\\x06\\x00\\x00\\x00\\x8e\\x11\\xf2\\xad\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x06\\x62\\x4b\\x47\\x44\\x00\\x86\\x00\\xaf\\x00\\xd2\\x7d\\x1c\\x57\\xe8\\x00\\\n\\x00\\x00\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0b\\x13\\x00\\x00\\x0b\\x13\\x01\\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:Assign_L2531_C0", "label": "qt_resource_name =", "type": "assigned_variable", "loc": [2531, 2613], "level": 0, "parent": null, "vector": [14, 0, 0.9728, 0.0314, 0, 0.66, 0.3333, 392, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "qt_resource_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "qt_resource_name = \"\\\n\\x00\\x09\\\n\\x0a\\x6c\\x78\\x43\\\n\\x00\\x72\\\n\\x00\\x65\\x00\\x73\\x00\\x6f\\x00\\x75\\x00\\x72\\x00\\x63\\x00\\x65\\x00\\x73\\\n\\x00\\x12\\\n\\x00\\x20\\xd5\\xa7\\\n\\x00\\x74\\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:Assign_L2615_C0", "label": "qt_resource_struct =", "type": "assigned_variable", "loc": [2615, 2636], "level": 0, "parent": null, "vector": [14, 0, 0.993, 0.0083, 0, 0.66, 0.5, 406, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "qt_resource_struct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "qt_resource_struct = \"\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x12\\x00\\x00\\x00\\x02\\\n\\x00\\x00\\x00\\x18\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x01\\x24\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x40\\xc0\\\n\\x00\\x00\\x01\\xfc\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6c\\x94\\\n\\x00\\x00\\x02\\x74\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x86\\x97\\\n\\x00\\x00\\x00\\x66\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x10\\xf8\\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:FunctionDef_L2638_C0", "label": "qInitResources", "type": "function", "loc": [2638, 2639], "level": 0, "parent": null, "vector": [2, 0, 0.9979, 0.0008, 0, 0.66, 0.6667, 797, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "qInitResources", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def qInitResources():\n QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:Expr_L2639_C4", "label": "qRegisterResourceData()", "type": "expression", "loc": [2639, 2639], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99275:FunctionDef_L2638_C0", "vector": [8, 1, 0.9981, 0.0004, 1, 0.05, 0.0, 248, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "qRegisterResourceData", "arg_names": [], "import_names": [], "rhs_call_name": "qRegisterResourceData", "annotation": ""}, "snippet": " QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:FunctionDef_L2641_C0", "label": "qCleanupResources", "type": "function", "loc": [2641, 2642], "level": 0, "parent": null, "vector": [2, 0, 0.9991, 0.0008, 0, 0.66, 0.8333, 619, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "qCleanupResources", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def qCleanupResources():\n QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:Expr_L2642_C4", "label": "qUnregisterResourceData()", "type": "expression", "loc": [2642, 2642], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99275:FunctionDef_L2641_C0", "vector": [8, 1, 0.9992, 0.0004, 1, 0.78, 0.0, 987, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "qUnregisterResourceData", "arg_names": [], "import_names": [], "rhs_call_name": "qUnregisterResourceData", "annotation": ""}, "snippet": " QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99275:Expr_L2644_C0", "label": "qInitResources()", "type": "expression", "loc": [2644, 2644], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0004, 0, 0.66, 1.0, 797, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "qInitResources", "arg_names": [], "import_names": [], "rhs_call_name": "qInitResources", "annotation": ""}, "snippet": "qInitResources()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99275:FunctionDef_L2638_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99275:Expr_L2639_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99275:FunctionDef_L2641_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99275:Expr_L2642_C4"}] |
#! /usr/bin/python
import roslib; roslib.load_manifest('kelsey_sandbox')
import rospy
import roslib.message
import rosbag
import sys
import rosservice
from pr2_msgs.msg import AccelerometerState
import scipy.io
class AccelSaver:
def __init__(self):
self.data = []
self.first = True
def proc_acc(self, msg):
if len(msg.samples) > 0:
if self.first:
self.beg_time = msg.header.stamp.to_sec()
self.first = False
sum_x, sum_y, sum_z = 0, 0, 0
for sample in msg.samples:
sum_x += sample.x
sum_y += sample.y
sum_z += sample.z
self.data.append((msg.header.stamp.to_sec() - self.beg_time, sum_x / len(msg.samples), sum_y / len(msg.samples), sum_z / len(msg.samples)))
def main():
rospy.init_node('accel_save')
asave = AccelSaver()
rospy.Subscriber('/accelerometer/l_gripper_motor', AccelerometerState, asave.proc_acc)
print "Starting:"
rospy.spin()
mat_data = {}
mat_data['accel'] = asave.data
scipy.io.savemat('accel_data.mat', mat_data)
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99276 | 32 | 40 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.075, 0.025, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('kelsey_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.075, 0.025, 0, 0.66, 0.0909, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('kelsey_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.025, 0, 0.66, 0.1818, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L5_C0", "label": "roslib.message import roslib.message", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.025, 0, 0.66, 0.2727, 98, 0, 1, 0, 0, 98, 0, 0], "semantic": {"name": "roslib.message", "arg_names": [], "import_names": ["roslib.message"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L6_C0", "label": "rosbag import rosbag", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.025, 0, 0.66, 0.3636, 243, 0, 1, 0, 0, 243, 0, 0], "semantic": {"name": "rosbag", "arg_names": [], "import_names": ["rosbag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosbag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L7_C0", "label": "sys import sys", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.175, 0.025, 0, 0.66, 0.4545, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L8_C0", "label": "rosservice import rosservice", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.025, 0, 0.66, 0.5455, 924, 0, 1, 0, 0, 924, 0, 0], "semantic": {"name": "rosservice", "arg_names": [], "import_names": ["rosservice"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosservice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:ImportFrom_L9_C0", "label": "from pr2_msgs.msg import AccelerometerState", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.225, 0.025, 0, 0.66, 0.6364, 797, 0, 1, 0, 0, 797, 0, 0], "semantic": {"name": "pr2_msgs.msg", "arg_names": [], "import_names": ["AccelerometerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_msgs.msg import AccelerometerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Import_L10_C0", "label": "scipy.io import scipy.io", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.025, 0, 0.66, 0.7273, 670, 0, 1, 0, 0, 670, 0, 0], "semantic": {"name": "scipy.io", "arg_names": [], "import_names": ["scipy.io"], "rhs_call_name": "", "annotation": ""}, "snippet": "import scipy.io"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:ClassDef_L12_C0", "label": "AccelSaver", "type": "class", "loc": [12, 27], "level": 0, "parent": null, "vector": [3, 0, 0.4875, 0.4, 0, 0.66, 0.8182, 453, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "AccelSaver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AccelSaver:\n def __init__(self):\n self.data = []\n self.first = True\n\n def proc_acc(self, msg):\n if len(msg.samples) > 0:\n if self.first:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L13_C4", "label": "__init__", "type": "function", "loc": [13, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:ClassDef_L12_C0", "vector": [2, 1, 0.35, 0.075, 1, 0.15, 0.0, 555, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self.data = []\n self.first = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L14_C8", "label": "self.data =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L13_C4", "vector": [14, 2, 0.35, 0.025, 2, 0.01, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L15_C8", "label": "self.first =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L13_C4", "vector": [14, 2, 0.375, 0.025, 2, 0.01, 1.0, 968, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.first = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L17_C4", "label": "proc_acc", "type": "function", "loc": [17, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:ClassDef_L12_C0", "vector": [2, 1, 0.55, 0.275, 1, 0.15, 1.0, 214, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "proc_acc", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def proc_acc(self, msg):\n if len(msg.samples) > 0:\n if self.first:\n self.beg_time = msg.header.stamp.to_sec()\n self.first = False\n sum_x, sum_y, sum_z = 0, 0, 0\n for sample in msg.samples:\n sum_x += sample.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "label": "if", "type": "if", "loc": [18, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L17_C4", "vector": [4, 2, 0.5625, 0.25, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(msg.samples) > 0:\n if self.first:\n self.beg_time = msg.header.stamp.to_sec()\n self.first = False\n sum_x, sum_y, sum_z = 0, 0, 0\n for sample in msg.samples:\n sum_x += sample.x\n sum_y += sample.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L19_C12", "label": "if", "type": "if", "loc": [19, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "vector": [4, 3, 0.5, 0.075, 3, 0.36, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.first:\n self.beg_time = msg.header.stamp.to_sec()\n self.first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L20_C16", "label": "self.beg_time = to_sec()", "type": "assigned_variable", "loc": [20, 20], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L19_C12", "vector": [14, 4, 0.5, 0.025, 4, 0.15, 0.0, 907, 3, 0, 0, 0, 750, 10, 1], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.beg_time = msg.header.stamp.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L21_C16", "label": "self.first =", "type": "assigned_variable", "loc": [21, 21], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L19_C12", "vector": [14, 4, 0.525, 0.025, 4, 0.15, 1.0, 968, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L22_C12", "label": "sum_x, sum_y, sum_z =", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "vector": [14, 3, 0.55, 0.025, 3, 0.36, 0.3333, 870, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "sum_x, sum_y, sum_z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sum_x, sum_y, sum_z = 0, 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:For_L23_C12", "label": "for sample", "type": "for", "loc": [23, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "vector": [6, 3, 0.6125, 0.1, 3, 0.36, 0.6667, 513, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sample", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sample in msg.samples:\n sum_x += sample.x\n sum_y += sample.y\n sum_z += sample.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L27_C12", "label": "append()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "vector": [8, 3, 0.675, 0.025, 3, 0.36, 1.0, 243, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.data.append((msg.header.stamp.to_sec() - self.beg_time, sum_x / len(msg.samples), sum_y / len(msg.samples), sum_z / len(msg.samples)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "label": "main", "type": "function", "loc": [28, 36], "level": 0, "parent": null, "vector": [2, 0, 0.8, 0.225, 0, 0.66, 0.9091, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('accel_save')\n asave = AccelSaver()\n rospy.Subscriber('/accelerometer/l_gripper_motor', AccelerometerState, asave.proc_acc)\n print(\"Starting:\")\n rospy.spin()\n mat_data = {}\n mat_data['accel'] = asave.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L29_C4", "label": "init_node()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [8, 1, 0.725, 0.025, 1, 0.03, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('accel_save')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L30_C4", "label": "asave = AccelSaver()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [14, 1, 0.75, 0.025, 1, 0.03, 0.1429, 475, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "asave", "arg_names": [], "import_names": [], "rhs_call_name": "AccelSaver", "annotation": ""}, "snippet": " asave = AccelSaver()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L31_C4", "label": "Subscriber()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [8, 1, 0.775, 0.025, 1, 0.03, 0.2857, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/accelerometer/l_gripper_motor', AccelerometerState, asave.proc_acc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L32_C4", "label": "print()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [8, 1, 0.8, 0.025, 1, 0.03, 0.4286, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Starting:\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L33_C4", "label": "spin()", "type": "expression", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [8, 1, 0.825, 0.025, 1, 0.03, 0.5714, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L34_C4", "label": "mat_data =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [14, 1, 0.85, 0.025, 1, 0.03, 0.7143, 570, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "mat_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_data = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L35_C4", "label": "assign", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [14, 1, 0.875, 0.025, 1, 0.03, 0.8571, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mat_data['accel'] = asave.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L36_C4", "label": "savemat()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "vector": [8, 1, 0.9, 0.025, 1, 0.03, 1.0, 421, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "savemat", "arg_names": [], "import_names": [], "rhs_call_name": "savemat", "annotation": ""}, "snippet": " scipy.io.savemat('accel_data.mat', mat_data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L38_C0", "label": "if", "type": "if", "loc": [38, 39], "level": 0, "parent": null, "vector": [4, 0, 0.9625, 0.05, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L39_C4", "label": "main()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L38_C0", "vector": [8, 1, 0.975, 0.025, 1, 0.98, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99276:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L19_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L20_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L19_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L21_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:For_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:FunctionDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99276:If_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99276:Expr_L39_C4"}] |
#######################################################################
#
# USE pr2_object_manipulation/pr2_gripper_reactive_approach/controller_manager.py
# That code has much of the ideas at the bottom, with more.
#
#######################################################################
# TODO Update code to throw points one at a time. Sections are labled: "Hack"
import numpy as np, math
from threading import RLock, Timer
import sys
import roslib; roslib.load_manifest('hrl_pr2_lib')
roslib.load_manifest('force_torque') # hack by Advait
import force_torque.FTClient as ftc
import tf
import rospy
import actionlib
from actionlib_msgs.msg import GoalStatus
from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse
from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse
from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState
from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand
from trajectory_msgs.msg import JointTrajectoryPoint
from geometry_msgs.msg import PoseStamped
from teleop_controllers.msg import JTTeleopControllerState
from std_msgs.msg import Float64
from sensor_msgs.msg import JointState
import hrl_lib.transforms as tr
import time
import functools as ft
import tf.transformations as tftrans
import operator as op
import types
from visualization_msgs.msg import Marker
node_name = "pr2_arms"
def log(str):
rospy.loginfo(node_name + ": " + str)
##
# Convert arrays, lists, matricies to column format.
#
# @param x the unknown format
# @return a column matrix
def make_column(x):
if (type(x) == type([])
or (type(x) == np.ndarray and x.ndim == 1)
or type(x) == type(())):
return np.matrix(x).T
if type(x) == np.ndarray:
x = np.matrix(x)
if x.shape[0] == 1:
return x.T
return x
##
# Convert column matrix to list
#
# @param col the column matrix
# @return the list
def make_list(col):
if type(col) == type([]) or type(col) == type(()):
return col
return [col[i,0] for i in range(col.shape[0])]
##
# Class for simple management of the arms and grippers.
# Provides functionality for moving the arms, opening and closing
# the grippers, performing IK, and other functionality as it is
# developed.
class PR2Arms(object):
##
# Initializes all of the servers, clients, and variables
#
# @param send_delay send trajectory points send_delay nanoseconds into the future
# @param gripper_point given the frame of the wrist_roll_link, this point offsets
# the location used in FK and IK, preferably to the tip of the
# gripper
def __init__(self, send_delay=50000000, gripper_point=(0.23,0.0,0.0),
force_torque = False):
log("Loading PR2Arms")
self.send_delay = send_delay
self.off_point = gripper_point
self.joint_names_list = [['r_shoulder_pan_joint',
'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',
'r_elbow_flex_joint', 'r_forearm_roll_joint',
'r_wrist_flex_joint', 'r_wrist_roll_joint'],
['l_shoulder_pan_joint',
'l_shoulder_lift_joint', 'l_upper_arm_roll_joint',
'l_elbow_flex_joint', 'l_forearm_roll_joint',
'l_wrist_flex_joint', 'l_wrist_roll_joint']]
rospy.wait_for_service('pr2_right_arm_kinematics/get_fk');
self.fk_srv = [rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', GetPositionFK),
rospy.ServiceProxy('pr2_left_arm_kinematics/get_fk', GetPositionFK)]
rospy.wait_for_service('pr2_right_arm_kinematics/get_ik');
self.ik_srv = [rospy.ServiceProxy('pr2_right_arm_kinematics/get_ik', GetPositionIK),
rospy.ServiceProxy('pr2_left_arm_kinematics/get_ik', GetPositionIK)]
self.joint_action_client = [actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action', JointTrajectoryAction),
actionlib.SimpleActionClient('l_arm_controller/joint_trajectory_action', JointTrajectoryAction)]
self.gripper_action_client = [actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction),actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction)]
self.joint_action_client[0].wait_for_server()
self.joint_action_client[1].wait_for_server()
self.gripper_action_client[0].wait_for_server()
self.gripper_action_client[1].wait_for_server()
self.arm_state_lock = [RLock(), RLock()]
self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped)
self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped)
rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb)
rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb)
if force_torque:
self.r_arm_ftc = ftc.FTClient('force_torque_ft2')
self.tf_lstnr = tf.TransformListener()
self.arm_angles = [None, None]
self.arm_efforts = [None, None]
self.jtg = [None, None]
self.cur_traj = [None, None]
self.cur_traj_timer = [None, None]
self.cur_traj_pos = [None, None]
self.marker_pub = rospy.Publisher('/pr2_arms/viz_marker', Marker)
rospy.Subscriber('/joint_states', JointState,
self.joint_states_cb, queue_size=2)
rospy.sleep(1.)
log("Finished loading SimpleArmManger")
##
# Callback for /joint_states topic. Updates current joint
# angles and efforts for the arms constantly
#
# @param data JointState message recieved from the /joint_states topic
def joint_states_cb(self, data):
arm_angles = [[], []]
arm_efforts = [[], []]
r_jt_idx_list = [0]*7
l_jt_idx_list = [0]*7
for i, jt_nm in enumerate(self.joint_names_list[0]):
r_jt_idx_list[i] = data.name.index(jt_nm)
for i, jt_nm in enumerate(self.joint_names_list[1]):
l_jt_idx_list[i] = data.name.index(jt_nm)
for i in range(7):
idx = r_jt_idx_list[i]
if data.name[idx] != self.joint_names_list[0][i]:
raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))
ang = self.normalize_ang(data.position[idx])
arm_angles[0] += [ang]
arm_efforts[0] += [data.effort[idx]]
idx = l_jt_idx_list[i]
if data.name[idx] != self.joint_names_list[1][i]:
raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))
ang = self.normalize_ang(data.position[idx])
arm_angles[1] += [ang]
arm_efforts[1] += [data.effort[idx]]
self.arm_state_lock[0].acquire()
self.arm_angles[0] = arm_angles[0]
self.arm_efforts[0] = arm_efforts[0]
self.arm_state_lock[0].release()
self.arm_state_lock[1].acquire()
self.arm_angles[1] = arm_angles[1]
self.arm_efforts[1] = arm_efforts[1]
self.arm_state_lock[1].release()
def r_cart_state_cb(self, msg):
trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',
'r_gripper_tool_frame', rospy.Time(0))
rot = tr.quaternion_to_matrix(quat)
tip = np.matrix([0.12, 0., 0.]).T
self.r_ee_pos = rot*tip + np.matrix(trans).T
self.r_ee_rot = rot
marker = Marker()
marker.header.frame_id = 'torso_lift_link'
time_stamp = rospy.Time.now()
marker.header.stamp = time_stamp
marker.ns = 'aloha land'
marker.type = Marker.SPHERE
marker.action = Marker.ADD
marker.pose.position.x = self.r_ee_pos[0,0]
marker.pose.position.y = self.r_ee_pos[1,0]
marker.pose.position.z = self.r_ee_pos[2,0]
size = 0.02
marker.scale.x = size
marker.scale.y = size
marker.scale.z = size
marker.lifetime = rospy.Duration()
marker.id = 71
marker.pose.orientation.x = 0
marker.pose.orientation.y = 0
marker.pose.orientation.z = 0
marker.pose.orientation.w = 1
color = (0.5, 0., 0.0)
marker.color.r = color[0]
marker.color.g = color[1]
marker.color.b = color[2]
marker.color.a = 1.
self.marker_pub.publish(marker)
ros_pt = msg.x_desi_filtered.pose.position
x, y, z = ros_pt.x, ros_pt.y, ros_pt.z
self.r_cep_pos = np.matrix([x, y, z]).T
pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T)
pt = pt + tip
self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T
ros_quat = msg.x_desi_filtered.pose.orientation
quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)
self.r_cep_rot = tr.quaternion_to_matrix(quat)
def l_cart_state_cb(self, msg):
ros_pt = msg.x_desi_filtered.pose.position
self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T
ros_quat = msg.x_desi_filtered.pose.orientation
quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)
self.l_cep_rot = tr.quaternion_to_matrix(quat)
def normalize_ang(self, ang):
while ang >= 2 * np.pi:
ang -= 2 * np.pi
while ang < 0.:
ang += 2 * np.pi
return ang
##
# Create a joint configuration trajectory goal.
#
# @param arm 0 for right, 1 for left
# @param pos_arr list of lists of 7 joint angles in RADIANS.
# @param dur_arr list of how long (SECONDS) from the beginning of the trajectory
# before reaching the joint angles.
# @param stamp header (rospy.Duration) stamp to give the trajectory
# @param vel_arr list of lists of 7 joint velocities in RADIANS/sec.
# @param acc_arr list of lists of 7 joint accelerations in RADIANS/sec^2.
def create_JTG(self, arm, pos_arr, dur_arr, stamp=None, vel_arr=None, acc_arr=None):
# Hack
vel_arr = [[0.]*7]*len(pos_arr)
acc_arr = [[0.]*7]*len(pos_arr)
##
# Compute joint velocities and acclereations.
def get_vel_acc(q_arr, d_arr):
vel_arr = [[0.]*7]
acc_arr = [[0.]*7]
for i in range(1, len(q_arr)):
vel, acc = [], []
for j in range(7):
vel += [(q_arr[i][j] - q_arr[i-1][j]) / d_arr[i]]
acc += [(vel[j] - vel_arr[i-1][j]) / d_arr[i]]
vel_arr += [vel]
acc_arr += [acc]
print vel, acc
return vel_arr, acc_arr
if arm != 1:
arm = 0
jtg = JointTrajectoryGoal()
if stamp is None:
stamp = rospy.Time.now()
else:
jtg.trajectory.header.stamp = stamp
if len(pos_arr) > 1 and (vel_arr is None or acc_arr is None):
v_arr, a_arr = get_vel_acc(pos_arr, dur_arr)
if vel_arr is None:
vel_arr = v_arr
if acc_arr is None:
acc_arr = a_arr
jtg.trajectory.joint_names = self.joint_names_list[arm]
for i in range(len(pos_arr)):
if pos_arr[i] is None or type(pos_arr[i]) is types.NoneType:
continue
jtp = JointTrajectoryPoint()
jtp.positions = pos_arr[i]
if vel_arr is None:
vel = [0.] * 7
else:
vel = vel_arr[i]
jtp.velocities = vel
if acc_arr is None:
acc = [0.] * 7
else:
acc = acc_arr[i]
jtp.accelerations = acc
jtp.time_from_start = rospy.Duration(dur_arr[i])
jtg.trajectory.points.append(jtp)
return jtg
##
# Executes a joint trajectory goal. This is the only function through which
# arm motion is performed.
#
# @param arm 0 for right, 1 for left
# @param jtg the joint trajectory goal to execute
def execute_trajectory(self, arm, jtg):
if self.cur_traj[arm] is not None or self.cur_traj_timer[arm] is not None:
log("Arm is currently executing trajectory")
if rospy.is_shutdown():
sys.exit()
return
print "Yo 2"
# Hack
# self.cur_traj[arm] = jtg
self.cur_traj_pos[arm] = 0
# if too far in past, shift forward the time the trajectory starts
min_init_time = rospy.Time.now().to_sec() + 2 * self.send_delay
if jtg.trajectory.header.stamp.to_nsec() < min_init_time:
jtg.trajectory.header.stamp = rospy.Time(rospy.Time.now().to_sec(),
2 * self.send_delay)
print "dfsdfsfd", jtg
jtg.trajectory.header.stamp = rospy.Time.now()
self.joint_action_client[arm].send_goal(jtg) # Hack
return
# setup first point throw
call_time = ((jtg.trajectory.header.stamp.to_nsec() - self.send_delay -
rospy.Time.now().to_nsec()) / 1000000000.)
self.cur_traj_timer[arm] = Timer(call_time, self._exec_traj, [arm])
self.cur_traj_timer[arm].start()
##
# Callback for periodic joint trajectory point throwing
def _exec_traj(self, arm):
jtg = self.cur_traj[arm]
i = self.cur_traj_pos[arm]
beg_time = jtg.trajectory.header.stamp.to_nsec()
# time to execute current point
cur_exec_time = rospy.Time(jtg.trajectory.header.stamp.to_sec() +
jtg.trajectory.points[i].time_from_start.to_sec())
# create a one point joint trajectory and send it
if i == 0:
last_time_from = 0
else:
last_time_from = jtg.trajectory.points[i-1].time_from_start.to_sec()
cur_dur = jtg.trajectory.points[i].time_from_start.to_sec() - last_time_from
cur_jtg = self.create_JTG(arm, [jtg.trajectory.points[i].positions],
[cur_dur],
cur_exec_time,
[jtg.trajectory.points[i].velocities],
[jtg.trajectory.points[i].accelerations])
# send trajectory goal to node
print "cur_jtg", cur_jtg
self.joint_action_client[arm].send_goal(cur_jtg)
self.cur_traj_pos[arm] += 1
if self.cur_traj_pos[arm] == len(jtg.trajectory.points):
# end trajectory
self.cur_traj[arm] = None
self.cur_traj_timer[arm] = None
else:
# setup next point throw
next_exec_time = beg_time + jtg.trajectory.points[i+1].time_from_start.to_nsec()
print "diff times", next_exec_time / 1000000000. - cur_exec_time.to_sec() - cur_dur
call_time = ((next_exec_time - self.send_delay -
rospy.Time.now().to_nsec()) / 1000000000.)
self.cur_traj_timer[arm] = Timer(call_time, self._exec_traj, [arm])
self.cur_traj_timer[arm].start()
##
# Stop the current arm trajectory.
#
# @param arm 0 for right, 1 for left
def stop_trajectory(self, arm):
self.cur_traj_timer[arm].cancel()
self.cur_traj[arm] = None
self.cur_traj_timer[arm] = None
##
# Move the arm to a joint configuration.
#
# @param arm 0 for right, 1 for left
# @param q list of 7 joint angles in RADIANS.
# @param start_time time (in secs) from function call to start action
# @param duration how long (SECONDS) before reaching the joint angles.
def set_joint_angles(self, arm, q, duration=1., start_time=0.):
self.set_joint_angles_traj(arm, [q], [duration], start_time)
##
# Move the arm through a joint configuration trajectory goal.
#
# @param arm 0 for right, 1 for left
# @param q_arr list of lists of 7 joint angles in RADIANS.
# @param dur_arr list of how long (SECONDS) from the beginning of the trajectory
# before reaching the joint angles.
# @param start_time time (in secs) from function call to start action
def set_joint_angles_traj(self, arm, q_arr, dur_arr, start_time=0.):
if arm != 1:
arm = 0
jtg = self.create_JTG(arm, q_arr, dur_arr)
cur_time = rospy.Time.now().to_sec() + 2 * self.send_delay / 1000000000.
jtg.trajectory.header.stamp = rospy.Duration(start_time + cur_time)
self.execute_trajectory(arm, jtg)
##
# Is the arm currently moving?
#
# @param arm 0 for right, 1 for left
# @return True if moving, else False
def is_arm_in_motion(self, arm):
# Hack
# if self.cur_traj[arm] is not None:
# return True
state = self.joint_action_client[arm].get_state()
return state == GoalStatus.PENDING or state == GoalStatus.ACTIVE
##
# Block until the arm has finished moving
#
# @param arm 0 for right, 1 for left
# @param hz how often to check
def wait_for_arm_completion(self, arm, hz=0.01):
while self.is_arm_in_motion(arm) and not rospy.is_shutdown():
rospy.sleep(hz)
##
# Transforms the given position by the offset position in the given quaternion
# rotation frame
#
# @param pos the current positions
# @param quat quaternion representing the rotation of the frame
# @param off_point offset to move the position inside the quat's frame
# @return the new position as a matrix column
def transform_in_frame(self, pos, quat, off_point):
pos = make_column(pos)
quat = make_list(quat)
invquatmat = np.mat(tftrans.quaternion_matrix(quat))
invquatmat[0:3,3] = pos
trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T
transpos = invquatmat * trans
return np.resize(transpos, (3, 1))
##
# Performs Forward Kinematics on the given joint angles
#
# @param arm 0 for right, 1 for left
# @param q list of 7 joint angles in radians
# @return column matrix of cartesian position, column matrix of quaternion
def FK(self, arm, q):
if rospy.is_shutdown():
sys.exit()
if arm != 1:
arm = 0
fk_req = GetPositionFKRequest()
fk_req.header.frame_id = 'torso_lift_link'
if arm == 0:
fk_req.fk_link_names.append('r_wrist_roll_link')
else:
fk_req.fk_link_names.append('l_wrist_roll_link')
fk_req.robot_state.joint_state.name = self.joint_names_list[arm]
fk_req.robot_state.joint_state.position = q
fk_resp = GetPositionFKResponse()
fk_resp = self.fk_srv[arm].call(fk_req)
if fk_resp.error_code.val == fk_resp.error_code.SUCCESS:
x = fk_resp.pose_stamped[0].pose.position.x
y = fk_resp.pose_stamped[0].pose.position.y
z = fk_resp.pose_stamped[0].pose.position.z
q1 = fk_resp.pose_stamped[0].pose.orientation.x
q2 = fk_resp.pose_stamped[0].pose.orientation.y
q3 = fk_resp.pose_stamped[0].pose.orientation.z
q4 = fk_resp.pose_stamped[0].pose.orientation.w
quat = [q1,q2,q3,q4]
# Transform point from wrist roll link to actuator
ret1 = self.transform_in_frame([x,y,z], quat, self.off_point)
ret2 = np.matrix(quat).T
else:
rospy.logerr('Forward kinematics failed')
ret1, ret2 = None, None
return ret1, ret2
##
# Performs Inverse Kinematics on the given position and rotation
#
# @param arm 0 for right, 1 for left
# @param p cartesian position in torso_lift_link frame
# @param rot quaternion rotation column or rotation matrix
# of wrist in torso_lift_link frame
# @param q_guess initial joint angles to use for finding IK
def IK(self, arm, p, rot, q_guess):
if arm != 1:
arm = 0
p = make_column(p)
if rot.shape == (3, 3):
quat = np.matrix(tr.matrix_to_quaternion(rot)).T
elif rot.shape == (4, 1):
quat = make_column(rot)
else:
rospy.logerr('Inverse kinematics failed (bad rotation)')
return None
# Transform point back to wrist roll link
neg_off = [-self.off_point[0],-self.off_point[1],-self.off_point[2]]
transpos = self.transform_in_frame(p, quat, neg_off)
ik_req = GetPositionIKRequest()
ik_req.timeout = rospy.Duration(5.)
if arm == 0:
ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'
else:
ik_req.ik_request.ik_link_name = 'l_wrist_roll_link'
ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link'
ik_req.ik_request.pose_stamped.pose.position.x = transpos[0]
ik_req.ik_request.pose_stamped.pose.position.y = transpos[1]
ik_req.ik_request.pose_stamped.pose.position.z = transpos[2]
ik_req.ik_request.pose_stamped.pose.orientation.x = quat[0]
ik_req.ik_request.pose_stamped.pose.orientation.y = quat[1]
ik_req.ik_request.pose_stamped.pose.orientation.z = quat[2]
ik_req.ik_request.pose_stamped.pose.orientation.w = quat[3]
ik_req.ik_request.ik_seed_state.joint_state.position = q_guess
ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list[arm]
ik_resp = self.ik_srv[arm].call(ik_req)
if ik_resp.error_code.val == ik_resp.error_code.SUCCESS:
ret = list(ik_resp.solution.joint_state.position)
else:
rospy.logerr('Inverse kinematics failed')
ret = None
return ret
##
# Evaluates IK for the given position and rotation to see if the arm could move
# @param arm 0 for right, 1 for left
# @param p cartesian position in torso_lift_link frame
# @param rot quaternion rotation column or rotation matrix
# of wrist in torso_lift_link frame
def can_move_arm(self, arm, pos, rot):
begq = self.get_joint_angles(arm)
endq = self.IK(arm, pos, rot, begq)
if endq is None:
return False
else:
return True
##
# Moves the arm to the given position and rotation
#
# @param arm 0 for right, 1 for left
# @param pos cartesian position of end effector
# @param rot quaterninon or rotation matrix of the end effector
# @param dur length of time to do the motion in
def move_arm(self, arm, pos, begq=None , rot=None, dur=4.0):
if begq is None:
begq = self.get_joint_angles(arm)
if rot is None:
temp, rot = self.FK(arm, begq)
endq = self.IK(arm, pos, rot, begq)
if endq is None:
return False
self.set_joint_angles(arm, endq, dur)
return True
def cancel_trajectory(self, arm):
self.joint_action_client[arm].cancel_all_goals()
##
# Move the arm through a trajectory defined by a series of positions and rotations
#
# @param arm 0 for right, 1 for left
# @param pos_arr list of positions to achieve during trajectory
# @param dur length of time to execute all trajectories in, all positions will
# be given the same amount of time to reach the next point
# (ignore if dur_arr is not None)
# @param rot_arr achieve these rotations along with those positions
# if None, maintain original rotation
# @param dur_arr use these times for the time positions
# @param freeze_wrist if True, keeps the rotation of the wrist constant
def move_arm_trajectory(self, arm, pos_arr, dur=1.,
rot_arr=None, dur_arr=None, freeze_wrist=False):
if dur_arr is None:
dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]
initq = self.get_joint_angles(arm)
curq = initq
q_arr = []
fails, trys = 0, 0
if rot_arr is None:
temp, rot = self.FK(arm, curq)
for i in range(len(pos_arr)):
if rot_arr is None:
cur_rot = rot
else:
cur_rot = rot_arr[i]
nextq = self.IK(arm, pos_arr[i], cur_rot, curq)
q_arr += [nextq]
if nextq is None:
fails += 1
trys += 1
if not nextq is None:
curq = nextq
log("IK Accuracy: %d/%d (%f)" % (trys-fails, trys, (trys-fails)/float(trys)))
if freeze_wrist:
for i in range(len(q_arr)):
if not q_arr[i] is None:
q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],
q_arr[i][4], q_arr[i][5], initq[6])
self.set_joint_angles_traj(arm, q_arr, dur_arr)
##
# Returns the current position, rotation of the arm.
#
# @param arm 0 for right, 1 for left
# @return rotation, position
def end_effector_pos(self, arm):
q = self.get_joint_angles(arm)
return self.FK(arm, q)
##
# Returns the list of 7 joint angles
#
# @param arm 0 for right, 1 for left
# @return list of 7 joint angles
def get_joint_angles(self, arm):
if arm != 1:
arm = 0
self.arm_state_lock[arm].acquire()
q = self.arm_angles[arm]
self.arm_state_lock[arm].release()
return q
# force that is being applied on the wrist.
def get_wrist_force(self, arm, bias = True, base_frame = False):
if arm != 0:
rospy.logerr('Unsupported arm: %d'%arm)
raise RuntimeError('Unimplemented function')
f = self.r_arm_ftc.read(without_bias = not bias)
f = f[0:3, :]
if base_frame:
trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',
'/ft2', rospy.Time(0))
rot = tr.quaternion_to_matrix(quat)
f = rot * f
return -f # the negative is intentional (Advait, Nov 24. 2010.)
def bias_wrist_ft(self, arm):
if arm != 0:
rospy.logerr('Unsupported arm: %d'%arm)
raise RuntimeError('Unimplemented function')
self.r_arm_ftc.bias()
def get_ee_jtt(self, arm):
if arm == 0:
return self.r_ee_pos, self.r_ee_rot
else:
return self.l_ee_pos, self.l_ee_rot
def get_cep_jtt(self, arm, hook_tip = False):
if arm == 0:
if hook_tip:
return self.r_cep_pos_hooktip, self.r_cep_rot
else:
return self.r_cep_pos, self.r_cep_rot
else:
return self.l_cep_pos, self.l_cep_rot
# set a cep using the Jacobian Transpose controller.
def set_cep_jtt(self, arm, p, rot=None):
if arm != 1:
arm = 0
ps = PoseStamped()
ps.header.stamp = rospy.rostime.get_rostime()
ps.header.frame_id = 'torso_lift_link'
ps.pose.position.x = p[0,0]
ps.pose.position.y = p[1,0]
ps.pose.position.z = p[2,0]
if rot == None:
if arm == 0:
rot = self.r_cep_rot
else:
rot = self.l_cep_rot
quat = tr.matrix_to_quaternion(rot)
ps.pose.orientation.x = quat[0]
ps.pose.orientation.y = quat[1]
ps.pose.orientation.z = quat[2]
ps.pose.orientation.w = quat[3]
if arm == 0:
self.r_arm_cart_pub.publish(ps)
else:
self.l_arm_cart_pub.publish(ps)
# rotational interpolation unimplemented.
def go_cep_jtt(self, arm, p):
step_size = 0.01
sleep_time = 0.1
cep_p, cep_rot = self.get_cep_jtt(arm)
unit_vec = (p-cep_p)
unit_vec = unit_vec / np.linalg.norm(unit_vec)
while np.linalg.norm(p-cep_p) > step_size:
cep_p += unit_vec * step_size
self.set_cep_jtt(arm, cep_p)
rospy.sleep(sleep_time)
self.set_cep_jtt(arm, p)
rospy.sleep(sleep_time)
# TODO Evaluate gripper functions and parameters
##
# Move the gripper the given amount with given amount of effort
#
# @param arm 0 for right, 1 for left
# @param amount the amount the gripper should be opened
# @param effort - supposed to be in Newtons. (-ve number => max effort)
def move_gripper(self, arm, amount=0.08, effort = 15):
self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort)))
##
# Open the gripper
#
# @param arm 0 for right, 1 for left
def open_gripper(self, arm):
self.move_gripper(arm, 0.08, -1)
##
# Close the gripper
#
# @param arm 0 for right, 1 for left
def close_gripper(self, arm, effort = 15):
self.move_gripper(arm, 0.0, effort)
# def get_wrist_force(self, arm):
# pass
######################################################
# More specific functionality
######################################################
##
# Moves arm smoothly through a linear trajectory.
#
# @param arm
def smooth_linear_arm_trajectory(self, arm, dist, dir=(0.,0.,-1.), max_jerk=0.25,
delta=0.005, dur=None,
freeze_wrist=True, is_grasp_biased=True):
####################################################
# Smooth trajectory functions
def _smooth_traj_pos(t, k, T):
return -k / T**3 * np.sin(T * t) + k / T**2 * t
def _smooth_traj_vel(t, k, T):
return -k / T**2 * np.cos(T * t) + k / T**2
def _smooth_traj_acc(t, k, T):
return k / T * np.sin(T * t)
# length of time of the trajectory
def _smooth_traj_time(l, k):
return np.power(4 * np.pi**2 * l / k, 1./3.)
def _interpolate_traj(traj, k, T, num=10, begt=0., endt=1.):
return [traj(t,k,T) for t in np.linspace(begt, endt, num)]
####################################################
# Vector representing full transform of end effector
traj_vec = [x/np.sqrt(np.vdot(dir,dir)) for x in dir]
# number of steps to interpolate trajectory over
num_steps = dist / delta
# period of the trajectory
trajt = _smooth_traj_time(dist, max_jerk)
period = 2. * np.pi / trajt
# break the trajectory into interpolated parameterized function
# from 0 to length of the trajectory
traj_pos_mult = _interpolate_traj(_smooth_traj_pos, max_jerk, period,
num_steps, 0., trajt)
# traj_vel_mult = _interpolate_traj(_smooth_traj_vel, max_jerk, period,
# num_steps, 0., trajt)
# traj_acc_mult = _interpolate_traj(_smooth_traj_acc, max_jerk, period,
# num_steps, 0., trajt)
# cartesian offset points of trajectory
cart_pos_traj = [(a*traj_vec[0],a*traj_vec[1],a*traj_vec[2]) for a in traj_pos_mult]
# cart_vel_traj = [(a*traj_vec[0],a*traj_vec[1],a*traj_vec[2]) for a in traj_vel_mult]
# cart_acc_traj = [(a*traj_vec[0],a*traj_vec[1],a*traj_vec[2]) for a in traj_acc_mult]
cur_pos, cur_rot = self.FK(arm, self.get_joint_angles(arm))
# get actual positions of the arm by transforming the offsets
arm_traj = [(ct[0] + cur_pos[0], ct[1] + cur_pos[1],
ct[2] + cur_pos[2]) for ct in cart_pos_traj]
if dur is None:
dur = trajt
if is_grasp_biased:
self.grasp_biased_move_arm_trajectory(arm, arm_traj, dur,
freeze_wrist=freeze_wrist)
else:
self.move_arm_trajectory(arm, arm_traj, dur, freeze_wrist=freeze_wrist)
# return the expected time of the trajectory
return dur
def bias_guess(self, q, joints_bias, bias_radius):
if bias_radius == 0.0:
return q
max_angs = np.array([.69, 1.33, 0.79, 0.0, 1000000.0, 0.0, 1000000.0])
min_angs = np.array([-2.27, -.54, -3.9, -2.34, -1000000.0, -2.15, -1000000.0])
q_off = bias_radius * np.array(joints_bias) / np.linalg.norm(joints_bias)
angs = np.array(q) + q_off
for i in range(7):
if angs[i] > max_angs[i]:
angs[i] = max_angs[i]
elif angs[i] < min_angs[i]:
angs[i] = min_angs[i]
return angs.tolist()
##
# Same as move_arm but tries to keep the elbow up.
def grasp_biased_IK(self, arm, pos, rot, q_guess, joints_bias=[0.]*7, bias_radius=0., num_iters=5):
angs = q_guess
for i in range(num_iters):
angs = self.IK(arm, pos, rot, angs)
angs = self.bias_guess(angs, joints_bias, bias_radius)
return self.IK(arm, pos, rot, angs)
##
# Same as move_arm but tries to keep the elbow up.
def grasp_biased_move_arm(self, arm, pos, rot=None, dur=4.0, num_iters=20):
if rot is None:
temp, rot = self.FK(arm, begq)
angs = self.get_joint_angles(arm)
angs = self.grasp_biased_IK(arm, pos, rot, angs)
self.set_joint_angles(arm, angs, dur)
##
# Move the arm through a trajectory defined by a series of positions and rotations
#
# @param arm 0 for right, 1 for left
# @param pos_arr list of positions to achieve during trajectory
# @param dur length of time to execute all trajectories in, all positions will
# be given the same amount of time to reach the next point
# (ignore if dur_arr is not None)
# @param rot_arr achieve these rotations along with those positions
# if None, maintain original rotation
# @param dur_arr use these times for the time positions
# @param freeze_wrist if True, keeps the rotation of the wrist constant
def grasp_biased_move_arm_trajectory(self, arm, pos_arr, dur=1.,
rot_arr=None, dur_arr=None, freeze_wrist=False):
bias_vec = np.array([0., -1., -1., 0., 0., 1., 0.])
q_radius = 0.012 # Calculated as q_radius = arctan( delta / wrist_flex_length )
q_off = q_radius * bias_vec / np.linalg.norm(bias_vec)
if dur_arr is None:
dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]
initq = self.get_joint_angles(arm)
curq = initq
q_arr = []
fails, trys = 0, 0
if rot_arr is None:
temp, rot = self.FK(arm, curq)
for i in range(len(pos_arr)):
if rot_arr is None:
cur_rot = rot
else:
cur_rot = rot_arr[i]
q_guess = (np.array(curq) + q_off).tolist()
nextq = self.IK(arm, pos_arr[i], cur_rot, q_guess)
q_arr += [nextq]
if nextq is None:
fails += 1
trys += 1
if not nextq is None:
curq = nextq
log("IK Accuracy: %d/%d (%f)" % (trys-fails, trys, (trys-fails)/float(trys)))
if freeze_wrist:
for i in range(len(q_arr)):
if not q_arr[i] is None:
q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],
q_arr[i][4], q_arr[i][5], initq[6])
self.set_joint_angles_traj(arm, q_arr, dur_arr)
if __name__ == '__main__':
rospy.init_node(node_name, anonymous = True)
log("Node initialized")
pr2_arm = PR2Arms()
if False:
q = [0, 0, 0, 0, 0, 0, 0]
pr2_arm.set_jointangles('right_arm', q)
ee_pos = simparm.FK('right_arm', q)
log('FK result:' + ee_pos.A1)
ee_pos[0,0] -= 0.1
q_ik = pr2_arm.IK('right_arm', ee_pos, tr.Rx(0.), q)
log('q_ik:' + [math.degrees(a) for a in q_ik])
rospy.spin()
if False:
p = np.matrix([0.9, -0.3, -0.15]).T
#rot = tr.Rx(0.)
rot = tr.Rx(math.radians(90.))
pr2_arm.set_cartesian('right_arm', p, rot)
# #------ testing gripper opening and closing ---------
# raw_input('Hit ENTER to begin')
# pr2_arm.open_gripper(0)
# raw_input('Hit ENTER to close')
# pr2_arm.close_gripper(0, effort = 15)
# #------- testing set JEP ---------------
# raw_input('Hit ENTER to begin')
r_arm, l_arm = 0, 1
# cep_p, cep_rot = pr2_arm.get_cep_jtt(r_arm)
# print 'cep_p:', cep_p.A1
#
# for i in range(5):
# cep_p[0,0] += 0.01
# raw_input('Hit ENTER to move')
# pr2_arm.set_cep_jtt(r_arm, cep_p)
raw_input('Hit ENTER to move')
p1 = np.matrix([0.91, -0.22, -0.05]).T
pr2_arm.go_cep_jtt(r_arm, p1)
#rospy.sleep(10)
#pr2_arm.close_gripper(r_arm, effort = -1)
raw_input('Hit ENTER to move')
p2 = np.matrix([0.70, -0.22, -0.05]).T
pr2_arm.go_cep_jtt(r_arm, p2)
| ajibawa-2023/Python-Code-Large/train/row_99277 | 527 | 992 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L15_C0", "label": "numpy import np, math", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0151, 0.001, 0, 0.66, 0.0, 954, 0, 2, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np", "math"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np, math"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L16_C0", "label": "from threading import RLock, Timer", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.001, 0, 0.66, 0.0312, 83, 0, 2, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["RLock", "Timer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import RLock, Timer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0171, 0.001, 0, 0.66, 0.0625, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L19_C0", "label": "roslib import roslib", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0192, 0.001, 0, 0.66, 0.0938, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L19_C15", "label": "load_manifest()", "type": "expression", "loc": [19, 19], "level": 0, "parent": null, "vector": [8, 0, 0.0192, 0.001, 0, 0.66, 0.125, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('hrl_pr2_lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L20_C0", "label": "load_manifest()", "type": "expression", "loc": [20, 20], "level": 0, "parent": null, "vector": [8, 0, 0.0202, 0.001, 0, 0.66, 0.1562, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('force_torque') # hack by Advait"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L21_C0", "label": "force_torque.FTClient import ftc", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0212, 0.001, 0, 0.66, 0.1875, 823, 0, 1, 0, 0, 823, 0, 0], "semantic": {"name": "force_torque.FTClient", "arg_names": [], "import_names": ["ftc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import force_torque.FTClient as ftc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L22_C0", "label": "tf import tf", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0222, 0.001, 0, 0.66, 0.2188, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L24_C0", "label": "rospy import rospy", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0242, 0.001, 0, 0.66, 0.25, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L26_C0", "label": "actionlib import actionlib", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0262, 0.001, 0, 0.66, 0.2812, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L27_C0", "label": "from actionlib_msgs.msg import GoalStatus", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0272, 0.001, 0, 0.66, 0.3125, 245, 0, 1, 0, 0, 245, 0, 0], "semantic": {"name": "actionlib_msgs.msg", "arg_names": [], "import_names": ["GoalStatus"], "rhs_call_name": "", "annotation": ""}, "snippet": "from actionlib_msgs.msg import GoalStatus"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L29_C0", "label": "from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse", "type": "import", "loc": [29, 29], "level": 0, "parent": null, "vector": [1, 0, 0.0292, 0.001, 0, 0.66, 0.3438, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionFK", "GetPositionFKRequest", "GetPositionFKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionFK, GetPositionFKRequest, GetPositionFKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L30_C0", "label": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse", "type": "import", "loc": [30, 30], "level": 0, "parent": null, "vector": [1, 0, 0.0302, 0.001, 0, 0.66, 0.375, 247, 0, 3, 0, 0, 247, 0, 0], "semantic": {"name": "kinematics_msgs.srv", "arg_names": [], "import_names": ["GetPositionIK", "GetPositionIKRequest", "GetPositionIKResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kinematics_msgs.srv import GetPositionIK, GetPositionIKRequest, GetPositionIKResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L31_C0", "label": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.0312, 0.001, 0, 0.66, 0.4062, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryAction", "JointTrajectoryGoal", "JointTrajectoryControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import JointTrajectoryAction, JointTrajectoryGoal, JointTrajectoryControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L32_C0", "label": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.0323, 0.001, 0, 0.66, 0.4375, 457, 0, 3, 0, 0, 457, 0, 0], "semantic": {"name": "pr2_controllers_msgs.msg", "arg_names": [], "import_names": ["Pr2GripperCommandGoal", "Pr2GripperCommandAction", "Pr2GripperCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pr2_controllers_msgs.msg import Pr2GripperCommandGoal, Pr2GripperCommandAction, Pr2GripperCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L33_C0", "label": "from trajectory_msgs.msg import JointTrajectoryPoint", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.001, 0, 0.66, 0.4688, 485, 0, 1, 0, 0, 485, 0, 0], "semantic": {"name": "trajectory_msgs.msg", "arg_names": [], "import_names": ["JointTrajectoryPoint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from trajectory_msgs.msg import JointTrajectoryPoint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L34_C0", "label": "from geometry_msgs.msg import PoseStamped", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.0343, 0.001, 0, 0.66, 0.5, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["PoseStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L36_C0", "label": "from teleop_controllers.msg import JTTeleopControllerState", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0363, 0.001, 0, 0.66, 0.5312, 185, 0, 1, 0, 0, 185, 0, 0], "semantic": {"name": "teleop_controllers.msg", "arg_names": [], "import_names": ["JTTeleopControllerState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from teleop_controllers.msg import JTTeleopControllerState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L38_C0", "label": "from std_msgs.msg import Float64", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0383, 0.001, 0, 0.66, 0.5625, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["Float64"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import Float64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L39_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0393, 0.001, 0, 0.66, 0.5938, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L41_C0", "label": "hrl_lib.transforms import tr", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.001, 0, 0.66, 0.625, 82, 0, 1, 0, 0, 82, 0, 0], "semantic": {"name": "hrl_lib.transforms", "arg_names": [], "import_names": ["tr"], "rhs_call_name": "", "annotation": ""}, "snippet": "import hrl_lib.transforms as tr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L42_C0", "label": "time import time", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0423, 0.001, 0, 0.66, 0.6562, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L43_C0", "label": "functools import ft", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0433, 0.001, 0, 0.66, 0.6875, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["ft"], "rhs_call_name": "", "annotation": ""}, "snippet": "import functools as ft"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L45_C0", "label": "tf.transformations import tftrans", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.0454, 0.001, 0, 0.66, 0.7188, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tftrans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tftrans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L46_C0", "label": "operator import op", "type": "import", "loc": [46, 46], "level": 0, "parent": null, "vector": [1, 0, 0.0464, 0.001, 0, 0.66, 0.75, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": ["op"], "rhs_call_name": "", "annotation": ""}, "snippet": "import operator as op"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Import_L47_C0", "label": "types import types", "type": "import", "loc": [47, 47], "level": 0, "parent": null, "vector": [1, 0, 0.0474, 0.001, 0, 0.66, 0.7812, 209, 0, 1, 0, 0, 209, 0, 0], "semantic": {"name": "types", "arg_names": [], "import_names": ["types"], "rhs_call_name": "", "annotation": ""}, "snippet": "import types"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ImportFrom_L49_C0", "label": "from visualization_msgs.msg import Marker", "type": "import", "loc": [49, 49], "level": 0, "parent": null, "vector": [1, 0, 0.0494, 0.001, 0, 0.66, 0.8125, 124, 0, 1, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L52_C0", "label": "node_name =", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.0524, 0.001, 0, 0.66, 0.8438, 516, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "node_name = \"pr2_arms\" "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L54_C0", "label": "log", "type": "function", "loc": [54, 55], "level": 0, "parent": null, "vector": [2, 0, 0.0549, 0.002, 0, 0.66, 0.875, 432, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": ["str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def log(str):\n rospy.loginfo(node_name + \": \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L55_C4", "label": "loginfo()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L54_C0", "vector": [8, 1, 0.0554, 0.001, 1, 0.29, 0.0, 607, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "loginfo", "arg_names": [], "import_names": [], "rhs_call_name": "loginfo", "annotation": ""}, "snippet": " rospy.loginfo(node_name + \": \" + str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "label": "make_column", "type": "function", "loc": [62, 71], "level": 0, "parent": null, "vector": [2, 0, 0.067, 0.0101, 0, 0.66, 0.9062, 304, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "make_column", "arg_names": ["x"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_column(x):\n if (type(x) == type([]) \n or (type(x) == np.ndarray and x.ndim == 1)\n or type(x) == type(())):\n return np.matrix(x).T\n if type(x) == np.ndarray:\n x = np.matrix(x)\n if x.shape[0] == 1:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L63_C4", "label": "if", "type": "if", "loc": [63, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "vector": [4, 1, 0.065, 0.004, 1, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (type(x) == type([]) \n or (type(x) == np.ndarray and x.ndim == 1)\n or type(x) == type(())):\n return np.matrix(x).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L63_C4", "vector": [13, 2, 0.0665, 0.001, 2, 0.46, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.matrix(x).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L67_C4", "label": "if", "type": "if", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "vector": [4, 1, 0.068, 0.002, 1, 0.93, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(x) == np.ndarray:\n x = np.matrix(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L68_C8", "label": "x = matrix()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L67_C4", "vector": [14, 2, 0.0685, 0.001, 2, 0.38, 0.0, 190, 3, 1, 0, 0, 162, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "matrix", "annotation": ""}, "snippet": " x = np.matrix(x)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L69_C4", "label": "if", "type": "if", "loc": [69, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "vector": [4, 1, 0.0701, 0.002, 1, 0.93, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if x.shape[0] == 1:\n return x.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L69_C4", "vector": [13, 2, 0.0706, 0.001, 2, 0.55, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x.T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L71_C4", "label": "return", "type": "return", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "vector": [13, 1, 0.0716, 0.001, 1, 0.93, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L78_C0", "label": "make_list", "type": "function", "loc": [78, 81], "level": 0, "parent": null, "vector": [2, 0, 0.0801, 0.004, 0, 0.66, 0.9375, 937, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "make_list", "arg_names": ["col"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_list(col):\n if type(col) == type([]) or type(col) == type(()):\n return col\n return [col[i,0] for i in range(col.shape[0])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L79_C4", "label": "if", "type": "if", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L78_C0", "vector": [4, 1, 0.0801, 0.002, 1, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type(col) == type([]) or type(col) == type(()):\n return col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L80_C8", "label": "return", "type": "return", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L79_C4", "vector": [13, 2, 0.0806, 0.001, 2, 0.17, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L81_C4", "label": "return", "type": "return", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L78_C0", "vector": [13, 1, 0.0817, 0.001, 1, 0.32, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [col[i,0] for i in range(col.shape[0])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "label": "PR2Arms", "type": "class", "loc": [88, 933], "level": 0, "parent": null, "vector": [3, 0, 0.5146, 0.8528, 0, 0.66, 0.9688, 694, 0, 42, 0, 0, 186, 0, 99], "semantic": {"name": "PR2Arms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PR2Arms(object):\n\n ##\n # Initializes all of the servers, clients, and variables\n #\n # @param send_delay send trajectory points send_delay nanoseconds into the future\n # @param gripper_point given the frame of the wrist_roll_link, this point offsets\n # the location used in FK and IK, preferably to the tip of the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "label": "__init__", "type": "function", "loc": [97, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.1265, 0.0585, 1, 0.17, 0.0, 555, 0, 4, 0, 0, 0, 0, 27], "semantic": {"name": "__init__", "arg_names": ["self", "send_delay", "gripper_point", "force_torque"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, send_delay=50000000, gripper_point=(0.23,0.0,0.0),\n force_torque = False):\n log(\"Loading PR2Arms\")\n\n self.send_delay = send_delay\n self.off_point = gripper_point\n self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L99_C8", "label": "log()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.0998, 0.001, 2, 0.57, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Loading PR2Arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L101_C8", "label": "self.send_delay =", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1018, 0.001, 2, 0.57, 0.0333, 644, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.send_delay", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.send_delay = send_delay"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L102_C8", "label": "self.off_point =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1028, 0.001, 2, 0.57, 0.0667, 795, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.off_point", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.off_point = gripper_point"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L103_C8", "label": "self.joint_names_list =", "type": "assigned_variable", "loc": [103, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1074, 0.0081, 2, 0.57, 0.1, 515, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.joint_names_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_names_list = [['r_shoulder_pan_joint',\n 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint',\n 'r_elbow_flex_joint', 'r_forearm_roll_joint',\n 'r_wrist_flex_joint', 'r_wrist_roll_joint'],\n ['l_shoulder_pan_joint',\n 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint',\n 'l_elbow_flex_joint', 'l_forearm_roll_joint',\n 'l_wrist_flex_joint', 'l_wrist_roll_joint']]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L112_C8", "label": "wait_for_service()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1129, 0.001, 2, 0.57, 0.1333, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service('pr2_right_arm_kinematics/get_fk');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L113_C8", "label": "self.fk_srv =", "type": "assigned_variable", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1144, 0.002, 2, 0.57, 0.1667, 245, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.fk_srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.fk_srv = [rospy.ServiceProxy('pr2_right_arm_kinematics/get_fk', GetPositionFK),\n rospy.ServiceProxy('pr2_left_arm_kinematics/get_fk', GetPositionFK)] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L116_C8", "label": "wait_for_service()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1169, 0.001, 2, 0.57, 0.2, 617, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_service", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_service", "annotation": ""}, "snippet": " rospy.wait_for_service('pr2_right_arm_kinematics/get_ik');"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L117_C8", "label": "self.ik_srv =", "type": "assigned_variable", "loc": [117, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1184, 0.002, 2, 0.57, 0.2333, 144, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.ik_srv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ik_srv = [rospy.ServiceProxy('pr2_right_arm_kinematics/get_ik', GetPositionIK),\n rospy.ServiceProxy('pr2_left_arm_kinematics/get_ik', GetPositionIK)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L120_C8", "label": "self.joint_action_client =", "type": "assigned_variable", "loc": [120, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1215, 0.002, 2, 0.57, 0.2667, 369, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.joint_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.joint_action_client = [actionlib.SimpleActionClient('r_arm_controller/joint_trajectory_action', JointTrajectoryAction),\n actionlib.SimpleActionClient('l_arm_controller/joint_trajectory_action', JointTrajectoryAction)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L123_C8", "label": "self.gripper_action_client =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.124, 0.001, 2, 0.57, 0.3, 87, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.gripper_action_client", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.gripper_action_client = [actionlib.SimpleActionClient('r_gripper_controller/gripper_action', Pr2GripperCommandAction),actionlib.SimpleActionClient('l_gripper_controller/gripper_action', Pr2GripperCommandAction)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L125_C8", "label": "wait_for_server()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.126, 0.001, 2, 0.57, 0.3333, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.joint_action_client[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L126_C8", "label": "wait_for_server()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.127, 0.001, 2, 0.57, 0.3667, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.joint_action_client[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L127_C8", "label": "wait_for_server()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.128, 0.001, 2, 0.57, 0.4, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client[0].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L128_C8", "label": "wait_for_server()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.129, 0.001, 2, 0.57, 0.4333, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "wait_for_server", "arg_names": [], "import_names": [], "rhs_call_name": "wait_for_server", "annotation": ""}, "snippet": " self.gripper_action_client[1].wait_for_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L130_C8", "label": "self.arm_state_lock =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.131, 0.001, 2, 0.57, 0.4667, 845, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.arm_state_lock", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_state_lock = [RLock(), RLock()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L131_C8", "label": "self.r_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1321, 0.001, 2, 0.57, 0.5, 7, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.r_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.r_arm_cart_pub = rospy.Publisher('/r_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L132_C8", "label": "self.l_arm_cart_pub = Publisher()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1331, 0.001, 2, 0.57, 0.5333, 808, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.l_arm_cart_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.l_arm_cart_pub = rospy.Publisher('/l_cart/command_pose', PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L134_C8", "label": "Subscriber()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1351, 0.001, 2, 0.57, 0.5667, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/r_cart/state', JTTeleopControllerState, self.r_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L135_C8", "label": "Subscriber()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1361, 0.001, 2, 0.57, 0.6, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/l_cart/state', JTTeleopControllerState, self.l_cart_state_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L137_C8", "label": "if", "type": "if", "loc": [137, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [4, 2, 0.1386, 0.002, 2, 0.57, 0.6333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_torque:\n self.r_arm_ftc = ftc.FTClient('force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L138_C12", "label": "self.r_arm_ftc = FTClient()", "type": "assigned_variable", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L137_C8", "vector": [14, 3, 0.1391, 0.001, 3, 0.01, 0.0, 538, 3, 1, 0, 0, 78, 10, 1], "semantic": {"name": "self.r_arm_ftc", "arg_names": [], "import_names": [], "rhs_call_name": "FTClient", "annotation": ""}, "snippet": " self.r_arm_ftc = ftc.FTClient('force_torque_ft2')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L139_C8", "label": "self.tf_lstnr = TransformListener()", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1401, 0.001, 2, 0.57, 0.6667, 699, 3, 0, 0, 0, 108, 10, 1], "semantic": {"name": "self.tf_lstnr", "arg_names": [], "import_names": [], "rhs_call_name": "TransformListener", "annotation": ""}, "snippet": " self.tf_lstnr = tf.TransformListener()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L141_C8", "label": "self.arm_angles =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1421, 0.001, 2, 0.57, 0.7, 980, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L142_C8", "label": "self.arm_efforts =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1431, 0.001, 2, 0.57, 0.7333, 222, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L143_C8", "label": "self.jtg =", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1442, 0.001, 2, 0.57, 0.7667, 79, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.jtg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.jtg = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L144_C8", "label": "self.cur_traj =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1452, 0.001, 2, 0.57, 0.8, 946, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cur_traj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L145_C8", "label": "self.cur_traj_timer =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1462, 0.001, 2, 0.57, 0.8333, 659, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cur_traj_timer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj_timer = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L146_C8", "label": "self.cur_traj_pos =", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1472, 0.001, 2, 0.57, 0.8667, 550, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cur_traj_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj_pos = [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L148_C8", "label": "self.marker_pub = Publisher()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [14, 2, 0.1492, 0.001, 2, 0.57, 0.9, 368, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.marker_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.marker_pub = rospy.Publisher('/pr2_arms/viz_marker', Marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L149_C8", "label": "Subscriber()", "type": "expression", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1507, 0.002, 2, 0.57, 0.9333, 455, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber('/joint_states', JointState,\n self.joint_states_cb, queue_size=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L152_C8", "label": "sleep()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1532, 0.001, 2, 0.57, 0.9667, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(1.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L154_C8", "label": "log()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "vector": [8, 2, 0.1552, 0.001, 2, 0.57, 1.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Finished loading SimpleArmManger\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "label": "joint_states_cb", "type": "function", "loc": [161, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.1789, 0.0343, 1, 0.17, 0.0286, 800, 0, 2, 0, 0, 0, 0, 13], "semantic": {"name": "joint_states_cb", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def joint_states_cb(self, data):\n arm_angles = [[], []]\n arm_efforts = [[], []]\n r_jt_idx_list = [0]*7\n l_jt_idx_list = [0]*7\n for i, jt_nm in enumerate(self.joint_names_list[0]):\n r_jt_idx_list[i] = data.name.index(jt_nm)\n for i, jt_nm in enumerate(self.joint_names_list[1]):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L162_C8", "label": "arm_angles =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1633, 0.001, 2, 0.22, 0.0, 148, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_angles", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_angles = [[], []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L163_C8", "label": "arm_efforts =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1643, 0.001, 2, 0.22, 0.0714, 394, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arm_efforts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_efforts = [[], []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L164_C8", "label": "r_jt_idx_list =", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1653, 0.001, 2, 0.22, 0.1429, 924, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "r_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_jt_idx_list = [0]*7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L165_C8", "label": "l_jt_idx_list =", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1663, 0.001, 2, 0.22, 0.2143, 974, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "l_jt_idx_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " l_jt_idx_list = [0]*7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L166_C8", "label": "for i, jt_nm", "type": "for", "loc": [166, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [6, 2, 0.1678, 0.002, 2, 0.22, 0.2857, 122, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, jt_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, jt_nm in enumerate(self.joint_names_list[0]):\n r_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L167_C12", "label": " = index()", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L166_C8", "vector": [14, 3, 0.1683, 0.001, 3, 0.3, 0.0, 0, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " r_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L168_C8", "label": "for i, jt_nm", "type": "for", "loc": [168, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [6, 2, 0.1699, 0.002, 2, 0.22, 0.3571, 122, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i, jt_nm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, jt_nm in enumerate(self.joint_names_list[1]):\n l_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L169_C12", "label": " = index()", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L168_C8", "vector": [14, 3, 0.1704, 0.001, 3, 0.3, 0.0, 0, 3, 1, 0, 0, 780, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "index", "annotation": ""}, "snippet": " l_jt_idx_list[i] = data.name.index(jt_nm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "label": "for i", "type": "for", "loc": [171, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [6, 2, 0.1789, 0.0141, 2, 0.22, 0.4286, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n idx = r_jt_idx_list[i]\n if data.name[idx] != self.joint_names_list[0][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))\n ang = self.normalize_ang(data.position[idx])\n arm_angles[0] += [ang]\n arm_efforts[0] += [data.effort[idx]]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L172_C12", "label": "idx =", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "vector": [14, 3, 0.1734, 0.001, 3, 0.67, 0.0, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = r_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L173_C12", "label": "if", "type": "if", "loc": [173, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "vector": [4, 3, 0.1749, 0.002, 3, 0.67, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != self.joint_names_list[0][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L175_C12", "label": "ang = normalize_ang()", "type": "assigned_variable", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "vector": [14, 3, 0.1764, 0.001, 3, 0.67, 0.4, 762, 3, 1, 0, 0, 747, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_ang", "annotation": ""}, "snippet": " ang = self.normalize_ang(data.position[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L179_C12", "label": "idx =", "type": "assigned_variable", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "vector": [14, 3, 0.1804, 0.001, 3, 0.67, 0.6, 187, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "idx", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idx = l_jt_idx_list[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L180_C12", "label": "if", "type": "if", "loc": [180, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "vector": [4, 3, 0.182, 0.002, 3, 0.67, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.name[idx] != self.joint_names_list[1][i]:\n raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L182_C12", "label": "ang = normalize_ang()", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "vector": [14, 3, 0.1835, 0.001, 3, 0.67, 1.0, 762, 3, 1, 0, 0, 747, 10, 1], "semantic": {"name": "ang", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_ang", "annotation": ""}, "snippet": " ang = self.normalize_ang(data.position[idx])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L186_C8", "label": "acquire()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [8, 2, 0.1875, 0.001, 2, 0.22, 0.5, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[0].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L187_C8", "label": "assign", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1885, 0.001, 2, 0.22, 0.5714, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles[0] = arm_angles[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L188_C8", "label": "assign", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1895, 0.001, 2, 0.22, 0.6429, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts[0] = arm_efforts[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L189_C8", "label": "release()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [8, 2, 0.1905, 0.001, 2, 0.22, 0.7143, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[0].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L191_C8", "label": "acquire()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [8, 2, 0.1925, 0.001, 2, 0.22, 0.7857, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[1].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L192_C8", "label": "assign", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1935, 0.001, 2, 0.22, 0.8571, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_angles[1] = arm_angles[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L193_C8", "label": "assign", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [14, 2, 0.1946, 0.001, 2, 0.22, 0.9286, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arm_efforts[1] = arm_efforts[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L194_C8", "label": "release()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "vector": [8, 2, 0.1956, 0.001, 2, 0.22, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[1].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "label": "r_cart_state_cb", "type": "function", "loc": [196, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.2223, 0.0504, 1, 0.17, 0.0571, 925, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "r_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def r_cart_state_cb(self, msg):\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n tip = np.matrix([0.12, 0., 0.]).T\n self.r_ee_pos = rot*tip + np.matrix(trans).T\n self.r_ee_rot = rot\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L197_C8", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [197, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.1991, 0.002, 2, 0.68, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n 'r_gripper_tool_frame', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L199_C8", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2006, 0.001, 2, 0.68, 0.0256, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L200_C8", "label": "tip =", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2016, 0.001, 2, 0.68, 0.0513, 726, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tip = np.matrix([0.12, 0., 0.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L201_C8", "label": "self.r_ee_pos =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2026, 0.001, 2, 0.68, 0.0769, 506, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_pos = rot*tip + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L202_C8", "label": "self.r_ee_rot =", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2036, 0.001, 2, 0.68, 0.1026, 375, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.r_ee_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_ee_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L205_C8", "label": "marker = Marker()", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2067, 0.001, 2, 0.68, 0.1282, 864, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "marker", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " marker = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L206_C8", "label": "marker.header.frame_id =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2077, 0.001, 2, 0.68, 0.1538, 22, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L207_C8", "label": "time_stamp = now()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2087, 0.001, 2, 0.68, 0.1795, 156, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "time_stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " time_stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L208_C8", "label": "marker.header.stamp =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2097, 0.001, 2, 0.68, 0.2051, 625, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.header.stamp = time_stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L209_C8", "label": "marker.ns =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2107, 0.001, 2, 0.68, 0.2308, 748, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "marker.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.ns = 'aloha land'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L210_C8", "label": "marker.type =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2117, 0.001, 2, 0.68, 0.2564, 726, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.type = Marker.SPHERE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L211_C8", "label": "marker.action =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2127, 0.001, 2, 0.68, 0.2821, 211, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L212_C8", "label": "marker.pose.position.x =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2137, 0.001, 2, 0.68, 0.3077, 294, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.x = self.r_ee_pos[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L213_C8", "label": "marker.pose.position.y =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2147, 0.001, 2, 0.68, 0.3333, 911, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.y = self.r_ee_pos[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L214_C8", "label": "marker.pose.position.z =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2157, 0.001, 2, 0.68, 0.359, 473, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.position.z = self.r_ee_pos[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L215_C8", "label": "size =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2167, 0.001, 2, 0.68, 0.3846, 714, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " size = 0.02"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L216_C8", "label": "marker.scale.x =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2177, 0.001, 2, 0.68, 0.4103, 887, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.x = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L217_C8", "label": "marker.scale.y =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2188, 0.001, 2, 0.68, 0.4359, 730, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.y = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L218_C8", "label": "marker.scale.z =", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2198, 0.001, 2, 0.68, 0.4615, 969, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.scale.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.scale.z = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L219_C8", "label": "marker.lifetime = Duration()", "type": "assigned_variable", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2208, 0.001, 2, 0.68, 0.4872, 788, 3, 0, 0, 0, 972, 10, 1], "semantic": {"name": "marker.lifetime", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " marker.lifetime = rospy.Duration()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L221_C8", "label": "marker.id =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2228, 0.001, 2, 0.68, 0.5128, 570, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.id = 71"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L222_C8", "label": "marker.pose.orientation.x =", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2238, 0.001, 2, 0.68, 0.5385, 831, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.x = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L223_C8", "label": "marker.pose.orientation.y =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2248, 0.001, 2, 0.68, 0.5641, 626, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.y = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L224_C8", "label": "marker.pose.orientation.z =", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2258, 0.001, 2, 0.68, 0.5897, 538, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.z = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L225_C8", "label": "marker.pose.orientation.w =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2268, 0.001, 2, 0.68, 0.6154, 522, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "marker.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.pose.orientation.w = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L227_C8", "label": "color =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2288, 0.001, 2, 0.68, 0.641, 776, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " color = (0.5, 0., 0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L228_C8", "label": "marker.color.r =", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2298, 0.001, 2, 0.68, 0.6667, 486, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.r = color[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L229_C8", "label": "marker.color.g =", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2308, 0.001, 2, 0.68, 0.6923, 536, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.g", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.g = color[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L230_C8", "label": "marker.color.b =", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2319, 0.001, 2, 0.68, 0.7179, 744, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "marker.color.b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.b = color[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L231_C8", "label": "marker.color.a =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2329, 0.001, 2, 0.68, 0.7436, 240, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "marker.color.a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " marker.color.a = 1."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L232_C8", "label": "publish()", "type": "expression", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [8, 2, 0.2339, 0.001, 2, 0.68, 0.7692, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.marker_pub.publish(marker)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L237_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2389, 0.001, 2, 0.68, 0.7949, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L238_C8", "label": "x, y, z =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2399, 0.001, 2, 0.68, 0.8205, 971, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "x, y, z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x, y, z = ros_pt.x, ros_pt.y, ros_pt.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L239_C8", "label": "self.r_cep_pos =", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2409, 0.001, 2, 0.68, 0.8462, 277, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos = np.matrix([x, y, z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L240_C8", "label": "pt =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2419, 0.001, 2, 0.68, 0.8718, 989, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = rot.T * (np.matrix([x,y,z]).T - np.matrix(trans).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L241_C8", "label": "pt =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.2429, 0.001, 2, 0.68, 0.8974, 989, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pt = pt + tip"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L242_C8", "label": "self.r_cep_pos_hooktip =", "type": "assigned_variable", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.244, 0.001, 2, 0.68, 0.9231, 508, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.r_cep_pos_hooktip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.r_cep_pos_hooktip = rot*pt + np.matrix(trans).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L243_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.245, 0.001, 2, 0.68, 0.9487, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L244_C8", "label": "quat =", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.246, 0.001, 2, 0.68, 0.9744, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L245_C8", "label": "self.r_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "vector": [14, 2, 0.247, 0.001, 2, 0.68, 1.0, 764, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.r_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.r_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "label": "l_cart_state_cb", "type": "function", "loc": [247, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.2515, 0.006, 1, 0.17, 0.0857, 1, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "l_cart_state_cb", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def l_cart_state_cb(self, msg):\n ros_pt = msg.x_desi_filtered.pose.position\n self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T\n ros_quat = msg.x_desi_filtered.pose.orientation\n quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)\n self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L248_C8", "label": "ros_pt =", "type": "assigned_variable", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "vector": [14, 2, 0.25, 0.001, 2, 0.21, 0.0, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_pt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_pt = msg.x_desi_filtered.pose.position"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L249_C8", "label": "self.l_cep_pos =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "vector": [14, 2, 0.251, 0.001, 2, 0.21, 0.25, 973, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.l_cep_pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.l_cep_pos = np.matrix([ros_pt.x, ros_pt.y, ros_pt.z]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L250_C8", "label": "ros_quat =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "vector": [14, 2, 0.252, 0.001, 2, 0.21, 0.5, 920, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ros_quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ros_quat = msg.x_desi_filtered.pose.orientation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L251_C8", "label": "quat =", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "vector": [14, 2, 0.253, 0.001, 2, 0.21, 0.75, 367, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = (ros_quat.x, ros_quat.y, ros_quat.z, ros_quat.w)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L252_C8", "label": "self.l_cep_rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "vector": [14, 2, 0.254, 0.001, 2, 0.21, 1.0, 385, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "self.l_cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " self.l_cep_rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "label": "normalize_ang", "type": "function", "loc": [254, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.2586, 0.006, 1, 0.17, 0.1143, 747, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "normalize_ang", "arg_names": ["self", "ang"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def normalize_ang(self, ang):\n while ang >= 2 * np.pi:\n ang -= 2 * np.pi\n while ang < 0.:\n ang += 2 * np.pi\n return ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L255_C8", "label": "while", "type": "while", "loc": [255, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "vector": [5, 2, 0.2576, 0.002, 2, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while ang >= 2 * np.pi:\n ang -= 2 * np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L257_C8", "label": "while", "type": "while", "loc": [257, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "vector": [5, 2, 0.2596, 0.002, 2, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while ang < 0.:\n ang += 2 * np.pi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L259_C8", "label": "return", "type": "return", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "vector": [13, 2, 0.2611, 0.001, 2, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ang"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "label": "create_JTG", "type": "function", "loc": [271, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.2999, 0.0544, 1, 0.17, 0.1429, 259, 0, 7, 1, 0, 0, 0, 16], "semantic": {"name": "create_JTG", "arg_names": ["self", "arm", "pos_arr", "dur_arr", "stamp", "vel_arr", "acc_arr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_JTG(self, arm, pos_arr, dur_arr, stamp=None, vel_arr=None, acc_arr=None):\n # Hack\n vel_arr = [[0.]*7]*len(pos_arr)\n acc_arr = [[0.]*7]*len(pos_arr)\n\n ##\n # Compute joint velocities and acclereations.\n def get_vel_acc(q_arr, d_arr):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L273_C8", "label": "vel_arr =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [14, 2, 0.2752, 0.001, 2, 0.82, 0.0, 86, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_arr = [[0.]*7]*len(pos_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L274_C8", "label": "acc_arr =", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [14, 2, 0.2762, 0.001, 2, 0.82, 0.1111, 826, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acc_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc_arr = [[0.]*7]*len(pos_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "label": "get_vel_acc", "type": "function", "loc": [278, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [2, 2, 0.2858, 0.0121, 2, 0.82, 0.2222, 408, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_vel_acc", "arg_names": ["q_arr", "d_arr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_vel_acc(q_arr, d_arr):\n vel_arr = [[0.]*7]\n acc_arr = [[0.]*7]\n for i in range(1, len(q_arr)):\n vel, acc = [], []\n for j in range(7):\n vel += [(q_arr[i][j] - q_arr[i-1][j]) / d_arr[i]]\n acc += [(vel[j] - vel_arr[i-1][j]) / d_arr[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L279_C12", "label": "vel_arr =", "type": "assigned_variable", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "vector": [14, 3, 0.2812, 0.001, 3, 0.42, 0.0, 86, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_arr = [[0.]*7]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L280_C12", "label": "acc_arr =", "type": "assigned_variable", "loc": [280, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "vector": [14, 3, 0.2823, 0.001, 3, 0.42, 0.3333, 826, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "acc_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc_arr = [[0.]*7]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "label": "for i", "type": "for", "loc": [281, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "vector": [6, 3, 0.2868, 0.0081, 3, 0.42, 0.6667, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(1, len(q_arr)):\n vel, acc = [], []\n for j in range(7):\n vel += [(q_arr[i][j] - q_arr[i-1][j]) / d_arr[i]]\n acc += [(vel[j] - vel_arr[i-1][j]) / d_arr[i]]\n vel_arr += [vel]\n acc_arr += [acc]\n print(vel, acc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L282_C16", "label": "vel, acc =", "type": "assigned_variable", "loc": [282, 282], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "vector": [14, 4, 0.2843, 0.001, 4, 0.95, 0.0, 392, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "vel, acc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel, acc = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L283_C16", "label": "for j", "type": "for", "loc": [283, 285], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "vector": [6, 4, 0.2863, 0.003, 4, 0.95, 0.5, 100, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for j in range(7):\n vel += [(q_arr[i][j] - q_arr[i-1][j]) / d_arr[i]]\n acc += [(vel[j] - vel_arr[i-1][j]) / d_arr[i]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L288_C16", "label": "print()", "type": "expression", "loc": [288, 288], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "vector": [8, 4, 0.2903, 0.001, 4, 0.95, 1.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(vel, acc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L289_C12", "label": "return", "type": "return", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "vector": [13, 3, 0.2913, 0.001, 3, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vel_arr, acc_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L291_C8", "label": "if", "type": "if", "loc": [291, 292], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [4, 2, 0.2939, 0.002, 2, 0.82, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L292_C12", "label": "arm =", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L291_C8", "vector": [14, 3, 0.2944, 0.001, 3, 0.36, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L293_C8", "label": "jtg = JointTrajectoryGoal()", "type": "assigned_variable", "loc": [293, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [14, 2, 0.2954, 0.001, 2, 0.82, 0.4444, 511, 3, 0, 0, 0, 970, 10, 1], "semantic": {"name": "jtg", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryGoal", "annotation": ""}, "snippet": " jtg = JointTrajectoryGoal()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L294_C8", "label": "if", "type": "if", "loc": [294, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [4, 2, 0.2979, 0.004, 2, 0.82, 0.5556, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stamp is None:\n stamp = rospy.Time.now()\n else:\n jtg.trajectory.header.stamp = stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L295_C12", "label": "stamp = now()", "type": "assigned_variable", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L294_C8", "vector": [14, 3, 0.2974, 0.001, 3, 0.02, 0.0, 897, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L297_C12", "label": "jtg.trajectory.header.stamp =", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L294_C8", "vector": [14, 3, 0.2994, 0.001, 3, 0.02, 1.0, 542, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtg.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtg.trajectory.header.stamp = stamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "label": "if", "type": "if", "loc": [299, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [4, 2, 0.3039, 0.006, 2, 0.82, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(pos_arr) > 1 and (vel_arr is None or acc_arr is None):\n v_arr, a_arr = get_vel_acc(pos_arr, dur_arr)\n if vel_arr is None:\n vel_arr = v_arr\n if acc_arr is None:\n acc_arr = a_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L300_C12", "label": "v_arr, a_arr = get_vel_acc()", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "vector": [14, 3, 0.3024, 0.001, 3, 0.04, 0.0, 213, 3, 2, 0, 0, 408, 10, 1], "semantic": {"name": "v_arr, a_arr", "arg_names": [], "import_names": [], "rhs_call_name": "get_vel_acc", "annotation": ""}, "snippet": " v_arr, a_arr = get_vel_acc(pos_arr, dur_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L301_C12", "label": "if", "type": "if", "loc": [301, 302], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "vector": [4, 3, 0.3039, 0.002, 3, 0.04, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vel_arr is None:\n vel_arr = v_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L302_C16", "label": "vel_arr =", "type": "assigned_variable", "loc": [302, 302], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L301_C12", "vector": [14, 4, 0.3044, 0.001, 4, 0.22, 0.0, 86, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel_arr = v_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L303_C12", "label": "if", "type": "if", "loc": [303, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "vector": [4, 3, 0.3059, 0.002, 3, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if acc_arr is None:\n acc_arr = a_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L304_C16", "label": "acc_arr =", "type": "assigned_variable", "loc": [304, 304], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L303_C12", "vector": [14, 4, 0.3065, 0.001, 4, 0.26, 0.0, 826, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "acc_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc_arr = a_arr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L306_C8", "label": "jtg.trajectory.joint_names =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [14, 2, 0.3085, 0.001, 2, 0.82, 0.7778, 747, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtg.trajectory.joint_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtg.trajectory.joint_names = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "label": "for i", "type": "for", "loc": [307, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [6, 2, 0.3175, 0.0171, 2, 0.82, 0.8889, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(pos_arr)):\n if pos_arr[i] is None or type(pos_arr[i]) is types.NoneType:\n continue\n jtp = JointTrajectoryPoint()\n jtp.positions = pos_arr[i]\n if vel_arr is None:\n vel = [0.] * 7\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L308_C12", "label": "if", "type": "if", "loc": [308, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [4, 3, 0.311, 0.002, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if pos_arr[i] is None or type(pos_arr[i]) is types.NoneType:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L310_C12", "label": "jtp = JointTrajectoryPoint()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [14, 3, 0.3125, 0.001, 3, 0.32, 0.125, 952, 3, 0, 0, 0, 302, 10, 1], "semantic": {"name": "jtp", "arg_names": [], "import_names": [], "rhs_call_name": "JointTrajectoryPoint", "annotation": ""}, "snippet": " jtp = JointTrajectoryPoint()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L311_C12", "label": "jtp.positions =", "type": "assigned_variable", "loc": [311, 311], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [14, 3, 0.3135, 0.001, 3, 0.32, 0.25, 984, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtp.positions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.positions = pos_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L312_C12", "label": "if", "type": "if", "loc": [312, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [4, 3, 0.316, 0.004, 3, 0.32, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if vel_arr is None:\n vel = [0.] * 7\n else:\n vel = vel_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L313_C16", "label": "vel =", "type": "assigned_variable", "loc": [313, 313], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L312_C12", "vector": [14, 4, 0.3155, 0.001, 4, 0.09, 0.0, 527, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = [0.] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L315_C16", "label": "vel =", "type": "assigned_variable", "loc": [315, 315], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L312_C12", "vector": [14, 4, 0.3175, 0.001, 4, 0.09, 1.0, 527, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "vel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vel = vel_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L316_C12", "label": "jtp.velocities =", "type": "assigned_variable", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [14, 3, 0.3185, 0.001, 3, 0.32, 0.5, 380, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtp.velocities", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.velocities = vel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L317_C12", "label": "if", "type": "if", "loc": [317, 320], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [4, 3, 0.3211, 0.004, 3, 0.32, 0.625, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if acc_arr is None:\n acc = [0.] * 7\n else:\n acc = acc_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L318_C16", "label": "acc =", "type": "assigned_variable", "loc": [318, 318], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L317_C12", "vector": [14, 4, 0.3206, 0.001, 4, 0.78, 0.0, 928, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "acc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc = [0.] * 7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L320_C16", "label": "acc =", "type": "assigned_variable", "loc": [320, 320], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L317_C12", "vector": [14, 4, 0.3226, 0.001, 4, 0.78, 1.0, 928, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "acc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " acc = acc_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L321_C12", "label": "jtp.accelerations =", "type": "assigned_variable", "loc": [321, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [14, 3, 0.3236, 0.001, 3, 0.32, 0.75, 656, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtp.accelerations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtp.accelerations = acc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L322_C12", "label": "jtp.time_from_start = Duration()", "type": "assigned_variable", "loc": [322, 322], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [14, 3, 0.3246, 0.001, 3, 0.32, 0.875, 272, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "jtp.time_from_start", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " jtp.time_from_start = rospy.Duration(dur_arr[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L323_C12", "label": "append()", "type": "expression", "loc": [323, 323], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "vector": [8, 3, 0.3256, 0.001, 3, 0.32, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " jtg.trajectory.points.append(jtp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L324_C8", "label": "return", "type": "return", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "vector": [13, 2, 0.3266, 0.001, 2, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return jtg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "label": "execute_trajectory", "type": "function", "loc": [332, 359], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.3483, 0.0282, 1, 0.17, 0.1714, 844, 0, 3, 0, 0, 0, 0, 18], "semantic": {"name": "execute_trajectory", "arg_names": ["self", "arm", "jtg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_trajectory(self, arm, jtg):\n if self.cur_traj[arm] is not None or self.cur_traj_timer[arm] is not None:\n log(\"Arm is currently executing trajectory\")\n if rospy.is_shutdown():\n sys.exit()\n return\n print(\"Yo 2\")\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "label": "if", "type": "if", "loc": [333, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [4, 2, 0.3377, 0.005, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_traj[arm] is not None or self.cur_traj_timer[arm] is not None:\n log(\"Arm is currently executing trajectory\")\n if rospy.is_shutdown():\n sys.exit()\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L334_C12", "label": "log()", "type": "expression", "loc": [334, 334], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "vector": [8, 3, 0.3367, 0.001, 3, 0.87, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Arm is currently executing trajectory\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L335_C12", "label": "if", "type": "if", "loc": [335, 336], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "vector": [4, 3, 0.3382, 0.002, 3, 0.87, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L336_C16", "label": "exit()", "type": "expression", "loc": [336, 336], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L335_C12", "vector": [8, 4, 0.3387, 0.001, 4, 0.35, 0.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L337_C12", "label": "return", "type": "return", "loc": [337, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "vector": [13, 3, 0.3397, 0.001, 3, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L338_C8", "label": "print()", "type": "expression", "loc": [338, 338], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [8, 2, 0.3407, 0.001, 2, 0.97, 0.0909, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Yo 2\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L342_C8", "label": "assign", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [14, 2, 0.3448, 0.001, 2, 0.97, 0.1818, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj_pos[arm] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L345_C8", "label": "min_init_time =", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [14, 2, 0.3478, 0.001, 2, 0.97, 0.2727, 466, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "min_init_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " min_init_time = rospy.Time.now().to_sec() + 2 * self.send_delay"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L346_C8", "label": "if", "type": "if", "loc": [346, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [4, 2, 0.3498, 0.003, 2, 0.97, 0.3636, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if jtg.trajectory.header.stamp.to_nsec() < min_init_time:\n jtg.trajectory.header.stamp = rospy.Time(rospy.Time.now().to_sec(), \n 2 * self.send_delay)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L347_C12", "label": "jtg.trajectory.header.stamp = Time()", "type": "assigned_variable", "loc": [347, 348], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L346_C8", "vector": [14, 3, 0.3503, 0.002, 3, 0.97, 0.0, 542, 3, 2, 0, 0, 451, 10, 3], "semantic": {"name": "jtg.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " jtg.trajectory.header.stamp = rospy.Time(rospy.Time.now().to_sec(), \n 2 * self.send_delay)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L350_C8", "label": "print()", "type": "expression", "loc": [350, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [8, 2, 0.3528, 0.001, 2, 0.97, 0.4545, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"dfsdfsfd\", jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L351_C8", "label": "jtg.trajectory.header.stamp = now()", "type": "assigned_variable", "loc": [351, 351], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [14, 2, 0.3538, 0.001, 2, 0.97, 0.5455, 542, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "jtg.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " jtg.trajectory.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L352_C8", "label": "send_goal()", "type": "expression", "loc": [352, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [8, 2, 0.3548, 0.001, 2, 0.97, 0.6364, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.joint_action_client[arm].send_goal(jtg) # Hack"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L353_C8", "label": "return", "type": "return", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [13, 2, 0.3558, 0.001, 2, 0.97, 0.7273, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L356_C8", "label": "call_time =", "type": "assigned_variable", "loc": [356, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [14, 2, 0.3594, 0.002, 2, 0.97, 0.8182, 847, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "call_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " call_time = ((jtg.trajectory.header.stamp.to_nsec() - self.send_delay -\n rospy.Time.now().to_nsec()) / 1000000000.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L358_C8", "label": " = Timer()", "type": "assigned_variable", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [14, 2, 0.3609, 0.001, 2, 0.97, 0.9091, 0, 3, 3, 0, 0, 771, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.cur_traj_timer[arm] = Timer(call_time, self._exec_traj, [arm])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L359_C8", "label": "start()", "type": "expression", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "vector": [8, 2, 0.3619, 0.001, 2, 0.97, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.cur_traj_timer[arm].start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "label": "_exec_traj", "type": "function", "loc": [364, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.3851, 0.0373, 1, 0.17, 0.2, 405, 0, 2, 0, 0, 0, 0, 17], "semantic": {"name": "_exec_traj", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _exec_traj(self, arm):\n jtg = self.cur_traj[arm]\n i = self.cur_traj_pos[arm]\n beg_time = jtg.trajectory.header.stamp.to_nsec()\n\n # time to execute current point\n cur_exec_time = rospy.Time(jtg.trajectory.header.stamp.to_sec() +\n jtg.trajectory.points[i].time_from_start.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L365_C8", "label": "jtg =", "type": "assigned_variable", "loc": [365, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [14, 2, 0.3679, 0.001, 2, 0.84, 0.0, 511, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "jtg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " jtg = self.cur_traj[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L366_C8", "label": "i =", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [14, 2, 0.369, 0.001, 2, 0.84, 0.1111, 826, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = self.cur_traj_pos[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L367_C8", "label": "beg_time = to_nsec()", "type": "assigned_variable", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [14, 2, 0.37, 0.001, 2, 0.84, 0.2222, 812, 3, 0, 0, 0, 401, 10, 1], "semantic": {"name": "beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_nsec", "annotation": ""}, "snippet": " beg_time = jtg.trajectory.header.stamp.to_nsec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L370_C8", "label": "cur_exec_time = Time()", "type": "assigned_variable", "loc": [370, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [14, 2, 0.3735, 0.002, 2, 0.84, 0.3333, 210, 3, 1, 0, 0, 451, 10, 3], "semantic": {"name": "cur_exec_time", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " cur_exec_time = rospy.Time(jtg.trajectory.header.stamp.to_sec() +\n jtg.trajectory.points[i].time_from_start.to_sec())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L374_C8", "label": "if", "type": "if", "loc": [374, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [4, 2, 0.3785, 0.004, 2, 0.84, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if i == 0:\n last_time_from = 0\n else:\n last_time_from = jtg.trajectory.points[i-1].time_from_start.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L375_C12", "label": "last_time_from =", "type": "assigned_variable", "loc": [375, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L374_C8", "vector": [14, 3, 0.378, 0.001, 3, 0.18, 0.0, 130, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "last_time_from", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " last_time_from = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L377_C12", "label": "last_time_from = to_sec()", "type": "assigned_variable", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L374_C8", "vector": [14, 3, 0.38, 0.001, 3, 0.18, 1.0, 130, 3, 0, 0, 0, 750, 10, 1], "semantic": {"name": "last_time_from", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " last_time_from = jtg.trajectory.points[i-1].time_from_start.to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L378_C8", "label": "cur_dur =", "type": "assigned_variable", "loc": [378, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [14, 2, 0.381, 0.001, 2, 0.84, 0.5556, 15, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cur_dur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_dur = jtg.trajectory.points[i].time_from_start.to_sec() - last_time_from"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L379_C8", "label": "cur_jtg = create_JTG()", "type": "assigned_variable", "loc": [379, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [14, 2, 0.3841, 0.005, 2, 0.84, 0.6667, 78, 3, 6, 0, 0, 259, 10, 1], "semantic": {"name": "cur_jtg", "arg_names": [], "import_names": [], "rhs_call_name": "create_JTG", "annotation": ""}, "snippet": " cur_jtg = self.create_JTG(arm, [jtg.trajectory.points[i].positions],\n [cur_dur],\n cur_exec_time,\n [jtg.trajectory.points[i].velocities],\n [jtg.trajectory.points[i].accelerations])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L385_C8", "label": "print()", "type": "expression", "loc": [385, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [8, 2, 0.3881, 0.001, 2, 0.84, 0.7778, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"cur_jtg\", cur_jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L386_C8", "label": "send_goal()", "type": "expression", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [8, 2, 0.3891, 0.001, 2, 0.84, 0.8889, 184, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.joint_action_client[arm].send_goal(cur_jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "label": "if", "type": "if", "loc": [389, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "vector": [4, 2, 0.3977, 0.0121, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.cur_traj_pos[arm] == len(jtg.trajectory.points):\n # end trajectory\n self.cur_traj[arm] = None\n self.cur_traj_timer[arm] = None\n else:\n # setup next point throw\n next_exec_time = beg_time + jtg.trajectory.points[i+1].time_from_start.to_nsec()\n print(\"diff times\", next_exec_time / 1000000000. - cur_exec_time.to_sec() - cur_dur)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L391_C12", "label": "assign", "type": "assigned_variable", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [14, 3, 0.3942, 0.001, 3, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj[arm] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L392_C12", "label": "assign", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [14, 3, 0.3952, 0.001, 3, 0.34, 0.1667, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj_timer[arm] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L395_C12", "label": "next_exec_time =", "type": "assigned_variable", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [14, 3, 0.3982, 0.001, 3, 0.34, 0.3333, 361, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "next_exec_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " next_exec_time = beg_time + jtg.trajectory.points[i+1].time_from_start.to_nsec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L396_C12", "label": "print()", "type": "expression", "loc": [396, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [8, 3, 0.3992, 0.001, 3, 0.34, 0.5, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"diff times\", next_exec_time / 1000000000. - cur_exec_time.to_sec() - cur_dur)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L397_C12", "label": "call_time =", "type": "assigned_variable", "loc": [397, 398], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [14, 3, 0.4007, 0.002, 3, 0.34, 0.6667, 847, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "call_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " call_time = ((next_exec_time - self.send_delay -\n rospy.Time.now().to_nsec()) / 1000000000.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L399_C12", "label": " = Timer()", "type": "assigned_variable", "loc": [399, 399], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [14, 3, 0.4022, 0.001, 3, 0.34, 0.8333, 0, 3, 3, 0, 0, 771, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.cur_traj_timer[arm] = Timer(call_time, self._exec_traj, [arm])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L400_C12", "label": "start()", "type": "expression", "loc": [400, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "vector": [8, 3, 0.4032, 0.001, 3, 0.34, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.cur_traj_timer[arm].start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "label": "stop_trajectory", "type": "function", "loc": [406, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.4108, 0.004, 1, 0.17, 0.2286, 422, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "stop_trajectory", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_trajectory(self, arm):\n self.cur_traj_timer[arm].cancel()\n self.cur_traj[arm] = None\n self.cur_traj_timer[arm] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L407_C8", "label": "cancel()", "type": "expression", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "vector": [8, 2, 0.4103, 0.001, 2, 0.4, 0.0, 732, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel", "arg_names": [], "import_names": [], "rhs_call_name": "cancel", "annotation": ""}, "snippet": " self.cur_traj_timer[arm].cancel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L408_C8", "label": "assign", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "vector": [14, 2, 0.4113, 0.001, 2, 0.4, 0.5, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj[arm] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L409_C8", "label": "assign", "type": "assigned_variable", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "vector": [14, 2, 0.4123, 0.001, 2, 0.4, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cur_traj_timer[arm] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L418_C4", "label": "set_joint_angles", "type": "function", "loc": [418, 419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.4219, 0.002, 1, 0.17, 0.2571, 718, 0, 5, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": ["self", "arm", "q", "duration", "start_time"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_joint_angles(self, arm, q, duration=1., start_time=0.):\n self.set_joint_angles_traj(arm, [q], [duration], start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L419_C8", "label": "set_joint_angles_traj()", "type": "expression", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L418_C4", "vector": [8, 2, 0.4224, 0.001, 2, 0.83, 0.0, 572, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles_traj", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles_traj", "annotation": ""}, "snippet": " self.set_joint_angles_traj(arm, [q], [duration], start_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "label": "set_joint_angles_traj", "type": "function", "loc": [429, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.4355, 0.0071, 1, 0.17, 0.2857, 572, 0, 5, 0, 0, 0, 0, 5], "semantic": {"name": "set_joint_angles_traj", "arg_names": ["self", "arm", "q_arr", "dur_arr", "start_time"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_joint_angles_traj(self, arm, q_arr, dur_arr, start_time=0.):\n if arm != 1:\n arm = 0\n jtg = self.create_JTG(arm, q_arr, dur_arr)\n cur_time = rospy.Time.now().to_sec() + 2 * self.send_delay / 1000000000.\n jtg.trajectory.header.stamp = rospy.Duration(start_time + cur_time)\n self.execute_trajectory(arm, jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L430_C8", "label": "if", "type": "if", "loc": [430, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "vector": [4, 2, 0.434, 0.002, 2, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L431_C12", "label": "arm =", "type": "assigned_variable", "loc": [431, 431], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L430_C8", "vector": [14, 3, 0.4345, 0.001, 3, 0.49, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L432_C8", "label": "jtg = create_JTG()", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "vector": [14, 2, 0.4355, 0.001, 2, 0.11, 0.25, 511, 3, 3, 0, 0, 259, 10, 1], "semantic": {"name": "jtg", "arg_names": [], "import_names": [], "rhs_call_name": "create_JTG", "annotation": ""}, "snippet": " jtg = self.create_JTG(arm, q_arr, dur_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L433_C8", "label": "cur_time =", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "vector": [14, 2, 0.4365, 0.001, 2, 0.11, 0.5, 618, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cur_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_time = rospy.Time.now().to_sec() + 2 * self.send_delay / 1000000000."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L434_C8", "label": "jtg.trajectory.header.stamp = Duration()", "type": "assigned_variable", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "vector": [14, 2, 0.4375, 0.001, 2, 0.11, 0.75, 542, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "jtg.trajectory.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " jtg.trajectory.header.stamp = rospy.Duration(start_time + cur_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L435_C8", "label": "execute_trajectory()", "type": "expression", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "vector": [8, 2, 0.4385, 0.001, 2, 0.11, 1.0, 844, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "execute_trajectory", "annotation": ""}, "snippet": " self.execute_trajectory(arm, jtg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L442_C4", "label": "is_arm_in_motion", "type": "function", "loc": [442, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.4481, 0.006, 1, 0.17, 0.3143, 59, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "is_arm_in_motion", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_arm_in_motion(self, arm):\n # Hack\n # if self.cur_traj[arm] is not None:\n # return True\n state = self.joint_action_client[arm].get_state()\n return state == GoalStatus.PENDING or state == GoalStatus.ACTIVE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L446_C8", "label": "state = get_state()", "type": "assigned_variable", "loc": [446, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L442_C4", "vector": [14, 2, 0.4496, 0.001, 2, 0.52, 0.0, 688, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "get_state", "annotation": ""}, "snippet": " state = self.joint_action_client[arm].get_state()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L447_C8", "label": "return", "type": "return", "loc": [447, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L442_C4", "vector": [13, 2, 0.4506, 0.001, 2, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return state == GoalStatus.PENDING or state == GoalStatus.ACTIVE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L454_C4", "label": "wait_for_arm_completion", "type": "function", "loc": [454, 456], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.4587, 0.003, 1, 0.17, 0.3429, 431, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "wait_for_arm_completion", "arg_names": ["self", "arm", "hz"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_for_arm_completion(self, arm, hz=0.01):\n while self.is_arm_in_motion(arm) and not rospy.is_shutdown():\n rospy.sleep(hz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L455_C8", "label": "while", "type": "while", "loc": [455, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L454_C4", "vector": [5, 2, 0.4592, 0.002, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.is_arm_in_motion(arm) and not rospy.is_shutdown():\n rospy.sleep(hz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L456_C12", "label": "sleep()", "type": "expression", "loc": [456, 456], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L455_C8", "vector": [8, 3, 0.4597, 0.001, 3, 0.18, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(hz)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "label": "transform_in_frame", "type": "function", "loc": [466, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.4733, 0.0081, 1, 0.17, 0.3714, 114, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "transform_in_frame", "arg_names": ["self", "pos", "quat", "off_point"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def transform_in_frame(self, pos, quat, off_point):\n pos = make_column(pos) \n quat = make_list(quat)\n invquatmat = np.mat(tftrans.quaternion_matrix(quat))\n invquatmat[0:3,3] = pos \n trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T\n transpos = invquatmat * trans\n return np.resize(transpos, (3, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L467_C8", "label": "pos = make_column()", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [14, 2, 0.4708, 0.001, 2, 0.76, 0.0, 627, 3, 1, 0, 0, 304, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "make_column", "annotation": ""}, "snippet": " pos = make_column(pos) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L468_C8", "label": "quat = make_list()", "type": "assigned_variable", "loc": [468, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [14, 2, 0.4718, 0.001, 2, 0.76, 0.1667, 367, 3, 1, 0, 0, 937, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "make_list", "annotation": ""}, "snippet": " quat = make_list(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L469_C8", "label": "invquatmat = mat()", "type": "assigned_variable", "loc": [469, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [14, 2, 0.4728, 0.001, 2, 0.76, 0.3333, 275, 3, 1, 0, 0, 882, 10, 2], "semantic": {"name": "invquatmat", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " invquatmat = np.mat(tftrans.quaternion_matrix(quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L470_C8", "label": "assign", "type": "assigned_variable", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [14, 2, 0.4738, 0.001, 2, 0.76, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " invquatmat[0:3,3] = pos "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L471_C8", "label": "trans =", "type": "assigned_variable", "loc": [471, 471], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [14, 2, 0.4748, 0.001, 2, 0.76, 0.6667, 786, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "trans", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " trans = np.matrix([off_point[0],off_point[1],off_point[2],1.]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L472_C8", "label": "transpos =", "type": "assigned_variable", "loc": [472, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [14, 2, 0.4758, 0.001, 2, 0.76, 0.8333, 686, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "transpos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " transpos = invquatmat * trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L473_C8", "label": "return", "type": "return", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "vector": [13, 2, 0.4768, 0.001, 2, 0.76, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.resize(transpos, (3, 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "label": "FK", "type": "function", "loc": [481, 514], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.5015, 0.0343, 1, 0.17, 0.4, 252, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "FK", "arg_names": ["self", "arm", "q"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def FK(self, arm, q):\n if rospy.is_shutdown():\n sys.exit()\n if arm != 1:\n arm = 0\n fk_req = GetPositionFKRequest()\n fk_req.header.frame_id = 'torso_lift_link'\n if arm == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L482_C8", "label": "if", "type": "if", "loc": [482, 483], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [4, 2, 0.4864, 0.002, 2, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rospy.is_shutdown():\n sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L483_C12", "label": "exit()", "type": "expression", "loc": [483, 483], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L482_C8", "vector": [8, 3, 0.4869, 0.001, 3, 0.72, 0.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L484_C8", "label": "if", "type": "if", "loc": [484, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [4, 2, 0.4884, 0.002, 2, 0.64, 0.1, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L485_C12", "label": "arm =", "type": "assigned_variable", "loc": [485, 485], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L484_C8", "vector": [14, 3, 0.4889, 0.001, 3, 0.37, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L486_C8", "label": "fk_req = GetPositionFKRequest()", "type": "assigned_variable", "loc": [486, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [14, 2, 0.4899, 0.001, 2, 0.64, 0.2, 192, 3, 0, 0, 0, 7, 10, 1], "semantic": {"name": "fk_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionFKRequest", "annotation": ""}, "snippet": " fk_req = GetPositionFKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L487_C8", "label": "fk_req.header.frame_id =", "type": "assigned_variable", "loc": [487, 487], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [14, 2, 0.4909, 0.001, 2, 0.64, 0.3, 144, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "fk_req.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L488_C8", "label": "if", "type": "if", "loc": [488, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [4, 2, 0.4934, 0.004, 2, 0.64, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n fk_req.fk_link_names.append('r_wrist_roll_link') \n else:\n fk_req.fk_link_names.append('l_wrist_roll_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L489_C12", "label": "append()", "type": "expression", "loc": [489, 489], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L488_C8", "vector": [8, 3, 0.4929, 0.001, 3, 0.38, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fk_req.fk_link_names.append('r_wrist_roll_link') "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L491_C12", "label": "append()", "type": "expression", "loc": [491, 491], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L488_C8", "vector": [8, 3, 0.495, 0.001, 3, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " fk_req.fk_link_names.append('l_wrist_roll_link')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L492_C8", "label": "fk_req.robot_state.joint_state.name =", "type": "assigned_variable", "loc": [492, 492], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [14, 2, 0.496, 0.001, 2, 0.64, 0.5, 345, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.name = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L493_C8", "label": "fk_req.robot_state.joint_state.position =", "type": "assigned_variable", "loc": [493, 493], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [14, 2, 0.497, 0.001, 2, 0.64, 0.6, 514, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fk_req.robot_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fk_req.robot_state.joint_state.position = q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L495_C8", "label": "fk_resp = GetPositionFKResponse()", "type": "assigned_variable", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [14, 2, 0.499, 0.001, 2, 0.64, 0.7, 178, 3, 0, 0, 0, 373, 10, 1], "semantic": {"name": "fk_resp", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionFKResponse", "annotation": ""}, "snippet": " fk_resp = GetPositionFKResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L496_C8", "label": "fk_resp = call()", "type": "assigned_variable", "loc": [496, 496], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [14, 2, 0.5, 0.001, 2, 0.64, 0.8, 178, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "fk_resp", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " fk_resp = self.fk_srv[arm].call(fk_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "label": "if", "type": "if", "loc": [497, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [4, 2, 0.5086, 0.0161, 2, 0.64, 0.9, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fk_resp.error_code.val == fk_resp.error_code.SUCCESS:\n x = fk_resp.pose_stamped[0].pose.position.x\n y = fk_resp.pose_stamped[0].pose.position.y\n z = fk_resp.pose_stamped[0].pose.position.z\n q1 = fk_resp.pose_stamped[0].pose.orientation.x\n q2 = fk_resp.pose_stamped[0].pose.orientation.y\n q3 = fk_resp.pose_stamped[0].pose.orientation.z\n q4 = fk_resp.pose_stamped[0].pose.orientation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L498_C12", "label": "x =", "type": "assigned_variable", "loc": [498, 498], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.502, 0.001, 3, 0.87, 0.0, 190, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " x = fk_resp.pose_stamped[0].pose.position.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L499_C12", "label": "y =", "type": "assigned_variable", "loc": [499, 499], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.503, 0.001, 3, 0.87, 0.0909, 304, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " y = fk_resp.pose_stamped[0].pose.position.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L500_C12", "label": "z =", "type": "assigned_variable", "loc": [500, 500], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.504, 0.001, 3, 0.87, 0.1818, 859, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " z = fk_resp.pose_stamped[0].pose.position.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L501_C12", "label": "q1 =", "type": "assigned_variable", "loc": [501, 501], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.505, 0.001, 3, 0.87, 0.2727, 974, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q1 = fk_resp.pose_stamped[0].pose.orientation.x"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L502_C12", "label": "q2 =", "type": "assigned_variable", "loc": [502, 502], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.506, 0.001, 3, 0.87, 0.3636, 848, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q2 = fk_resp.pose_stamped[0].pose.orientation.y"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L503_C12", "label": "q3 =", "type": "assigned_variable", "loc": [503, 503], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.5071, 0.001, 3, 0.87, 0.4545, 718, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q3", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q3 = fk_resp.pose_stamped[0].pose.orientation.z"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L504_C12", "label": "q4 =", "type": "assigned_variable", "loc": [504, 504], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.5081, 0.001, 3, 0.87, 0.5455, 552, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q4", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q4 = fk_resp.pose_stamped[0].pose.orientation.w"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L505_C12", "label": "quat =", "type": "assigned_variable", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.5091, 0.001, 3, 0.87, 0.6364, 367, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = [q1,q2,q3,q4]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L508_C12", "label": "ret1 = transform_in_frame()", "type": "assigned_variable", "loc": [508, 508], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.5121, 0.001, 3, 0.87, 0.7273, 271, 3, 3, 0, 0, 114, 10, 1], "semantic": {"name": "ret1", "arg_names": [], "import_names": [], "rhs_call_name": "transform_in_frame", "annotation": ""}, "snippet": " ret1 = self.transform_in_frame([x,y,z], quat, self.off_point)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L509_C12", "label": "ret2 =", "type": "assigned_variable", "loc": [509, 509], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.5131, 0.001, 3, 0.87, 0.8182, 27, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "ret2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret2 = np.matrix(quat).T "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L511_C12", "label": "logerr()", "type": "expression", "loc": [511, 511], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [8, 3, 0.5151, 0.001, 3, 0.87, 0.9091, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Forward kinematics failed')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L512_C12", "label": "ret1, ret2 =", "type": "assigned_variable", "loc": [512, 512], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "vector": [14, 3, 0.5161, 0.001, 3, 0.87, 1.0, 138, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ret1, ret2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret1, ret2 = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L514_C8", "label": "return", "type": "return", "loc": [514, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "vector": [13, 2, 0.5181, 0.001, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret1, ret2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "label": "IK", "type": "function", "loc": [524, 569], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.5509, 0.0464, 1, 0.17, 0.4286, 719, 0, 5, 1, 0, 0, 0, 11], "semantic": {"name": "IK", "arg_names": ["self", "arm", "p", "rot", "q_guess"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def IK(self, arm, p, rot, q_guess):\n if arm != 1:\n arm = 0\n\n p = make_column(p)\n\n if rot.shape == (3, 3):\n quat = np.matrix(tr.matrix_to_quaternion(rot)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L525_C8", "label": "if", "type": "if", "loc": [525, 526], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [4, 2, 0.5297, 0.002, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L526_C12", "label": "arm =", "type": "assigned_variable", "loc": [526, 526], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L525_C8", "vector": [14, 3, 0.5302, 0.001, 3, 0.93, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L528_C8", "label": "p = make_column()", "type": "assigned_variable", "loc": [528, 528], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5323, 0.001, 2, 0.02, 0.05, 491, 3, 1, 0, 0, 304, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "make_column", "annotation": ""}, "snippet": " p = make_column(p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L530_C8", "label": "if", "type": "if", "loc": [530, 536], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [4, 2, 0.5373, 0.0071, 2, 0.02, 0.1, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot.shape == (3, 3):\n quat = np.matrix(tr.matrix_to_quaternion(rot)).T\n elif rot.shape == (4, 1):\n quat = make_column(rot)\n else:\n rospy.logerr('Inverse kinematics failed (bad rotation)')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L531_C12", "label": "quat =", "type": "assigned_variable", "loc": [531, 531], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L530_C8", "vector": [14, 3, 0.5353, 0.001, 3, 0.59, 0.0, 367, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " quat = np.matrix(tr.matrix_to_quaternion(rot)).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "label": "if", "type": "if", "loc": [532, 536], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L530_C8", "vector": [4, 3, 0.5383, 0.005, 3, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif rot.shape == (4, 1):\n quat = make_column(rot)\n else:\n rospy.logerr('Inverse kinematics failed (bad rotation)')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L533_C12", "label": "quat = make_column()", "type": "assigned_variable", "loc": [533, 533], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "vector": [14, 4, 0.5373, 0.001, 4, 0.09, 0.0, 367, 3, 1, 0, 0, 304, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "make_column", "annotation": ""}, "snippet": " quat = make_column(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L535_C12", "label": "logerr()", "type": "expression", "loc": [535, 535], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "vector": [8, 4, 0.5393, 0.001, 4, 0.09, 0.5, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Inverse kinematics failed (bad rotation)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L536_C12", "label": "return", "type": "return", "loc": [536, 536], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "vector": [13, 4, 0.5403, 0.001, 4, 0.09, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L539_C8", "label": "neg_off =", "type": "assigned_variable", "loc": [539, 539], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5433, 0.001, 2, 0.02, 0.15, 658, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "neg_off", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " neg_off = [-self.off_point[0],-self.off_point[1],-self.off_point[2]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L540_C8", "label": "transpos = transform_in_frame()", "type": "assigned_variable", "loc": [540, 540], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5444, 0.001, 2, 0.02, 0.2, 686, 3, 3, 0, 0, 114, 10, 1], "semantic": {"name": "transpos", "arg_names": [], "import_names": [], "rhs_call_name": "transform_in_frame", "annotation": ""}, "snippet": " transpos = self.transform_in_frame(p, quat, neg_off)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L542_C8", "label": "ik_req = GetPositionIKRequest()", "type": "assigned_variable", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5464, 0.001, 2, 0.02, 0.25, 578, 3, 0, 0, 0, 258, 10, 1], "semantic": {"name": "ik_req", "arg_names": [], "import_names": [], "rhs_call_name": "GetPositionIKRequest", "annotation": ""}, "snippet": " ik_req = GetPositionIKRequest()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L543_C8", "label": "ik_req.timeout = Duration()", "type": "assigned_variable", "loc": [543, 543], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5474, 0.001, 2, 0.02, 0.3, 460, 3, 1, 0, 0, 972, 10, 1], "semantic": {"name": "ik_req.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "Duration", "annotation": ""}, "snippet": " ik_req.timeout = rospy.Duration(5.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L544_C8", "label": "if", "type": "if", "loc": [544, 547], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [4, 2, 0.5499, 0.004, 2, 0.02, 0.35, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'\n else:\n ik_req.ik_request.ik_link_name = 'l_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L545_C12", "label": "ik_req.ik_request.ik_link_name =", "type": "assigned_variable", "loc": [545, 545], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L544_C8", "vector": [14, 3, 0.5494, 0.001, 3, 0.96, 0.0, 946, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.ik_link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_link_name = 'r_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L547_C12", "label": "ik_req.ik_request.ik_link_name =", "type": "assigned_variable", "loc": [547, 547], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L544_C8", "vector": [14, 3, 0.5514, 0.001, 3, 0.96, 1.0, 946, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.ik_link_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_link_name = 'l_wrist_roll_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L548_C8", "label": "ik_req.ik_request.pose_stamped.header.frame_id =", "type": "assigned_variable", "loc": [548, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5524, 0.001, 2, 0.02, 0.4, 10, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L550_C8", "label": "ik_req.ik_request.pose_stamped.pose.position.x =", "type": "assigned_variable", "loc": [550, 550], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5544, 0.001, 2, 0.02, 0.45, 232, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.position.x = transpos[0] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L551_C8", "label": "ik_req.ik_request.pose_stamped.pose.position.y =", "type": "assigned_variable", "loc": [551, 551], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5554, 0.001, 2, 0.02, 0.5, 833, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.position.y = transpos[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L552_C8", "label": "ik_req.ik_request.pose_stamped.pose.position.z =", "type": "assigned_variable", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5565, 0.001, 2, 0.02, 0.55, 394, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.position.z = transpos[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L554_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.x =", "type": "assigned_variable", "loc": [554, 554], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5585, 0.001, 2, 0.02, 0.6, 735, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L555_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.y =", "type": "assigned_variable", "loc": [555, 555], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5595, 0.001, 2, 0.02, 0.65, 92, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L556_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.z =", "type": "assigned_variable", "loc": [556, 556], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5605, 0.001, 2, 0.02, 0.7, 123, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L557_C8", "label": "ik_req.ik_request.pose_stamped.pose.orientation.w =", "type": "assigned_variable", "loc": [557, 557], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5615, 0.001, 2, 0.02, 0.75, 445, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.pose_stamped.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.pose_stamped.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L559_C8", "label": "ik_req.ik_request.ik_seed_state.joint_state.position =", "type": "assigned_variable", "loc": [559, 559], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5635, 0.001, 2, 0.02, 0.8, 864, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.ik_seed_state.joint_state.position", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_seed_state.joint_state.position = q_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L560_C8", "label": "ik_req.ik_request.ik_seed_state.joint_state.name =", "type": "assigned_variable", "loc": [560, 560], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5645, 0.001, 2, 0.02, 0.85, 736, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ik_req.ik_request.ik_seed_state.joint_state.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ik_req.ik_request.ik_seed_state.joint_state.name = self.joint_names_list[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L562_C8", "label": "ik_resp = call()", "type": "assigned_variable", "loc": [562, 562], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [14, 2, 0.5665, 0.001, 2, 0.02, 0.9, 598, 3, 1, 0, 0, 832, 10, 1], "semantic": {"name": "ik_resp", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " ik_resp = self.ik_srv[arm].call(ik_req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "label": "if", "type": "if", "loc": [563, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [4, 2, 0.5696, 0.005, 2, 0.02, 0.95, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ik_resp.error_code.val == ik_resp.error_code.SUCCESS:\n ret = list(ik_resp.solution.joint_state.position)\n else:\n rospy.logerr('Inverse kinematics failed')\n ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L564_C12", "label": "ret = list()", "type": "assigned_variable", "loc": [564, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "vector": [14, 3, 0.5685, 0.001, 3, 0.26, 0.0, 501, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " ret = list(ik_resp.solution.joint_state.position)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L566_C12", "label": "logerr()", "type": "expression", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "vector": [8, 3, 0.5706, 0.001, 3, 0.26, 0.5, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Inverse kinematics failed')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L567_C12", "label": "ret =", "type": "assigned_variable", "loc": [567, 567], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "vector": [14, 3, 0.5716, 0.001, 3, 0.26, 1.0, 501, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ret = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L569_C8", "label": "return", "type": "return", "loc": [569, 569], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "vector": [13, 2, 0.5736, 0.001, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "label": "can_move_arm", "type": "function", "loc": [577, 583], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.5847, 0.0071, 1, 0.17, 0.4571, 493, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "can_move_arm", "arg_names": ["self", "arm", "pos", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def can_move_arm(self, arm, pos, rot):\n begq = self.get_joint_angles(arm)\n endq = self.IK(arm, pos, rot, begq)\n if endq is None:\n return False\n else:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L578_C8", "label": "begq = get_joint_angles()", "type": "assigned_variable", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "vector": [14, 2, 0.5827, 0.001, 2, 0.78, 0.0, 405, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "begq", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " begq = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L579_C8", "label": "endq = IK()", "type": "assigned_variable", "loc": [579, 579], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "vector": [14, 2, 0.5837, 0.001, 2, 0.78, 0.5, 506, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "endq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " endq = self.IK(arm, pos, rot, begq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L580_C8", "label": "if", "type": "if", "loc": [580, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "vector": [4, 2, 0.5862, 0.004, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if endq is None:\n return False\n else:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L581_C12", "label": "return", "type": "return", "loc": [581, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L580_C8", "vector": [13, 3, 0.5857, 0.001, 3, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L583_C12", "label": "return", "type": "return", "loc": [583, 583], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L580_C8", "vector": [13, 3, 0.5877, 0.001, 3, 0.78, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "label": "move_arm", "type": "function", "loc": [592, 599], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6003, 0.0081, 1, 0.17, 0.4857, 236, 0, 6, 1, 0, 0, 0, 3], "semantic": {"name": "move_arm", "arg_names": ["self", "arm", "pos", "begq", "rot", "dur"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_arm(self, arm, pos, begq=None , rot=None, dur=4.0):\n if begq is None:\n temp, rot = self.FK(arm, begq)\n endq = self.IK(arm, pos, rot, begq)\n if endq is None:\n return False\n self.set_joint_angles(arm, endq, dur)\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L593_C8", "label": "if", "type": "if", "loc": [593, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "vector": [4, 2, 0.5983, 0.002, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if begq is None:\n temp, rot = self.FK(arm, begq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L594_C12", "label": "temp, rot = FK()", "type": "assigned_variable", "loc": [594, 594], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L593_C8", "vector": [14, 3, 0.5988, 0.001, 3, 0.56, 0.0, 163, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "temp, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " temp, rot = self.FK(arm, begq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L595_C8", "label": "endq = IK()", "type": "assigned_variable", "loc": [595, 595], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "vector": [14, 2, 0.5998, 0.001, 2, 0.97, 0.25, 506, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "endq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " endq = self.IK(arm, pos, rot, begq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L596_C8", "label": "if", "type": "if", "loc": [596, 597], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "vector": [4, 2, 0.6013, 0.002, 2, 0.97, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if endq is None:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L597_C12", "label": "return", "type": "return", "loc": [597, 597], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L596_C8", "vector": [13, 3, 0.6018, 0.001, 3, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L598_C8", "label": "set_joint_angles()", "type": "expression", "loc": [598, 598], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "vector": [8, 2, 0.6028, 0.001, 2, 0.97, 0.75, 718, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles", "annotation": ""}, "snippet": " self.set_joint_angles(arm, endq, dur)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L599_C8", "label": "return", "type": "return", "loc": [599, 599], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "vector": [13, 2, 0.6038, 0.001, 2, 0.97, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L601_C4", "label": "cancel_trajectory", "type": "function", "loc": [601, 602], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6064, 0.002, 1, 0.17, 0.5143, 492, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_trajectory", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def cancel_trajectory(self, arm):\n self.joint_action_client[arm].cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L602_C8", "label": "cancel_all_goals()", "type": "expression", "loc": [602, 602], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L601_C4", "vector": [8, 2, 0.6069, 0.001, 2, 0.75, 0.0, 699, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel_all_goals", "arg_names": [], "import_names": [], "rhs_call_name": "cancel_all_goals", "annotation": ""}, "snippet": " self.joint_action_client[arm].cancel_all_goals()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "label": "move_arm_trajectory", "type": "function", "loc": [616, 648], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6371, 0.0333, 1, 0.17, 0.5429, 904, 0, 7, 0, 0, 0, 0, 12], "semantic": {"name": "move_arm_trajectory", "arg_names": ["self", "arm", "pos_arr", "dur", "rot_arr", "dur_arr", "freeze_wrist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_arm_trajectory(self, arm, pos_arr, dur=1.,\n rot_arr=None, dur_arr=None, freeze_wrist=False):\n if dur_arr is None:\n dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]\n \n initq = self.get_joint_angles(arm)\n curq = initq\n q_arr = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L618_C8", "label": "if", "type": "if", "loc": [618, 619], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [4, 2, 0.6235, 0.002, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dur_arr is None:\n dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L619_C12", "label": "dur_arr =", "type": "assigned_variable", "loc": [619, 619], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L618_C8", "vector": [14, 3, 0.624, 0.001, 3, 0.53, 0.0, 653, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dur_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L621_C8", "label": "initq = get_joint_angles()", "type": "assigned_variable", "loc": [621, 621], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [14, 2, 0.626, 0.001, 2, 0.02, 0.1111, 165, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "initq", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " initq = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L622_C8", "label": "curq =", "type": "assigned_variable", "loc": [622, 622], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [14, 2, 0.627, 0.001, 2, 0.02, 0.2222, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curq = initq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L623_C8", "label": "q_arr =", "type": "assigned_variable", "loc": [623, 623], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [14, 2, 0.628, 0.001, 2, 0.02, 0.3333, 918, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_arr = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L624_C8", "label": "fails, trys =", "type": "assigned_variable", "loc": [624, 624], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [14, 2, 0.629, 0.001, 2, 0.02, 0.4444, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fails, trys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fails, trys = 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L625_C8", "label": "if", "type": "if", "loc": [625, 626], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [4, 2, 0.6305, 0.002, 2, 0.02, 0.5556, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot_arr is None:\n temp, rot = self.FK(arm, curq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L626_C12", "label": "temp, rot = FK()", "type": "assigned_variable", "loc": [626, 626], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L625_C8", "vector": [14, 3, 0.631, 0.001, 3, 0.75, 0.0, 163, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "temp, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " temp, rot = self.FK(arm, curq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "label": "for i", "type": "for", "loc": [628, 639], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [6, 2, 0.6386, 0.0121, 2, 0.02, 0.6667, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(pos_arr)):\n if rot_arr is None:\n cur_rot = rot\n else:\n cur_rot = rot_arr[i]\n nextq = self.IK(arm, pos_arr[i], cur_rot, curq)\n q_arr += [nextq]\n if nextq is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L629_C12", "label": "if", "type": "if", "loc": [629, 632], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "vector": [4, 3, 0.6356, 0.004, 3, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot_arr is None:\n cur_rot = rot\n else:\n cur_rot = rot_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L630_C16", "label": "cur_rot =", "type": "assigned_variable", "loc": [630, 630], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L629_C12", "vector": [14, 4, 0.6351, 0.001, 4, 0.56, 0.0, 473, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L632_C16", "label": "cur_rot =", "type": "assigned_variable", "loc": [632, 632], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L629_C12", "vector": [14, 4, 0.6371, 0.001, 4, 0.56, 1.0, 473, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_rot = rot_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L633_C12", "label": "nextq = IK()", "type": "assigned_variable", "loc": [633, 633], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "vector": [14, 3, 0.6381, 0.001, 3, 0.81, 0.3333, 859, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "nextq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " nextq = self.IK(arm, pos_arr[i], cur_rot, curq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L635_C12", "label": "if", "type": "if", "loc": [635, 636], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "vector": [4, 3, 0.6406, 0.002, 3, 0.81, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if nextq is None:\n fails += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L638_C12", "label": "if", "type": "if", "loc": [638, 639], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "vector": [4, 3, 0.6436, 0.002, 3, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not nextq is None:\n curq = nextq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L639_C16", "label": "curq =", "type": "assigned_variable", "loc": [639, 639], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L638_C12", "vector": [14, 4, 0.6442, 0.001, 4, 0.18, 0.0, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curq = nextq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L640_C8", "label": "log()", "type": "expression", "loc": [640, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [8, 2, 0.6452, 0.001, 2, 0.02, 0.7778, 432, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"IK Accuracy: %d/%d (%f)\" % (trys-fails, trys, (trys-fails)/float(trys)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L642_C8", "label": "if", "type": "if", "loc": [642, 646], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [4, 2, 0.6492, 0.005, 2, 0.02, 0.8889, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if freeze_wrist:\n for i in range(len(q_arr)):\n if not q_arr[i] is None:\n q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L643_C12", "label": "for i", "type": "for", "loc": [643, 646], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L642_C8", "vector": [6, 3, 0.6497, 0.004, 3, 0.0, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(q_arr)):\n if not q_arr[i] is None:\n q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L644_C16", "label": "if", "type": "if", "loc": [644, 646], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L643_C12", "vector": [4, 4, 0.6502, 0.003, 4, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not q_arr[i] is None:\n q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L645_C20", "label": "assign", "type": "assigned_variable", "loc": [645, 646], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L644_C16", "vector": [14, 5, 0.6507, 0.002, 5, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L648_C8", "label": "set_joint_angles_traj()", "type": "expression", "loc": [648, 648], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "vector": [8, 2, 0.6532, 0.001, 2, 0.02, 1.0, 572, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles_traj", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles_traj", "annotation": ""}, "snippet": " self.set_joint_angles_traj(arm, q_arr, dur_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L655_C4", "label": "end_effector_pos", "type": "function", "loc": [655, 657], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6613, 0.003, 1, 0.17, 0.5714, 889, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_effector_pos", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_effector_pos(self, arm):\n q = self.get_joint_angles(arm)\n return self.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L656_C8", "label": "q = get_joint_angles()", "type": "assigned_variable", "loc": [656, 656], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L655_C4", "vector": [14, 2, 0.6613, 0.001, 2, 0.77, 0.0, 516, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " q = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L657_C8", "label": "return", "type": "return", "loc": [657, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L655_C4", "vector": [13, 2, 0.6623, 0.001, 2, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.FK(arm, q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "label": "get_joint_angles", "type": "function", "loc": [664, 670], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6724, 0.0071, 1, 0.17, 0.6, 820, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_joint_angles", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_joint_angles(self, arm):\n if arm != 1:\n arm = 0\n self.arm_state_lock[arm].acquire()\n q = self.arm_angles[arm]\n self.arm_state_lock[arm].release()\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L665_C8", "label": "if", "type": "if", "loc": [665, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "vector": [4, 2, 0.6709, 0.002, 2, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L666_C12", "label": "arm =", "type": "assigned_variable", "loc": [666, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L665_C8", "vector": [14, 3, 0.6714, 0.001, 3, 0.9, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L667_C8", "label": "acquire()", "type": "expression", "loc": [667, 667], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "vector": [8, 2, 0.6724, 0.001, 2, 0.91, 0.25, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.arm_state_lock[arm].acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L668_C8", "label": "q =", "type": "assigned_variable", "loc": [668, 668], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "vector": [14, 2, 0.6734, 0.001, 2, 0.91, 0.5, 516, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = self.arm_angles[arm]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L669_C8", "label": "release()", "type": "expression", "loc": [669, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "vector": [8, 2, 0.6744, 0.001, 2, 0.91, 0.75, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.arm_state_lock[arm].release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L670_C8", "label": "return", "type": "return", "loc": [670, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "vector": [13, 2, 0.6754, 0.001, 2, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "label": "get_wrist_force", "type": "function", "loc": [674, 686], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6855, 0.0131, 1, 0.17, 0.6286, 854, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "get_wrist_force", "arg_names": ["self", "arm", "bias", "base_frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_wrist_force(self, arm, bias = True, base_frame = False):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n \n f = self.r_arm_ftc.read(without_bias = not bias)\n f = f[0:3, :]\n if base_frame:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L675_C8", "label": "if", "type": "if", "loc": [675, 677], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "vector": [4, 2, 0.6815, 0.003, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L676_C12", "label": "logerr()", "type": "expression", "loc": [676, 676], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L675_C8", "vector": [8, 3, 0.6815, 0.001, 3, 0.65, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L679_C8", "label": "f = read()", "type": "assigned_variable", "loc": [679, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "vector": [14, 2, 0.6845, 0.001, 2, 0.48, 0.25, 899, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " f = self.r_arm_ftc.read(without_bias = not bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L680_C8", "label": "f =", "type": "assigned_variable", "loc": [680, 680], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "vector": [14, 2, 0.6855, 0.001, 2, 0.48, 0.5, 899, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = f[0:3, :]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "label": "if", "type": "if", "loc": [681, 685], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "vector": [4, 2, 0.6885, 0.005, 2, 0.48, 0.75, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if base_frame:\n trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2', rospy.Time(0))\n rot = tr.quaternion_to_matrix(quat)\n f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L682_C12", "label": "trans, quat = lookupTransform()", "type": "assigned_variable", "loc": [682, 683], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "vector": [14, 3, 0.688, 0.002, 3, 0.58, 0.0, 441, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "trans, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " trans, quat = self.tf_lstnr.lookupTransform('/torso_lift_link',\n '/ft2', rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L684_C12", "label": "rot = quaternion_to_matrix()", "type": "assigned_variable", "loc": [684, 684], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "vector": [14, 3, 0.6895, 0.001, 3, 0.58, 0.5, 812, 3, 1, 0, 0, 149, 10, 1], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_to_matrix", "annotation": ""}, "snippet": " rot = tr.quaternion_to_matrix(quat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L685_C12", "label": "f =", "type": "assigned_variable", "loc": [685, 685], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "vector": [14, 3, 0.6905, 0.001, 3, 0.58, 1.0, 899, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " f = rot * f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L686_C8", "label": "return", "type": "return", "loc": [686, 686], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "vector": [13, 2, 0.6915, 0.001, 2, 0.48, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -f # the negative is intentional (Advait, Nov 24. 2010.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L688_C4", "label": "bias_wrist_ft", "type": "function", "loc": [688, 692], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.6956, 0.005, 1, 0.17, 0.6571, 604, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "bias_wrist_ft", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_wrist_ft(self, arm):\n if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')\n self.r_arm_ftc.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L689_C7", "label": "if", "type": "if", "loc": [689, 691], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L688_C4", "vector": [4, 2, 0.6956, 0.003, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 0:\n rospy.logerr('Unsupported arm: %d'%arm)\n raise RuntimeError('Unimplemented function')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L690_C11", "label": "logerr()", "type": "expression", "loc": [690, 690], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L689_C7", "vector": [8, 3, 0.6956, 0.001, 3, 0.23, 0.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "logerr", "arg_names": [], "import_names": [], "rhs_call_name": "logerr", "annotation": ""}, "snippet": " rospy.logerr('Unsupported arm: %d'%arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L692_C7", "label": "bias()", "type": "expression", "loc": [692, 692], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L688_C4", "vector": [8, 2, 0.6976, 0.001, 2, 0.54, 1.0, 354, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bias", "arg_names": [], "import_names": [], "rhs_call_name": "bias", "annotation": ""}, "snippet": " self.r_arm_ftc.bias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L695_C4", "label": "get_ee_jtt", "type": "function", "loc": [695, 699], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7026, 0.005, 1, 0.17, 0.6857, 15, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_ee_jtt", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ee_jtt(self, arm):\n if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L696_C8", "label": "if", "type": "if", "loc": [696, 699], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L695_C4", "vector": [4, 2, 0.7031, 0.004, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n return self.r_ee_pos, self.r_ee_rot\n else:\n return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L697_C12", "label": "return", "type": "return", "loc": [697, 697], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L696_C8", "vector": [13, 3, 0.7026, 0.001, 3, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_ee_pos, self.r_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L699_C12", "label": "return", "type": "return", "loc": [699, 699], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L696_C8", "vector": [13, 3, 0.7046, 0.001, 3, 0.54, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_ee_pos, self.l_ee_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L701_C4", "label": "get_cep_jtt", "type": "function", "loc": [701, 708], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7102, 0.0081, 1, 0.17, 0.7143, 532, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "get_cep_jtt", "arg_names": ["self", "arm", "hook_tip"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cep_jtt(self, arm, hook_tip = False):\n if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L702_C8", "label": "if", "type": "if", "loc": [702, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L701_C4", "vector": [4, 2, 0.7107, 0.0071, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot\n else:\n return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L703_C12", "label": "if", "type": "if", "loc": [703, 706], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L702_C8", "vector": [4, 3, 0.7102, 0.004, 3, 0.87, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hook_tip:\n return self.r_cep_pos_hooktip, self.r_cep_rot\n else:\n return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L704_C16", "label": "return", "type": "return", "loc": [704, 704], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L703_C12", "vector": [13, 4, 0.7097, 0.001, 4, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos_hooktip, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L706_C16", "label": "return", "type": "return", "loc": [706, 706], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L703_C12", "vector": [13, 4, 0.7117, 0.001, 4, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.r_cep_pos, self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L708_C12", "label": "return", "type": "return", "loc": [708, 708], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L702_C8", "vector": [13, 3, 0.7137, 0.001, 3, 0.87, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.l_cep_pos, self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "label": "set_cep_jtt", "type": "function", "loc": [711, 736], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7293, 0.0262, 1, 0.17, 0.7429, 820, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "set_cep_jtt", "arg_names": ["self", "arm", "p", "rot"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_cep_jtt(self, arm, p, rot=None):\n if arm != 1:\n arm = 0\n ps = PoseStamped()\n ps.header.stamp = rospy.rostime.get_rostime()\n ps.header.frame_id = 'torso_lift_link'\n \n ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L712_C8", "label": "if", "type": "if", "loc": [712, 713], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [4, 2, 0.7182, 0.002, 2, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm != 1:\n arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L713_C12", "label": "arm =", "type": "assigned_variable", "loc": [713, 713], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L712_C8", "vector": [14, 3, 0.7188, 0.001, 3, 0.47, 0.0, 413, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L714_C8", "label": "ps = PoseStamped()", "type": "assigned_variable", "loc": [714, 714], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7198, 0.001, 2, 0.01, 0.0769, 232, 3, 0, 0, 0, 226, 10, 1], "semantic": {"name": "ps", "arg_names": [], "import_names": [], "rhs_call_name": "PoseStamped", "annotation": ""}, "snippet": " ps = PoseStamped()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L715_C8", "label": "ps.header.stamp = get_rostime()", "type": "assigned_variable", "loc": [715, 715], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7208, 0.001, 2, 0.01, 0.1538, 161, 3, 0, 0, 0, 173, 10, 1], "semantic": {"name": "ps.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "get_rostime", "annotation": ""}, "snippet": " ps.header.stamp = rospy.rostime.get_rostime()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L716_C8", "label": "ps.header.frame_id =", "type": "assigned_variable", "loc": [716, 716], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7218, 0.001, 2, 0.01, 0.2308, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ps.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.header.frame_id = 'torso_lift_link'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L718_C8", "label": "ps.pose.position.x =", "type": "assigned_variable", "loc": [718, 718], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7238, 0.001, 2, 0.01, 0.3077, 782, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.x = p[0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L719_C8", "label": "ps.pose.position.y =", "type": "assigned_variable", "loc": [719, 719], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7248, 0.001, 2, 0.01, 0.3846, 661, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.y = p[1,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L720_C8", "label": "ps.pose.position.z =", "type": "assigned_variable", "loc": [720, 720], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7258, 0.001, 2, 0.01, 0.4615, 771, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.position.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.position.z = p[2,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L722_C8", "label": "if", "type": "if", "loc": [722, 726], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [4, 2, 0.7298, 0.005, 2, 0.01, 0.5385, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot == None:\n if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L723_C12", "label": "if", "type": "if", "loc": [723, 726], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L722_C8", "vector": [4, 3, 0.7303, 0.004, 3, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n rot = self.r_cep_rot\n else:\n rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L724_C16", "label": "rot =", "type": "assigned_variable", "loc": [724, 724], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L723_C12", "vector": [14, 4, 0.7298, 0.001, 4, 0.69, 0.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.r_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L726_C16", "label": "rot =", "type": "assigned_variable", "loc": [726, 726], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L723_C12", "vector": [14, 4, 0.7319, 0.001, 4, 0.69, 1.0, 812, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot = self.l_cep_rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L728_C8", "label": "quat = matrix_to_quaternion()", "type": "assigned_variable", "loc": [728, 728], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7339, 0.001, 2, 0.01, 0.6154, 367, 3, 1, 0, 0, 615, 10, 1], "semantic": {"name": "quat", "arg_names": [], "import_names": [], "rhs_call_name": "matrix_to_quaternion", "annotation": ""}, "snippet": " quat = tr.matrix_to_quaternion(rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L729_C8", "label": "ps.pose.orientation.x =", "type": "assigned_variable", "loc": [729, 729], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7349, 0.001, 2, 0.01, 0.6923, 628, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.x", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.x = quat[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L730_C8", "label": "ps.pose.orientation.y =", "type": "assigned_variable", "loc": [730, 730], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7359, 0.001, 2, 0.01, 0.7692, 848, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.y", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.y = quat[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L731_C8", "label": "ps.pose.orientation.z =", "type": "assigned_variable", "loc": [731, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7369, 0.001, 2, 0.01, 0.8462, 126, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.z", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.z = quat[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L732_C8", "label": "ps.pose.orientation.w =", "type": "assigned_variable", "loc": [732, 732], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [14, 2, 0.7379, 0.001, 2, 0.01, 0.9231, 163, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ps.pose.orientation.w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ps.pose.orientation.w = quat[3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L733_C8", "label": "if", "type": "if", "loc": [733, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "vector": [4, 2, 0.7404, 0.004, 2, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arm == 0:\n self.r_arm_cart_pub.publish(ps)\n else:\n self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L734_C12", "label": "publish()", "type": "expression", "loc": [734, 734], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L733_C8", "vector": [8, 3, 0.7399, 0.001, 3, 0.24, 0.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.r_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L736_C12", "label": "publish()", "type": "expression", "loc": [736, 736], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L733_C8", "vector": [8, 3, 0.7419, 0.001, 3, 0.24, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.l_arm_cart_pub.publish(ps)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "label": "go_cep_jtt", "type": "function", "loc": [739, 750], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7505, 0.0121, 1, 0.17, 0.7714, 219, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "go_cep_jtt", "arg_names": ["self", "arm", "p"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def go_cep_jtt(self, arm, p):\n step_size = 0.01\n sleep_time = 0.1\n cep_p, cep_rot = self.get_cep_jtt(arm)\n unit_vec = (p-cep_p)\n unit_vec = unit_vec / np.linalg.norm(unit_vec)\n while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L740_C8", "label": "step_size =", "type": "assigned_variable", "loc": [740, 740], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [14, 2, 0.746, 0.001, 2, 0.19, 0.0, 764, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "step_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " step_size = 0.01"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L741_C8", "label": "sleep_time =", "type": "assigned_variable", "loc": [741, 741], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [14, 2, 0.747, 0.001, 2, 0.19, 0.1429, 355, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "sleep_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sleep_time = 0.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L742_C8", "label": "cep_p, cep_rot = get_cep_jtt()", "type": "assigned_variable", "loc": [742, 742], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [14, 2, 0.748, 0.001, 2, 0.19, 0.2857, 891, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "cep_p, cep_rot", "arg_names": [], "import_names": [], "rhs_call_name": "get_cep_jtt", "annotation": ""}, "snippet": " cep_p, cep_rot = self.get_cep_jtt(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L743_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [743, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [14, 2, 0.749, 0.001, 2, 0.19, 0.4286, 372, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = (p-cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L744_C8", "label": "unit_vec =", "type": "assigned_variable", "loc": [744, 744], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [14, 2, 0.75, 0.001, 2, 0.19, 0.5714, 372, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "unit_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " unit_vec = unit_vec / np.linalg.norm(unit_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L745_C8", "label": "while", "type": "while", "loc": [745, 748], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [5, 2, 0.7525, 0.004, 2, 0.19, 0.7143, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while np.linalg.norm(p-cep_p) > step_size:\n cep_p += unit_vec * step_size\n self.set_cep_jtt(arm, cep_p)\n rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L747_C12", "label": "set_cep_jtt()", "type": "expression", "loc": [747, 747], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L745_C8", "vector": [8, 3, 0.753, 0.001, 3, 0.88, 0.0, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, cep_p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L748_C12", "label": "sleep()", "type": "expression", "loc": [748, 748], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L745_C8", "vector": [8, 3, 0.754, 0.001, 3, 0.88, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L749_C8", "label": "set_cep_jtt()", "type": "expression", "loc": [749, 749], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [8, 2, 0.755, 0.001, 2, 0.19, 0.8571, 820, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "set_cep_jtt", "annotation": ""}, "snippet": " self.set_cep_jtt(arm, p)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L750_C8", "label": "sleep()", "type": "expression", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "vector": [8, 2, 0.756, 0.001, 2, 0.19, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(sleep_time)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L762_C4", "label": "move_gripper", "type": "function", "loc": [762, 763], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7686, 0.002, 1, 0.17, 0.8, 327, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "move_gripper", "arg_names": ["self", "arm", "amount", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def move_gripper(self, arm, amount=0.08, effort = 15):\n self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L763_C8", "label": "send_goal()", "type": "expression", "loc": [763, 763], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L762_C4", "vector": [8, 2, 0.7692, 0.001, 2, 0.11, 0.0, 184, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_goal", "arg_names": [], "import_names": [], "rhs_call_name": "send_goal", "annotation": ""}, "snippet": " self.gripper_action_client[arm].send_goal(Pr2GripperCommandGoal(Pr2GripperCommand(position=amount, max_effort = effort)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L769_C4", "label": "open_gripper", "type": "function", "loc": [769, 770], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7757, 0.002, 1, 0.17, 0.8286, 833, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "open_gripper", "arg_names": ["self", "arm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open_gripper(self, arm):\n self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L770_C8", "label": "move_gripper()", "type": "expression", "loc": [770, 770], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L769_C4", "vector": [8, 2, 0.7762, 0.001, 2, 0.72, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.08, -1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L776_C4", "label": "close_gripper", "type": "function", "loc": [776, 777], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.7828, 0.002, 1, 0.17, 0.8571, 807, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "close_gripper", "arg_names": ["self", "arm", "effort"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close_gripper(self, arm, effort = 15):\n self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L777_C8", "label": "move_gripper()", "type": "expression", "loc": [777, 777], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L776_C4", "vector": [8, 2, 0.7833, 0.001, 2, 0.46, 0.0, 327, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "move_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "move_gripper", "annotation": ""}, "snippet": " self.move_gripper(arm, 0.0, effort)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "label": "smooth_linear_arm_trajectory", "type": "function", "loc": [790, 850], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.8266, 0.0615, 1, 0.17, 0.8857, 310, 0, 9, 1, 0, 0, 0, 14], "semantic": {"name": "smooth_linear_arm_trajectory", "arg_names": ["self", "arm", "dist", "dir", "max_jerk", "delta", "dur", "freeze_wrist", "is_grasp_biased"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def smooth_linear_arm_trajectory(self, arm, dist, dir=(0.,0.,-1.), max_jerk=0.25, \n delta=0.005, dur=None,\n freeze_wrist=True, is_grasp_biased=True):\n\n ####################################################\n # Smooth trajectory functions\n def _smooth_traj_pos(t, k, T):\n return -k / T**3 * np.sin(T * t) + k / T**2 * t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L796_C8", "label": "_smooth_traj_pos", "type": "function", "loc": [796, 797], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [2, 2, 0.8029, 0.002, 2, 0.79, 0.0, 247, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_smooth_traj_pos", "arg_names": ["t", "k", "T"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _smooth_traj_pos(t, k, T):\n return -k / T**3 * np.sin(T * t) + k / T**2 * t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L797_C12", "label": "return", "type": "return", "loc": [797, 797], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L796_C8", "vector": [13, 3, 0.8034, 0.001, 3, 0.7, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -k / T**3 * np.sin(T * t) + k / T**2 * t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L799_C8", "label": "_smooth_traj_vel", "type": "function", "loc": [799, 800], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [2, 2, 0.8059, 0.002, 2, 0.79, 0.0667, 748, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_smooth_traj_vel", "arg_names": ["t", "k", "T"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _smooth_traj_vel(t, k, T):\n return -k / T**2 * np.cos(T * t) + k / T**2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L800_C12", "label": "return", "type": "return", "loc": [800, 800], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L799_C8", "vector": [13, 3, 0.8065, 0.001, 3, 0.98, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -k / T**2 * np.cos(T * t) + k / T**2 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L802_C8", "label": "_smooth_traj_acc", "type": "function", "loc": [802, 803], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [2, 2, 0.809, 0.002, 2, 0.79, 0.1333, 425, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_smooth_traj_acc", "arg_names": ["t", "k", "T"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _smooth_traj_acc(t, k, T):\n return k / T * np.sin(T * t) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L803_C12", "label": "return", "type": "return", "loc": [803, 803], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L802_C8", "vector": [13, 3, 0.8095, 0.001, 3, 0.97, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return k / T * np.sin(T * t) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L806_C8", "label": "_smooth_traj_time", "type": "function", "loc": [806, 807], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [2, 2, 0.813, 0.002, 2, 0.79, 0.2, 807, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_smooth_traj_time", "arg_names": ["l", "k"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _smooth_traj_time(l, k):\n return np.power(4 * np.pi**2 * l / k, 1./3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L807_C12", "label": "return", "type": "return", "loc": [807, 807], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L806_C8", "vector": [13, 3, 0.8135, 0.001, 3, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.power(4 * np.pi**2 * l / k, 1./3.)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L809_C8", "label": "_interpolate_traj", "type": "function", "loc": [809, 810], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [2, 2, 0.816, 0.002, 2, 0.79, 0.2667, 633, 0, 6, 1, 0, 0, 0, 2], "semantic": {"name": "_interpolate_traj", "arg_names": ["traj", "k", "T", "num", "begt", "endt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _interpolate_traj(traj, k, T, num=10, begt=0., endt=1.):\n return [traj(t,k,T) for t in np.linspace(begt, endt, num)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L810_C12", "label": "return", "type": "return", "loc": [810, 810], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L809_C8", "vector": [13, 3, 0.8165, 0.001, 3, 0.44, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [traj(t,k,T) for t in np.linspace(begt, endt, num)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L815_C8", "label": "traj_vec =", "type": "assigned_variable", "loc": [815, 815], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8216, 0.001, 2, 0.79, 0.3333, 329, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "traj_vec", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " traj_vec = [x/np.sqrt(np.vdot(dir,dir)) for x in dir]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L817_C8", "label": "num_steps =", "type": "assigned_variable", "loc": [817, 817], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8236, 0.001, 2, 0.79, 0.4, 40, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "num_steps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " num_steps = dist / delta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L819_C8", "label": "trajt = _smooth_traj_time()", "type": "assigned_variable", "loc": [819, 819], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8256, 0.001, 2, 0.79, 0.4667, 482, 3, 2, 0, 0, 807, 10, 1], "semantic": {"name": "trajt", "arg_names": [], "import_names": [], "rhs_call_name": "_smooth_traj_time", "annotation": ""}, "snippet": " trajt = _smooth_traj_time(dist, max_jerk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L820_C8", "label": "period =", "type": "assigned_variable", "loc": [820, 820], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8266, 0.001, 2, 0.79, 0.5333, 297, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "period", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " period = 2. * np.pi / trajt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L824_C8", "label": "traj_pos_mult = _interpolate_traj()", "type": "assigned_variable", "loc": [824, 825], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8311, 0.002, 2, 0.79, 0.6, 232, 3, 6, 0, 0, 633, 10, 1], "semantic": {"name": "traj_pos_mult", "arg_names": [], "import_names": [], "rhs_call_name": "_interpolate_traj", "annotation": ""}, "snippet": " traj_pos_mult = _interpolate_traj(_smooth_traj_pos, max_jerk, period, \n num_steps, 0., trajt) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L832_C8", "label": "cart_pos_traj =", "type": "assigned_variable", "loc": [832, 832], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8387, 0.001, 2, 0.79, 0.6667, 269, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cart_pos_traj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cart_pos_traj = [(a*traj_vec[0],a*traj_vec[1],a*traj_vec[2]) for a in traj_pos_mult]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L836_C8", "label": "cur_pos, cur_rot = FK()", "type": "assigned_variable", "loc": [836, 836], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8427, 0.001, 2, 0.79, 0.7333, 610, 3, 2, 0, 0, 252, 10, 2], "semantic": {"name": "cur_pos, cur_rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " cur_pos, cur_rot = self.FK(arm, self.get_joint_angles(arm))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L838_C8", "label": "arm_traj =", "type": "assigned_variable", "loc": [838, 839], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [14, 2, 0.8453, 0.002, 2, 0.79, 0.8, 797, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "arm_traj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arm_traj = [(ct[0] + cur_pos[0], ct[1] + cur_pos[1],\n ct[2] + cur_pos[2]) for ct in cart_pos_traj]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L840_C8", "label": "if", "type": "if", "loc": [840, 841], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [4, 2, 0.8473, 0.002, 2, 0.79, 0.8667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dur is None:\n dur = trajt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L841_C12", "label": "dur =", "type": "assigned_variable", "loc": [841, 841], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L840_C8", "vector": [14, 3, 0.8478, 0.001, 3, 0.75, 0.0, 45, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dur", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dur = trajt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L843_C8", "label": "if", "type": "if", "loc": [843, 847], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [4, 2, 0.8518, 0.005, 2, 0.79, 0.9333, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_grasp_biased:\n self.grasp_biased_move_arm_trajectory(arm, arm_traj, dur, \n freeze_wrist=freeze_wrist)\n else:\n self.move_arm_trajectory(arm, arm_traj, dur, freeze_wrist=freeze_wrist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L844_C12", "label": "grasp_biased_move_arm_trajectory()", "type": "expression", "loc": [844, 845], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L843_C8", "vector": [8, 3, 0.8513, 0.002, 3, 0.85, 0.0, 452, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "grasp_biased_move_arm_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_biased_move_arm_trajectory", "annotation": ""}, "snippet": " self.grasp_biased_move_arm_trajectory(arm, arm_traj, dur, \n freeze_wrist=freeze_wrist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L847_C12", "label": "move_arm_trajectory()", "type": "expression", "loc": [847, 847], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L843_C8", "vector": [8, 3, 0.8538, 0.001, 3, 0.85, 1.0, 904, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "move_arm_trajectory", "arg_names": [], "import_names": [], "rhs_call_name": "move_arm_trajectory", "annotation": ""}, "snippet": " self.move_arm_trajectory(arm, arm_traj, dur, freeze_wrist=freeze_wrist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L850_C8", "label": "return", "type": "return", "loc": [850, 850], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "vector": [13, 2, 0.8569, 0.001, 2, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dur"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "label": "bias_guess", "type": "function", "loc": [852, 864], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.8649, 0.0131, 1, 0.17, 0.9143, 771, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "bias_guess", "arg_names": ["self", "q", "joints_bias", "bias_radius"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bias_guess(self, q, joints_bias, bias_radius):\n if bias_radius == 0.0:\n return q\n max_angs = np.array([.69, 1.33, 0.79, 0.0, 1000000.0, 0.0, 1000000.0])\n min_angs = np.array([-2.27, -.54, -3.9, -2.34, -1000000.0, -2.15, -1000000.0])\n q_off = bias_radius * np.array(joints_bias) / np.linalg.norm(joints_bias)\n angs = np.array(q) + q_off\n for i in range(7):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L853_C8", "label": "if", "type": "if", "loc": [853, 854], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [4, 2, 0.8604, 0.002, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bias_radius == 0.0:\n return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L854_C12", "label": "return", "type": "return", "loc": [854, 854], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L853_C8", "vector": [13, 3, 0.8609, 0.001, 3, 0.93, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L855_C8", "label": "max_angs = array()", "type": "assigned_variable", "loc": [855, 855], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [14, 2, 0.8619, 0.001, 2, 0.4, 0.1667, 14, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "max_angs", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " max_angs = np.array([.69, 1.33, 0.79, 0.0, 1000000.0, 0.0, 1000000.0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L856_C8", "label": "min_angs = array()", "type": "assigned_variable", "loc": [856, 856], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [14, 2, 0.8629, 0.001, 2, 0.4, 0.3333, 386, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "min_angs", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " min_angs = np.array([-2.27, -.54, -3.9, -2.34, -1000000.0, -2.15, -1000000.0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L857_C8", "label": "q_off =", "type": "assigned_variable", "loc": [857, 857], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [14, 2, 0.8639, 0.001, 2, 0.4, 0.5, 902, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "q_off", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_off = bias_radius * np.array(joints_bias) / np.linalg.norm(joints_bias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L858_C8", "label": "angs =", "type": "assigned_variable", "loc": [858, 858], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [14, 2, 0.8649, 0.001, 2, 0.4, 0.6667, 510, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angs = np.array(q) + q_off"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L859_C8", "label": "for i", "type": "for", "loc": [859, 863], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [6, 2, 0.8679, 0.005, 2, 0.4, 0.8333, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(7):\n if angs[i] > max_angs[i]:\n angs[i] = max_angs[i]\n elif angs[i] < min_angs[i]:\n angs[i] = min_angs[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L860_C12", "label": "if", "type": "if", "loc": [860, 863], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L859_C8", "vector": [4, 3, 0.8684, 0.004, 3, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if angs[i] > max_angs[i]:\n angs[i] = max_angs[i]\n elif angs[i] < min_angs[i]:\n angs[i] = min_angs[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L861_C16", "label": "assign", "type": "assigned_variable", "loc": [861, 861], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L860_C12", "vector": [14, 4, 0.8679, 0.001, 4, 0.96, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angs[i] = max_angs[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L862_C12", "label": "if", "type": "if", "loc": [862, 863], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L860_C12", "vector": [4, 4, 0.8695, 0.002, 4, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif angs[i] < min_angs[i]:\n angs[i] = min_angs[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L863_C16", "label": "assign", "type": "assigned_variable", "loc": [863, 863], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L862_C12", "vector": [14, 5, 0.87, 0.001, 5, 0.31, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angs[i] = min_angs[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L864_C8", "label": "return", "type": "return", "loc": [864, 864], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "vector": [13, 2, 0.871, 0.001, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return angs.tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "label": "grasp_biased_IK", "type": "function", "loc": [868, 873], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.8775, 0.006, 1, 0.17, 0.9429, 123, 0, 8, 1, 0, 0, 0, 4], "semantic": {"name": "grasp_biased_IK", "arg_names": ["self", "arm", "pos", "rot", "q_guess", "joints_bias", "bias_radius", "num_iters"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_biased_IK(self, arm, pos, rot, q_guess, joints_bias=[0.]*7, bias_radius=0., num_iters=5):\n angs = q_guess\n for i in range(num_iters):\n angs = self.IK(arm, pos, rot, angs)\n angs = self.bias_guess(angs, joints_bias, bias_radius)\n return self.IK(arm, pos, rot, angs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L869_C8", "label": "angs =", "type": "assigned_variable", "loc": [869, 869], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "vector": [14, 2, 0.876, 0.001, 2, 0.49, 0.0, 510, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " angs = q_guess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L870_C8", "label": "for i", "type": "for", "loc": [870, 872], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "vector": [6, 2, 0.878, 0.003, 2, 0.49, 0.5, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(num_iters):\n angs = self.IK(arm, pos, rot, angs)\n angs = self.bias_guess(angs, joints_bias, bias_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L871_C12", "label": "angs = IK()", "type": "assigned_variable", "loc": [871, 871], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L870_C8", "vector": [14, 3, 0.878, 0.001, 3, 0.72, 0.0, 510, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " angs = self.IK(arm, pos, rot, angs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L872_C12", "label": "angs = bias_guess()", "type": "assigned_variable", "loc": [872, 872], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L870_C8", "vector": [14, 3, 0.879, 0.001, 3, 0.72, 1.0, 510, 3, 3, 0, 0, 771, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "bias_guess", "annotation": ""}, "snippet": " angs = self.bias_guess(angs, joints_bias, bias_radius)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L873_C8", "label": "return", "type": "return", "loc": [873, 873], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "vector": [13, 2, 0.88, 0.001, 2, 0.49, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.IK(arm, pos, rot, angs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "label": "grasp_biased_move_arm", "type": "function", "loc": [877, 882], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.8866, 0.006, 1, 0.17, 0.9714, 323, 0, 6, 0, 0, 0, 0, 4], "semantic": {"name": "grasp_biased_move_arm", "arg_names": ["self", "arm", "pos", "rot", "dur", "num_iters"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_biased_move_arm(self, arm, pos, rot=None, dur=4.0, num_iters=20):\n if rot is None:\n temp, rot = self.FK(arm, begq)\n angs = self.get_joint_angles(arm)\n angs = self.grasp_biased_IK(arm, pos, rot, angs)\n self.set_joint_angles(arm, angs, dur)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L878_C8", "label": "if", "type": "if", "loc": [878, 879], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "vector": [4, 2, 0.8856, 0.002, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot is None:\n temp, rot = self.FK(arm, begq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L879_C12", "label": "temp, rot = FK()", "type": "assigned_variable", "loc": [879, 879], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L878_C8", "vector": [14, 3, 0.8861, 0.001, 3, 0.35, 0.0, 163, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "temp, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " temp, rot = self.FK(arm, begq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L880_C8", "label": "angs = get_joint_angles()", "type": "assigned_variable", "loc": [880, 880], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "vector": [14, 2, 0.8871, 0.001, 2, 0.89, 0.3333, 510, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " angs = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L881_C8", "label": "angs = grasp_biased_IK()", "type": "assigned_variable", "loc": [881, 881], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "vector": [14, 2, 0.8881, 0.001, 2, 0.89, 0.6667, 510, 3, 4, 0, 0, 123, 10, 1], "semantic": {"name": "angs", "arg_names": [], "import_names": [], "rhs_call_name": "grasp_biased_IK", "annotation": ""}, "snippet": " angs = self.grasp_biased_IK(arm, pos, rot, angs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L882_C8", "label": "set_joint_angles()", "type": "expression", "loc": [882, 882], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "vector": [8, 2, 0.8891, 0.001, 2, 0.89, 1.0, 718, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles", "annotation": ""}, "snippet": " self.set_joint_angles(arm, angs, dur)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "label": "grasp_biased_move_arm_trajectory", "type": "function", "loc": [896, 933], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "vector": [2, 1, 0.9219, 0.0383, 1, 0.17, 1.0, 452, 0, 7, 0, 0, 0, 0, 16], "semantic": {"name": "grasp_biased_move_arm_trajectory", "arg_names": ["self", "arm", "pos_arr", "dur", "rot_arr", "dur_arr", "freeze_wrist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def grasp_biased_move_arm_trajectory(self, arm, pos_arr, dur=1.,\n rot_arr=None, dur_arr=None, freeze_wrist=False):\n bias_vec = np.array([0., -1., -1., 0., 0., 1., 0.])\n q_radius = 0.012 # Calculated as q_radius = arctan( delta / wrist_flex_length )\n q_off = q_radius * bias_vec / np.linalg.norm(bias_vec)\n\n if dur_arr is None:\n dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L898_C8", "label": "bias_vec = array()", "type": "assigned_variable", "loc": [898, 898], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9052, 0.001, 2, 0.71, 0.0, 824, 3, 1, 0, 0, 80, 10, 1], "semantic": {"name": "bias_vec", "arg_names": [], "import_names": [], "rhs_call_name": "array", "annotation": ""}, "snippet": " bias_vec = np.array([0., -1., -1., 0., 0., 1., 0.])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L899_C8", "label": "q_radius =", "type": "assigned_variable", "loc": [899, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9062, 0.001, 2, 0.71, 0.0833, 644, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "q_radius", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_radius = 0.012 # Calculated as q_radius = arctan( delta / wrist_flex_length )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L900_C8", "label": "q_off =", "type": "assigned_variable", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9073, 0.001, 2, 0.71, 0.1667, 902, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "q_off", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_off = q_radius * bias_vec / np.linalg.norm(bias_vec)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L902_C8", "label": "if", "type": "if", "loc": [902, 903], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [4, 2, 0.9098, 0.002, 2, 0.71, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dur_arr is None:\n dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L903_C12", "label": "dur_arr =", "type": "assigned_variable", "loc": [903, 903], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L902_C8", "vector": [14, 3, 0.9103, 0.001, 3, 0.58, 0.0, 653, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dur_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dur_arr = np.linspace(0., dur, len(pos_arr) + 1)[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L905_C8", "label": "initq = get_joint_angles()", "type": "assigned_variable", "loc": [905, 905], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9123, 0.001, 2, 0.71, 0.3333, 165, 3, 1, 0, 0, 820, 10, 1], "semantic": {"name": "initq", "arg_names": [], "import_names": [], "rhs_call_name": "get_joint_angles", "annotation": ""}, "snippet": " initq = self.get_joint_angles(arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L906_C8", "label": "curq =", "type": "assigned_variable", "loc": [906, 906], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9133, 0.001, 2, 0.71, 0.4167, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curq = initq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L907_C8", "label": "q_arr =", "type": "assigned_variable", "loc": [907, 907], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9143, 0.001, 2, 0.71, 0.5, 918, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q_arr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_arr = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L908_C8", "label": "fails, trys =", "type": "assigned_variable", "loc": [908, 908], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [14, 2, 0.9153, 0.001, 2, 0.71, 0.5833, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "fails, trys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fails, trys = 0, 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L909_C8", "label": "if", "type": "if", "loc": [909, 910], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [4, 2, 0.9168, 0.002, 2, 0.71, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot_arr is None:\n temp, rot = self.FK(arm, curq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L910_C12", "label": "temp, rot = FK()", "type": "assigned_variable", "loc": [910, 910], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L909_C8", "vector": [14, 3, 0.9173, 0.001, 3, 0.05, 0.0, 163, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "temp, rot", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " temp, rot = self.FK(arm, curq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "label": "for i", "type": "for", "loc": [912, 924], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [6, 2, 0.9254, 0.0131, 2, 0.71, 0.75, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(pos_arr)):\n if rot_arr is None:\n cur_rot = rot\n else:\n cur_rot = rot_arr[i]\n q_guess = (np.array(curq) + q_off).tolist()\n nextq = self.IK(arm, pos_arr[i], cur_rot, q_guess)\n q_arr += [nextq]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L913_C12", "label": "if", "type": "if", "loc": [913, 916], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "vector": [4, 3, 0.9219, 0.004, 3, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rot_arr is None:\n cur_rot = rot\n else:\n cur_rot = rot_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L914_C16", "label": "cur_rot =", "type": "assigned_variable", "loc": [914, 914], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L913_C12", "vector": [14, 4, 0.9214, 0.001, 4, 0.15, 0.0, 473, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_rot = rot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L916_C16", "label": "cur_rot =", "type": "assigned_variable", "loc": [916, 916], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L913_C12", "vector": [14, 4, 0.9234, 0.001, 4, 0.15, 1.0, 473, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cur_rot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cur_rot = rot_arr[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L917_C12", "label": "q_guess = tolist()", "type": "assigned_variable", "loc": [917, 917], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "vector": [14, 3, 0.9244, 0.001, 3, 0.81, 0.25, 993, 3, 0, 0, 0, 185, 10, 2], "semantic": {"name": "q_guess", "arg_names": [], "import_names": [], "rhs_call_name": "tolist", "annotation": ""}, "snippet": " q_guess = (np.array(curq) + q_off).tolist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L918_C12", "label": "nextq = IK()", "type": "assigned_variable", "loc": [918, 918], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "vector": [14, 3, 0.9254, 0.001, 3, 0.81, 0.5, 859, 3, 4, 0, 0, 719, 10, 1], "semantic": {"name": "nextq", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " nextq = self.IK(arm, pos_arr[i], cur_rot, q_guess)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L920_C12", "label": "if", "type": "if", "loc": [920, 921], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "vector": [4, 3, 0.9279, 0.002, 3, 0.81, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if nextq is None:\n fails += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L923_C12", "label": "if", "type": "if", "loc": [923, 924], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "vector": [4, 3, 0.9309, 0.002, 3, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not nextq is None:\n curq = nextq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L924_C16", "label": "curq =", "type": "assigned_variable", "loc": [924, 924], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L923_C12", "vector": [14, 4, 0.9315, 0.001, 4, 0.11, 0.0, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "curq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " curq = nextq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L925_C8", "label": "log()", "type": "expression", "loc": [925, 925], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [8, 2, 0.9325, 0.001, 2, 0.71, 0.8333, 432, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"IK Accuracy: %d/%d (%f)\" % (trys-fails, trys, (trys-fails)/float(trys)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L927_C8", "label": "if", "type": "if", "loc": [927, 931], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [4, 2, 0.9365, 0.005, 2, 0.71, 0.9167, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if freeze_wrist:\n for i in range(len(q_arr)):\n if not q_arr[i] is None:\n q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L928_C12", "label": "for i", "type": "for", "loc": [928, 931], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L927_C8", "vector": [6, 3, 0.937, 0.004, 3, 0.71, 0.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(len(q_arr)):\n if not q_arr[i] is None:\n q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L929_C16", "label": "if", "type": "if", "loc": [929, 931], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L928_C12", "vector": [4, 4, 0.9375, 0.003, 4, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not q_arr[i] is None:\n q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L930_C20", "label": "assign", "type": "assigned_variable", "loc": [930, 931], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L929_C16", "vector": [14, 5, 0.938, 0.002, 5, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q_arr[i] = (q_arr[i][0], q_arr[i][1], q_arr[i][2], q_arr[i][3],\n q_arr[i][4], q_arr[i][5], initq[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L933_C8", "label": "set_joint_angles_traj()", "type": "expression", "loc": [933, 933], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "vector": [8, 2, 0.9405, 0.001, 2, 0.71, 1.0, 572, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_joint_angles_traj", "arg_names": [], "import_names": [], "rhs_call_name": "set_joint_angles_traj", "annotation": ""}, "snippet": " self.set_joint_angles_traj(arm, q_arr, dur_arr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "label": "if", "type": "if", "loc": [935, 985], "level": 0, "parent": null, "vector": [4, 0, 0.9677, 0.0514, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 21], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rospy.init_node(node_name, anonymous = True)\n log(\"Node initialized\")\n\n pr2_arm = PR2Arms()\n\n if False:\n q = [0, 0, 0, 0, 0, 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L936_C4", "label": "init_node()", "type": "expression", "loc": [936, 936], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [8, 1, 0.9435, 0.001, 1, 0.88, 0.0, 463, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(node_name, anonymous = True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L937_C4", "label": "log()", "type": "expression", "loc": [937, 937], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [8, 1, 0.9446, 0.001, 1, 0.88, 0.0909, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Node initialized\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L939_C4", "label": "pr2_arm = PR2Arms()", "type": "assigned_variable", "loc": [939, 939], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [14, 1, 0.9466, 0.001, 1, 0.88, 0.1818, 280, 3, 0, 0, 0, 694, 10, 1], "semantic": {"name": "pr2_arm", "arg_names": [], "import_names": [], "rhs_call_name": "PR2Arms", "annotation": ""}, "snippet": " pr2_arm = PR2Arms()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "label": "if", "type": "if", "loc": [941, 951], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [4, 1, 0.9536, 0.0111, 1, 0.88, 0.2727, 0, 1, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n q = [0, 0, 0, 0, 0, 0, 0]\n pr2_arm.set_jointangles('right_arm', q)\n ee_pos = simparm.FK('right_arm', q)\n log('FK result:' + ee_pos.A1)\n\n ee_pos[0,0] -= 0.1\n q_ik = pr2_arm.IK('right_arm', ee_pos, tr.Rx(0.), q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L942_C8", "label": "q =", "type": "assigned_variable", "loc": [942, 942], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [14, 2, 0.9496, 0.001, 2, 0.34, 0.0, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " q = [0, 0, 0, 0, 0, 0, 0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L943_C8", "label": "set_jointangles()", "type": "expression", "loc": [943, 943], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [8, 2, 0.9506, 0.001, 2, 0.34, 0.1667, 240, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_jointangles", "arg_names": [], "import_names": [], "rhs_call_name": "set_jointangles", "annotation": ""}, "snippet": " pr2_arm.set_jointangles('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L944_C8", "label": "ee_pos = FK()", "type": "assigned_variable", "loc": [944, 944], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [14, 2, 0.9516, 0.001, 2, 0.34, 0.3333, 354, 3, 2, 0, 0, 252, 10, 1], "semantic": {"name": "ee_pos", "arg_names": [], "import_names": [], "rhs_call_name": "FK", "annotation": ""}, "snippet": " ee_pos = simparm.FK('right_arm', q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L945_C8", "label": "log()", "type": "expression", "loc": [945, 945], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [8, 2, 0.9526, 0.001, 2, 0.34, 0.5, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log('FK result:' + ee_pos.A1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L948_C8", "label": "q_ik = IK()", "type": "assigned_variable", "loc": [948, 948], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [14, 2, 0.9556, 0.001, 2, 0.34, 0.6667, 859, 3, 4, 0, 0, 719, 10, 2], "semantic": {"name": "q_ik", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q_ik = pr2_arm.IK('right_arm', ee_pos, tr.Rx(0.), q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L949_C8", "label": "log()", "type": "expression", "loc": [949, 949], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [8, 2, 0.9567, 0.001, 2, 0.34, 0.8333, 432, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log('q_ik:' + [math.degrees(a) for a in q_ik])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L951_C8", "label": "spin()", "type": "expression", "loc": [951, 951], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "vector": [8, 2, 0.9587, 0.001, 2, 0.34, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "label": "if", "type": "if", "loc": [953, 957], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [4, 1, 0.9627, 0.005, 1, 0.88, 0.3636, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if False:\n p = np.matrix([0.9, -0.3, -0.15]).T\n #rot = tr.Rx(0.)\n rot = tr.Rx(math.radians(90.))\n pr2_arm.set_cartesian('right_arm', p, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L954_C8", "label": "p =", "type": "assigned_variable", "loc": [954, 954], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "vector": [14, 2, 0.9617, 0.001, 2, 0.87, 0.0, 491, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p = np.matrix([0.9, -0.3, -0.15]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L956_C8", "label": "rot = Rx()", "type": "assigned_variable", "loc": [956, 956], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "vector": [14, 2, 0.9637, 0.001, 2, 0.87, 0.5, 812, 3, 1, 0, 0, 820, 10, 2], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "Rx", "annotation": ""}, "snippet": " rot = tr.Rx(math.radians(90.))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L957_C8", "label": "set_cartesian()", "type": "expression", "loc": [957, 957], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "vector": [8, 2, 0.9647, 0.001, 2, 0.87, 1.0, 203, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "set_cartesian", "arg_names": [], "import_names": [], "rhs_call_name": "set_cartesian", "annotation": ""}, "snippet": " pr2_arm.set_cartesian('right_arm', p, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L968_C4", "label": "r_arm, l_arm =", "type": "assigned_variable", "loc": [968, 968], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [14, 1, 0.9758, 0.001, 1, 0.88, 0.4545, 451, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "r_arm, l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r_arm, l_arm = 0, 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L977_C4", "label": "raw_input()", "type": "expression", "loc": [977, 977], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [8, 1, 0.9849, 0.001, 1, 0.88, 0.5455, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to move')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L978_C4", "label": "p1 =", "type": "assigned_variable", "loc": [978, 978], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [14, 1, 0.9859, 0.001, 1, 0.88, 0.6364, 87, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p1 = np.matrix([0.91, -0.22, -0.05]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L979_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [979, 979], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [8, 1, 0.9869, 0.001, 1, 0.88, 0.7273, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arm.go_cep_jtt(r_arm, p1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L983_C4", "label": "raw_input()", "type": "expression", "loc": [983, 983], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [8, 1, 0.9909, 0.001, 1, 0.88, 0.8182, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input('Hit ENTER to move')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L984_C4", "label": "p2 =", "type": "assigned_variable", "loc": [984, 984], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [14, 1, 0.9919, 0.001, 1, 0.88, 0.9091, 843, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " p2 = np.matrix([0.70, -0.22, -0.05]).T"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L985_C4", "label": "go_cep_jtt()", "type": "expression", "loc": [985, 985], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "vector": [8, 1, 0.9929, 0.001, 1, 0.88, 1.0, 219, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "go_cep_jtt", "arg_names": [], "import_names": [], "rhs_call_name": "go_cep_jtt", "annotation": ""}, "snippet": " pr2_arm.go_cep_jtt(r_arm, p2)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L282_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L283_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L281_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L288_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L291_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L295_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L294_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L297_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L301_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L302_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L299_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L303_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L303_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L304_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L308_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L311_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L312_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L313_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L312_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L315_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L317_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L318_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L317_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L320_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L321_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L307_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L323_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L334_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L336_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L333_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L337_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L356_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L332_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L374_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L374_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L378_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L385_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L392_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L396_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L399_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L400_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L430_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L430_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L431_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L429_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L442_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L446_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L455_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L456_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L472_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L482_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L482_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L483_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L484_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L485_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L486_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L487_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L489_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L491_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L492_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L493_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L496_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L498_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L499_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L500_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L501_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L502_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L503_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L504_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L505_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L508_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L509_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L497_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L512_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L514_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L525_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L526_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L528_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L530_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L531_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L530_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L533_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L535_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L532_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L536_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L539_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L540_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L543_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L544_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L544_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L545_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L544_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L547_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L548_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L550_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L551_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L554_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L555_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L556_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L557_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L559_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L560_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L562_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L564_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L567_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L524_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L569_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L579_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L577_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L580_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L580_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L581_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L580_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L583_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L593_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L594_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L595_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L596_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L596_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L597_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L598_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L592_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L599_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L601_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L601_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L602_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L618_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L618_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L619_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L621_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L622_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L623_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L624_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L625_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L625_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L626_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L629_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L629_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L630_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L629_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L632_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L633_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L635_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L628_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L638_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L638_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L639_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L640_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L642_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L642_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L643_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L643_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L644_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L644_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L645_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L616_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L648_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L655_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L656_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L655_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L665_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L665_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L666_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L667_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L668_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L669_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L675_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L675_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L676_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L679_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L682_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L684_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L681_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L685_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L674_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L686_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L688_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L688_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L689_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L689_C7", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L690_C11"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L688_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L692_C7"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L695_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L695_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L696_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L696_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L697_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L696_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L699_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L701_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L701_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L702_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L702_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L703_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L703_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L704_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L703_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L706_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L702_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L708_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L712_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L713_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L714_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L715_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L716_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L718_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L719_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L720_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L722_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L722_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L723_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L723_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L724_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L723_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L726_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L728_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L730_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L731_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L732_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L711_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L733_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L733_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L734_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L733_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L736_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L740_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L741_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L742_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L743_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L744_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L745_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L747_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:While_L745_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L748_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L749_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L739_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L762_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L762_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L763_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L769_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L769_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L770_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L776_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L776_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L777_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L796_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L796_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L797_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L799_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L799_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L800_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L802_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L802_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L803_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L806_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L806_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L807_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L809_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L809_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L810_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L815_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L817_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L819_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L820_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L824_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L832_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L836_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L838_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L840_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L840_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L841_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L843_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L843_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L844_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L843_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L847_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L850_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L853_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L853_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L854_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L855_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L856_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L857_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L858_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L859_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L859_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L860_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L860_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L861_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L860_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L862_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L862_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L863_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L852_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L864_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L869_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L870_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L870_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L871_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L870_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L872_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L868_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Return_L873_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L878_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L878_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L879_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L880_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L881_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L877_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L882_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:ClassDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L898_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L899_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L902_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L902_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L903_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L905_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L906_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L907_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L908_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L909_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L909_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L910_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L913_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L913_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L914_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L913_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L916_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L917_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L918_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L920_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L912_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L923_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L923_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L924_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L925_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L927_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L927_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L928_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:For_L928_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L929_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L929_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L930_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:FunctionDef_L896_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L933_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L936_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L937_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L939_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L942_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L943_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L944_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L945_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L948_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L949_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L941_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L951_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L954_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L956_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L953_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L957_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L968_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L977_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L978_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L979_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L983_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Assign_L984_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99277:If_L935_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99277:Expr_L985_C4"}] |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'controller_gui.ui'
#
# Created: Thu Feb 2 04:31:00 2012
# by: PyQt4 UI code generator 4.7.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Frame(object):
def setupUi(self, Frame):
Frame.setObjectName("Frame")
Frame.resize(609, 289)
Frame.setFrameShape(QtGui.QFrame.StyledPanel)
Frame.setFrameShadow(QtGui.QFrame.Raised)
self.start_button = QtGui.QPushButton(Frame)
self.start_button.setGeometry(QtCore.QRect(20, 20, 161, 181))
self.start_button.setStyleSheet("font: 16pt \"AlArabiya\";\n"
"background-color: rgb(120, 255, 96);")
self.start_button.setObjectName("start_button")
self.kill_button = QtGui.QPushButton(Frame)
self.kill_button.setGeometry(QtCore.QRect(210, 20, 161, 181))
self.kill_button.setStyleSheet("background-color: rgb(255, 67, 67);\n"
"font: 16pt \"AlArabiya\";")
self.kill_button.setObjectName("kill_button")
self.controller_combo = QtGui.QComboBox(Frame)
self.controller_combo.setGeometry(QtCore.QRect(20, 230, 351, 31))
self.controller_combo.setEditable(True)
self.controller_combo.setObjectName("controller_combo")
self.restart_button = QtGui.QPushButton(Frame)
self.restart_button.setGeometry(QtCore.QRect(400, 20, 161, 181))
self.restart_button.setStyleSheet("background-color: rgb(85, 170, 255);\n"
"font: 16pt \"AlArabiya\";")
self.restart_button.setObjectName("restart_button")
self.arm_combo = QtGui.QComboBox(Frame)
self.arm_combo.setGeometry(QtCore.QRect(400, 230, 161, 31))
self.arm_combo.setObjectName("arm_combo")
self.arm_combo.addItem("")
self.arm_combo.addItem("")
self.retranslateUi(Frame)
QtCore.QMetaObject.connectSlotsByName(Frame)
def retranslateUi(self, Frame):
Frame.setWindowTitle(QtGui.QApplication.translate("Frame", "Frame", None, QtGui.QApplication.UnicodeUTF8))
self.start_button.setText(QtGui.QApplication.translate("Frame", "Start", None, QtGui.QApplication.UnicodeUTF8))
self.kill_button.setText(QtGui.QApplication.translate("Frame", "Kill", None, QtGui.QApplication.UnicodeUTF8))
self.restart_button.setText(QtGui.QApplication.translate("Frame", "Restart", None, QtGui.QApplication.UnicodeUTF8))
self.arm_combo.setItemText(0, QtGui.QApplication.translate("Frame", "right", None, QtGui.QApplication.UnicodeUTF8))
self.arm_combo.setItemText(1, QtGui.QApplication.translate("Frame", "left", None, QtGui.QApplication.UnicodeUTF8))
| ajibawa-2023/Python-Code-Large/train/row_99278 | 37 | 53 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99278:ImportFrom_L10_C0", "label": "from PyQt4 import QtCore, QtGui", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1887, 0.0189, 0, 0.66, 0.0, 154, 0, 2, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:ClassDef_L12_C0", "label": "Ui_Frame", "type": "class", "loc": [12, 52], "level": 0, "parent": null, "vector": [3, 0, 0.6038, 0.7736, 0, 0.66, 1.0, 206, 0, 2, 0, 0, 186, 0, 44], "semantic": {"name": "Ui_Frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Ui_Frame(object):\n def setupUi(self, Frame):\n Frame.setObjectName(\"Frame\")\n Frame.resize(609, 289)\n Frame.setFrameShape(QtGui.QFrame.StyledPanel)\n Frame.setFrameShadow(QtGui.QFrame.Raised)\n self.start_button = QtGui.QPushButton(Frame)\n self.start_button.setGeometry(QtCore.QRect(20, 20, 161, 181))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "label": "setupUi", "type": "function", "loc": [13, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:ClassDef_L12_C0", "vector": [2, 1, 0.5377, 0.6038, 1, 0.86, 0.0, 419, 0, 2, 0, 0, 0, 0, 32], "semantic": {"name": "setupUi", "arg_names": ["self", "Frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setupUi(self, Frame):\n Frame.setObjectName(\"Frame\")\n Frame.resize(609, 289)\n Frame.setFrameShape(QtGui.QFrame.StyledPanel)\n Frame.setFrameShadow(QtGui.QFrame.Raised)\n self.start_button = QtGui.QPushButton(Frame)\n self.start_button.setGeometry(QtCore.QRect(20, 20, 161, 181))\n self.start_button.setStyleSheet(\"font: 16pt \\\"AlArabiya\\\";\\n\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L14_C8", "label": "setObjectName()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.2642, 0.0189, 2, 0.38, 0.0, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " Frame.setObjectName(\"Frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L15_C8", "label": "resize()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.283, 0.0189, 2, 0.38, 0.0385, 834, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " Frame.resize(609, 289)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L16_C8", "label": "setFrameShape()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.3019, 0.0189, 2, 0.38, 0.0769, 970, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFrameShape", "arg_names": [], "import_names": [], "rhs_call_name": "setFrameShape", "annotation": ""}, "snippet": " Frame.setFrameShape(QtGui.QFrame.StyledPanel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L17_C8", "label": "setFrameShadow()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.3208, 0.0189, 2, 0.38, 0.1154, 695, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFrameShadow", "arg_names": [], "import_names": [], "rhs_call_name": "setFrameShadow", "annotation": ""}, "snippet": " Frame.setFrameShadow(QtGui.QFrame.Raised)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L18_C8", "label": "self.start_button = QPushButton()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [14, 2, 0.3396, 0.0189, 2, 0.38, 0.1538, 484, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.start_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.start_button = QtGui.QPushButton(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L19_C8", "label": "setGeometry()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.3585, 0.0189, 2, 0.38, 0.1923, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.start_button.setGeometry(QtCore.QRect(20, 20, 161, 181))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L20_C8", "label": "setStyleSheet()", "type": "expression", "loc": [20, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.3868, 0.0377, 2, 0.38, 0.2308, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.start_button.setStyleSheet(\"font: 16pt \\\"AlArabiya\\\";\\n\"\n\"background-color: rgb(120, 255, 96);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L22_C8", "label": "setObjectName()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.4151, 0.0189, 2, 0.38, 0.2692, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.start_button.setObjectName(\"start_button\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L23_C8", "label": "self.kill_button = QPushButton()", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [14, 2, 0.434, 0.0189, 2, 0.38, 0.3077, 845, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.kill_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.kill_button = QtGui.QPushButton(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L24_C8", "label": "setGeometry()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.4528, 0.0189, 2, 0.38, 0.3462, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.kill_button.setGeometry(QtCore.QRect(210, 20, 161, 181))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L25_C8", "label": "setStyleSheet()", "type": "expression", "loc": [25, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.4811, 0.0377, 2, 0.38, 0.3846, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.kill_button.setStyleSheet(\"background-color: rgb(255, 67, 67);\\n\"\n\"font: 16pt \\\"AlArabiya\\\";\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L27_C8", "label": "setObjectName()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.5094, 0.0189, 2, 0.38, 0.4231, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.kill_button.setObjectName(\"kill_button\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L28_C8", "label": "self.controller_combo = QComboBox()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [14, 2, 0.5283, 0.0189, 2, 0.38, 0.4615, 151, 3, 1, 0, 0, 556, 10, 1], "semantic": {"name": "self.controller_combo", "arg_names": [], "import_names": [], "rhs_call_name": "QComboBox", "annotation": ""}, "snippet": " self.controller_combo = QtGui.QComboBox(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L29_C8", "label": "setGeometry()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.5472, 0.0189, 2, 0.38, 0.5, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.controller_combo.setGeometry(QtCore.QRect(20, 230, 351, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L30_C8", "label": "setEditable()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.566, 0.0189, 2, 0.38, 0.5385, 440, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEditable", "arg_names": [], "import_names": [], "rhs_call_name": "setEditable", "annotation": ""}, "snippet": " self.controller_combo.setEditable(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L31_C8", "label": "setObjectName()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.5849, 0.0189, 2, 0.38, 0.5769, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.controller_combo.setObjectName(\"controller_combo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L32_C8", "label": "self.restart_button = QPushButton()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [14, 2, 0.6038, 0.0189, 2, 0.38, 0.6154, 857, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.restart_button", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.restart_button = QtGui.QPushButton(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L33_C8", "label": "setGeometry()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.6226, 0.0189, 2, 0.38, 0.6538, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.restart_button.setGeometry(QtCore.QRect(400, 20, 161, 181))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L34_C8", "label": "setStyleSheet()", "type": "expression", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.6509, 0.0377, 2, 0.38, 0.6923, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.restart_button.setStyleSheet(\"background-color: rgb(85, 170, 255);\\n\"\n\"font: 16pt \\\"AlArabiya\\\";\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L36_C8", "label": "setObjectName()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.6792, 0.0189, 2, 0.38, 0.7308, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.restart_button.setObjectName(\"restart_button\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L37_C8", "label": "self.arm_combo = QComboBox()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [14, 2, 0.6981, 0.0189, 2, 0.38, 0.7692, 176, 3, 1, 0, 0, 556, 10, 1], "semantic": {"name": "self.arm_combo", "arg_names": [], "import_names": [], "rhs_call_name": "QComboBox", "annotation": ""}, "snippet": " self.arm_combo = QtGui.QComboBox(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L38_C8", "label": "setGeometry()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.717, 0.0189, 2, 0.38, 0.8077, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.arm_combo.setGeometry(QtCore.QRect(400, 230, 161, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L39_C8", "label": "setObjectName()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.7358, 0.0189, 2, 0.38, 0.8462, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.arm_combo.setObjectName(\"arm_combo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L40_C8", "label": "addItem()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.7547, 0.0189, 2, 0.38, 0.8846, 670, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " self.arm_combo.addItem(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L41_C8", "label": "addItem()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.7736, 0.0189, 2, 0.38, 0.9231, 670, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " self.arm_combo.addItem(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L43_C8", "label": "retranslateUi()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.8113, 0.0189, 2, 0.38, 0.9615, 520, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "retranslateUi", "arg_names": [], "import_names": [], "rhs_call_name": "retranslateUi", "annotation": ""}, "snippet": " self.retranslateUi(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L44_C8", "label": "connectSlotsByName()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "vector": [8, 2, 0.8302, 0.0189, 2, 0.38, 1.0, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connectSlotsByName", "arg_names": [], "import_names": [], "rhs_call_name": "connectSlotsByName", "annotation": ""}, "snippet": " QtCore.QMetaObject.connectSlotsByName(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "label": "retranslateUi", "type": "function", "loc": [46, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:ClassDef_L12_C0", "vector": [2, 1, 0.9245, 0.1321, 1, 0.86, 1.0, 520, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "retranslateUi", "arg_names": ["self", "Frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def retranslateUi(self, Frame):\n Frame.setWindowTitle(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))\n self.start_button.setText(QtGui.QApplication.translate(\"Frame\", \"Start\", None, QtGui.QApplication.UnicodeUTF8))\n self.kill_button.setText(QtGui.QApplication.translate(\"Frame\", \"Kill\", None, QtGui.QApplication.UnicodeUTF8))\n self.restart_button.setText(QtGui.QApplication.translate(\"Frame\", \"Restart\", None, QtGui.QApplication.UnicodeUTF8))\n self.arm_combo.setItemText(0, QtGui.QApplication.translate(\"Frame\", \"right\", None, QtGui.QApplication.UnicodeUTF8))\n self.arm_combo.setItemText(1, QtGui.QApplication.translate(\"Frame\", \"left\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L47_C8", "label": "setWindowTitle()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "vector": [8, 2, 0.8868, 0.0189, 2, 0.62, 0.0, 38, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "setWindowTitle", "annotation": ""}, "snippet": " Frame.setWindowTitle(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L48_C8", "label": "setText()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "vector": [8, 2, 0.9057, 0.0189, 2, 0.62, 0.2, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.start_button.setText(QtGui.QApplication.translate(\"Frame\", \"Start\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L49_C8", "label": "setText()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "vector": [8, 2, 0.9245, 0.0189, 2, 0.62, 0.4, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.kill_button.setText(QtGui.QApplication.translate(\"Frame\", \"Kill\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L50_C8", "label": "setText()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "vector": [8, 2, 0.9434, 0.0189, 2, 0.62, 0.6, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.restart_button.setText(QtGui.QApplication.translate(\"Frame\", \"Restart\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L51_C8", "label": "setItemText()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "vector": [8, 2, 0.9623, 0.0189, 2, 0.62, 0.8, 550, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "setItemText", "arg_names": [], "import_names": [], "rhs_call_name": "setItemText", "annotation": ""}, "snippet": " self.arm_combo.setItemText(0, QtGui.QApplication.translate(\"Frame\", \"right\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L52_C8", "label": "setItemText()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "vector": [8, 2, 0.9811, 0.0189, 2, 0.62, 1.0, 550, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "setItemText", "arg_names": [], "import_names": [], "rhs_call_name": "setItemText", "annotation": ""}, "snippet": " self.arm_combo.setItemText(1, QtGui.QApplication.translate(\"Frame\", \"left\", None, QtGui.QApplication.UnicodeUTF8))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99278:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99278:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99278:Expr_L52_C8"}] |
#! /usr/bin/python
import numpy as np
import sys
import roslib
roslib.load_manifest('hrl_pr2_arms')
import rospy
import tf
import tf.transformations as tf_trans
from std_srvs.srv import Empty, EmptyResponse
from hrl_generic_arms.ep_trajectory_controller import EPArmController
from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory
from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher
joint_ctrl = '%s_arm_controller'
def setup_servoing_arms(msg):
ctrl_switcher = ControllerSwitcher()
ctrl_switcher.carefree_switch('r', joint_ctrl, reset=False)
ctrl_switcher.carefree_switch('l', joint_ctrl, reset=False)
r_arm = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name=joint_ctrl)
l_arm = create_pr2_arm('l', PR2ArmJointTrajectory, controller_name=joint_ctrl)
r_ep_arm_ctrl = EPArmController(r_arm)
l_ep_arm_ctrl = EPArmController(l_arm)
r_ep_arm_ctrl.execute_interpolated_ep([-1.91, 1.25, -1.93, -1.53, 0.33, -0.03, 0.0],
15, blocking=False)
l_ep_arm_ctrl.execute_interpolated_ep([1.91, 1.25, 1.93, -1.53, -0.33, -0.03, -3.09],
15, blocking=True)
return EmptyResponse()
def main():
rospy.init_node("servo_prepare")
if len(sys.argv) < 2:
print "-s for server, -p for play"
if sys.argv[1] == "-s":
rospy.Service("/pr2_ar_servo/arms_setup", Empty, setup_servoing_arms)
if sys.argv[1] == "-p":
setup_servoing_arms(None)
rospy.spin()
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99280 | 34 | 46 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0652, 0.0217, 0, 0.66, 0.0, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0217, 0, 0.66, 0.0714, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0217, 0, 0.66, 0.1429, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1522, 0.0217, 0, 0.66, 0.2143, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('hrl_pr2_arms')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Import_L9_C0", "label": "rospy import rospy", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1957, 0.0217, 0, 0.66, 0.2857, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Import_L10_C0", "label": "tf import tf", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2174, 0.0217, 0, 0.66, 0.3571, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Import_L11_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.2391, 0.0217, 0, 0.66, 0.4286, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tf_trans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:ImportFrom_L12_C0", "label": "from std_srvs.srv import Empty, EmptyResponse", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.2609, 0.0217, 0, 0.66, 0.5, 261, 0, 2, 0, 0, 261, 0, 0], "semantic": {"name": "std_srvs.srv", "arg_names": [], "import_names": ["Empty", "EmptyResponse"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_srvs.srv import Empty, EmptyResponse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:ImportFrom_L14_C0", "label": "from hrl_generic_arms.ep_trajectory_controller import EPArmController", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.3043, 0.0217, 0, 0.66, 0.5714, 641, 0, 1, 0, 0, 641, 0, 0], "semantic": {"name": "hrl_generic_arms.ep_trajectory_controller", "arg_names": [], "import_names": ["EPArmController"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.ep_trajectory_controller import EPArmController"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:ImportFrom_L15_C0", "label": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.3261, 0.0217, 0, 0.66, 0.6429, 253, 0, 2, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["create_pr2_arm", "PR2ArmJointTrajectory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:ImportFrom_L16_C0", "label": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3478, 0.0217, 0, 0.66, 0.7143, 395, 0, 1, 0, 0, 395, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_controller_switcher", "arg_names": [], "import_names": ["ControllerSwitcher"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L18_C0", "label": "joint_ctrl =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.3913, 0.0217, 0, 0.66, 0.7857, 198, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "joint_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "joint_ctrl = '%s_arm_controller'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "label": "setup_servoing_arms", "type": "function", "loc": [20, 33], "level": 0, "parent": null, "vector": [2, 0, 0.5761, 0.3043, 0, 0.66, 0.8571, 532, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "setup_servoing_arms", "arg_names": ["msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def setup_servoing_arms(msg):\n ctrl_switcher = ControllerSwitcher()\n ctrl_switcher.carefree_switch('r', joint_ctrl, reset=False)\n ctrl_switcher.carefree_switch('l', joint_ctrl, reset=False)\n r_arm = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name=joint_ctrl)\n l_arm = create_pr2_arm('l', PR2ArmJointTrajectory, controller_name=joint_ctrl)\n\n r_ep_arm_ctrl = EPArmController(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L21_C4", "label": "ctrl_switcher = ControllerSwitcher()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [14, 1, 0.4565, 0.0217, 1, 0.65, 0.0, 220, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "ctrl_switcher", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerSwitcher", "annotation": ""}, "snippet": " ctrl_switcher = ControllerSwitcher()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L22_C4", "label": "carefree_switch()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [8, 1, 0.4783, 0.0217, 1, 0.65, 0.1111, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('r', joint_ctrl, reset=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L23_C4", "label": "carefree_switch()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [8, 1, 0.5, 0.0217, 1, 0.65, 0.2222, 300, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "carefree_switch", "arg_names": [], "import_names": [], "rhs_call_name": "carefree_switch", "annotation": ""}, "snippet": " ctrl_switcher.carefree_switch('l', joint_ctrl, reset=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L24_C4", "label": "r_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [14, 1, 0.5217, 0.0217, 1, 0.65, 0.3333, 315, 3, 3, 0, 0, 318, 10, 1], "semantic": {"name": "r_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " r_arm = create_pr2_arm('r', PR2ArmJointTrajectory, controller_name=joint_ctrl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L25_C4", "label": "l_arm = create_pr2_arm()", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [14, 1, 0.5435, 0.0217, 1, 0.65, 0.4444, 657, 3, 3, 0, 0, 318, 10, 1], "semantic": {"name": "l_arm", "arg_names": [], "import_names": [], "rhs_call_name": "create_pr2_arm", "annotation": ""}, "snippet": " l_arm = create_pr2_arm('l', PR2ArmJointTrajectory, controller_name=joint_ctrl)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L27_C4", "label": "r_ep_arm_ctrl = EPArmController()", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [14, 1, 0.587, 0.0217, 1, 0.65, 0.5556, 367, 3, 1, 0, 0, 201, 10, 1], "semantic": {"name": "r_ep_arm_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "EPArmController", "annotation": ""}, "snippet": " r_ep_arm_ctrl = EPArmController(r_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L28_C4", "label": "l_ep_arm_ctrl = EPArmController()", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [14, 1, 0.6087, 0.0217, 1, 0.65, 0.6667, 574, 3, 1, 0, 0, 201, 10, 1], "semantic": {"name": "l_ep_arm_ctrl", "arg_names": [], "import_names": [], "rhs_call_name": "EPArmController", "annotation": ""}, "snippet": " l_ep_arm_ctrl = EPArmController(l_arm)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L29_C4", "label": "execute_interpolated_ep()", "type": "expression", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [8, 1, 0.6413, 0.0435, 1, 0.65, 0.7778, 215, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "execute_interpolated_ep", "arg_names": [], "import_names": [], "rhs_call_name": "execute_interpolated_ep", "annotation": ""}, "snippet": " r_ep_arm_ctrl.execute_interpolated_ep([-1.91, 1.25, -1.93, -1.53, 0.33, -0.03, 0.0],\n 15, blocking=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L31_C4", "label": "execute_interpolated_ep()", "type": "expression", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [8, 1, 0.6848, 0.0435, 1, 0.65, 0.8889, 215, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "execute_interpolated_ep", "arg_names": [], "import_names": [], "rhs_call_name": "execute_interpolated_ep", "annotation": ""}, "snippet": " l_ep_arm_ctrl.execute_interpolated_ep([1.91, 1.25, 1.93, -1.53, -0.33, -0.03, -3.09],\n 15, blocking=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Return_L33_C4", "label": "return", "type": "return", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "vector": [13, 1, 0.7174, 0.0217, 1, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EmptyResponse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "label": "main", "type": "function", "loc": [35, 43], "level": 0, "parent": null, "vector": [2, 0, 0.8478, 0.1957, 0, 0.66, 0.9286, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"servo_prepare\")\n if len(sys.argv) < 2:\n print(\"-s for server, -p for play\")\n if sys.argv[1] == \"-s\":\n rospy.Service(\"/pr2_ar_servo/arms_setup\", Empty, setup_servoing_arms)\n if sys.argv[1] == \"-p\":\n setup_servoing_arms(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L36_C4", "label": "init_node()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "vector": [8, 1, 0.7826, 0.0217, 1, 0.16, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(\"servo_prepare\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L37_C4", "label": "if", "type": "if", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "vector": [4, 1, 0.8152, 0.0435, 1, 0.16, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sys.argv) < 2:\n print(\"-s for server, -p for play\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L38_C8", "label": "print()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L37_C4", "vector": [8, 2, 0.8261, 0.0217, 2, 0.64, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"-s for server, -p for play\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L39_C4", "label": "if", "type": "if", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "vector": [4, 1, 0.8587, 0.0435, 1, 0.16, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.argv[1] == \"-s\":\n rospy.Service(\"/pr2_ar_servo/arms_setup\", Empty, setup_servoing_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L40_C8", "label": "Service()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L39_C4", "vector": [8, 2, 0.8696, 0.0217, 2, 0.22, 0.0, 451, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Service", "arg_names": [], "import_names": [], "rhs_call_name": "Service", "annotation": ""}, "snippet": " rospy.Service(\"/pr2_ar_servo/arms_setup\", Empty, setup_servoing_arms)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L41_C4", "label": "if", "type": "if", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "vector": [4, 1, 0.9022, 0.0435, 1, 0.16, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sys.argv[1] == \"-p\":\n setup_servoing_arms(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L42_C8", "label": "setup_servoing_arms()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L41_C4", "vector": [8, 2, 0.913, 0.0217, 2, 0.42, 0.0, 532, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_servoing_arms", "arg_names": [], "import_names": [], "rhs_call_name": "setup_servoing_arms", "annotation": ""}, "snippet": " setup_servoing_arms(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L43_C4", "label": "spin()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "vector": [8, 1, 0.9348, 0.0217, 1, 0.16, 1.0, 17, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "spin", "arg_names": [], "import_names": [], "rhs_call_name": "spin", "annotation": ""}, "snippet": " rospy.spin()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L45_C0", "label": "if", "type": "if", "loc": [45, 46], "level": 0, "parent": null, "vector": [4, 0, 0.9891, 0.0435, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L46_C4", "label": "main()", "type": "expression", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L45_C0", "vector": [8, 1, 1.0, 0.0217, 1, 0.66, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Return_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:FunctionDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99280:If_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99280:Expr_L46_C4"}] |
##
# Periodically logs the output of a callback function by calling it at a certain
# rate and gathering up the results into a list
class PeriodicLogger():
##
# initializes the logger but doesn't start it
#
# @param callback the function to be called each time
# @param rate the rate in seconds at which to call the callback
# @param args the function arguments to pass into the callback
def __init__(self, callback, rate=0.01, args=None):
self.ret = []
self.cb = callback
self.rate = rate
self.args = args
self.is_running = False
self.max_calls = None
self.num_calls = 0
self.beg_time = 0.
self.thread = None
##
# begins the logger
# @param max_calls the maximum number of times to call the callback
def start(self, max_calls=None):
if self.is_running:
return
self.max_calls = max_calls
self.is_running = True
self.num_calls = 0
self.beg_time = rospy.Time.now().to_sec()
self.thread = threading.Timer(self.rate, self._run)
self.thread.start()
def _run(self):
if not self.is_running:
return
act_time = self.beg_time + self.rate * (self.num_calls + 2)
interval = act_time - rospy.Time.now().to_sec()
self.thread = threading.Timer(interval, self._run)
self.thread.start()
if self.args is None:
retval = self.cb()
else:
retval = self.cb(*self.args)
self.ret += [retval]
self.num_calls += 1
# break if we have called the sufficent number of times
if self.max_calls is not None:
if self.num_calls == self.max_calls:
self.is_running = False
return
##
# stops the monitor
# @return the result of the monitor
def stop(self):
self.thread.cancel()
if not self.is_running:
return None
self.is_running = False
return self.ret
##
# If max_calls sets to automatically terminate, return the ret vals
def get_ret_vals(self):
if self.is_running:
return None
return self.ret
##
# Periodically monitors the output of a callback function by calling it at a certain
# rate and compares it with a provided model to insure the value doesn't vary greatly
# within a degree of tolerance provided by the variance function
class PeriodicMonitor():
##
# initializes the monitor but doesn't start it
#
# @param callback the function to be called each time
# @param rate the rate in seconds at which to call the callback
# @param args the function arguments to pass into the callback
def __init__(self, callback, rate=0.01, args=None):
self.ret = []
self.cb = callback
self.rate = rate
self.args = args
self.is_running = False
self.num_calls = 0
self.beg_time = 0.
self.thread = None
self.mean_model = None
self.variance_model = None
self.std_devs = 0.
self.failure = False
##
# begins the monitor
# TODO DOCS
# @param max_calls the maximum number of times to call the callback
def start(self, mean_model, variance_model, std_devs=2.5, max_calls=None,
contingency=None, contingency_args=None):
if len(mean_model) != len(variance_model):
log("Models must be of same length")
return
if self.is_running:
return
self.is_running = True
self.mean_model = mean_model
self.variance_model = variance_model
self.std_devs = std_devs
self.max_calls = max_calls
self.contingency = contingency
self.contincency_args = contingency_args
self.model_index = 0
self.failure = False
self.num_calls = 0
self.beg_time = rospy.Time.now().to_sec()
self.thread = threading.Timer(self.rate, self._run)
self.thread.start()
def _run(self):
if not self.is_running:
return
act_time = self.beg_time + self.rate * (self.num_calls + 2)
interval = act_time - rospy.Time.now().to_sec()
self.thread = threading.Timer(interval, self._run)
self.thread.start()
if self.args is None:
retval = self.cb()
else:
retval = self.cb(*self.args)
# go through each coordinate in the vector
for coord_i in len(retval[1]):
diff = abs(retval[1][coord_i] - self.mean_model[self.model_index][coord_i])
deviation = np.sqrt(self.variance_model[self.model_index][coord_i])
if diff > self.std_devs * deviation:
# signal is outside allowable range
self.failure = True
self.is_running = False
# call contingency function
if contingency_args is None:
self.contingency()
else:
self.contingency(*contingency_args)
return
self.ret += [retval]
self.model_index += 1
if self.model_index == len(self.mean_model):
self.is_running = False
return
# break if we have called the sufficent number of times
if not self.max_calls is None:
self.max_calls -= 1
if self.max_calls == 0:
self.is_running = False
return
##
# stops the monitor
# @return the result of the monitor
def stop(self):
self.thread.cancel()
if not self.is_running:
return None
self.is_running = False
return self.ret
##
# If max_calls sets to automatically terminate, return the ret vals
def get_ret_vals(self):
if self.is_running:
return None
return self.ret
# TODO DOCS
def has_failed():
return self.failure
# TODO DOCS
def wait_for_completion(rate=0.01):
while self.is_running and not rospy.is_shutdown():
rospy.sleep(rate)
return not self.failure
| ajibawa-2023/Python-Code-Large/train/row_99281 | 120 | 191 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "label": "PeriodicLogger", "type": "class", "loc": [4, 72], "level": 0, "parent": null, "vector": [3, 0, 0.199, 0.3613, 0, 0.66, 0.0, 422, 0, 5, 0, 0, 0, 0, 11], "semantic": {"name": "PeriodicLogger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PeriodicLogger():\n ##\n # initializes the logger but doesn't start it\n #\n # @param callback the function to be called each time\n # @param rate the rate in seconds at which to call the callback\n # @param args the function arguments to pass into the callback\n def __init__(self, callback, rate=0.01, args=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "vector": [2, 1, 0.0812, 0.0524, 1, 0.05, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "callback", "rate", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, callback, rate=0.01, args=None):\n self.ret = []\n self.cb = callback\n self.rate = rate\n self.args = args\n self.is_running = False\n self.max_calls = None\n self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L12_C8", "label": "self.ret =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0628, 0.0052, 2, 0.8, 0.0, 172, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L13_C8", "label": "self.cb =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0681, 0.0052, 2, 0.8, 0.125, 336, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cb = callback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L14_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0733, 0.0052, 2, 0.8, 0.25, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L15_C8", "label": "self.args =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0785, 0.0052, 2, 0.8, 0.375, 640, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L16_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0838, 0.0052, 2, 0.8, 0.5, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L17_C8", "label": "self.max_calls =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.089, 0.0052, 2, 0.8, 0.625, 548, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.max_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_calls = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L18_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0942, 0.0052, 2, 0.8, 0.75, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L19_C8", "label": "self.beg_time =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.0995, 0.0052, 2, 0.8, 0.875, 907, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.beg_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L20_C8", "label": "self.thread =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "vector": [14, 2, 0.1047, 0.0052, 2, 0.8, 1.0, 2, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thread = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "label": "start", "type": "function", "loc": [25, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "vector": [2, 1, 0.1518, 0.0471, 1, 0.05, 0.25, 511, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "start", "arg_names": ["self", "max_calls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, max_calls=None):\n if self.is_running:\n return\n self.max_calls = max_calls\n self.is_running = True\n self.num_calls = 0\n self.beg_time = rospy.Time.now().to_sec()\n self.thread = threading.Timer(self.rate, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L26_C8", "label": "if", "type": "if", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [4, 2, 0.1387, 0.0105, 2, 0.79, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L27_C12", "label": "return", "type": "return", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L26_C8", "vector": [13, 3, 0.1414, 0.0052, 3, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L28_C8", "label": "self.max_calls =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [14, 2, 0.1466, 0.0052, 2, 0.79, 0.1667, 548, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_calls = max_calls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L29_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [14, 2, 0.1518, 0.0052, 2, 0.79, 0.3333, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L30_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [14, 2, 0.1571, 0.0052, 2, 0.79, 0.5, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L31_C8", "label": "self.beg_time = to_sec()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [14, 2, 0.1623, 0.0052, 2, 0.79, 0.6667, 907, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.beg_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L32_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [14, 2, 0.1675, 0.0052, 2, 0.79, 0.8333, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(self.rate, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L33_C8", "label": "start()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "vector": [8, 2, 0.1728, 0.0052, 2, 0.79, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "label": "_run", "type": "function", "loc": [35, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "vector": [2, 1, 0.2356, 0.1099, 1, 0.05, 0.5, 736, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run(self):\n if not self.is_running:\n return\n\n act_time = self.beg_time + self.rate * (self.num_calls + 2)\n interval = act_time - rospy.Time.now().to_sec()\n self.thread = threading.Timer(interval, self._run)\n self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L36_C8", "label": "if", "type": "if", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [4, 2, 0.1911, 0.0105, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L37_C12", "label": "return", "type": "return", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L36_C8", "vector": [13, 3, 0.1937, 0.0052, 3, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L39_C8", "label": "act_time =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [14, 2, 0.2042, 0.0052, 2, 0.18, 0.1667, 352, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "act_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " act_time = self.beg_time + self.rate * (self.num_calls + 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L40_C8", "label": "interval =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [14, 2, 0.2094, 0.0052, 2, 0.18, 0.3333, 628, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "interval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " interval = act_time - rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L41_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [14, 2, 0.2147, 0.0052, 2, 0.18, 0.5, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(interval, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L42_C8", "label": "start()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [8, 2, 0.2199, 0.0052, 2, 0.18, 0.6667, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L44_C8", "label": "if", "type": "if", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [4, 2, 0.2382, 0.0209, 2, 0.18, 0.8333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.args is None:\n retval = self.cb()\n else:\n retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L45_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L44_C8", "vector": [14, 3, 0.2356, 0.0052, 3, 0.05, 0.0, 991, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L47_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L44_C8", "vector": [14, 3, 0.2461, 0.0052, 3, 0.05, 1.0, 991, 3, 1, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L52_C8", "label": "if", "type": "if", "loc": [52, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "vector": [4, 2, 0.2801, 0.0209, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.max_calls is not None:\n if self.num_calls == self.max_calls:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L53_C12", "label": "if", "type": "if", "loc": [53, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L52_C8", "vector": [4, 3, 0.2827, 0.0157, 3, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.num_calls == self.max_calls:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L54_C16", "label": "self.is_running =", "type": "assigned_variable", "loc": [54, 54], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L53_C12", "vector": [14, 4, 0.2827, 0.0052, 4, 0.17, 0.0, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L55_C16", "label": "return", "type": "return", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L53_C12", "vector": [13, 4, 0.288, 0.0052, 4, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "label": "stop", "type": "function", "loc": [60, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "vector": [2, 1, 0.3272, 0.0314, 1, 0.05, 0.75, 343, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.thread.cancel()\n if not self.is_running:\n return None\n self.is_running = False\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L61_C8", "label": "cancel()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "vector": [8, 2, 0.3194, 0.0052, 2, 0.08, 0.0, 732, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel", "arg_names": [], "import_names": [], "rhs_call_name": "cancel", "annotation": ""}, "snippet": " self.thread.cancel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L62_C8", "label": "if", "type": "if", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "vector": [4, 2, 0.3272, 0.0105, 2, 0.08, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L63_C12", "label": "return", "type": "return", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L62_C8", "vector": [13, 3, 0.3298, 0.0052, 3, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L64_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "vector": [14, 2, 0.3351, 0.0052, 2, 0.08, 0.6667, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "vector": [13, 2, 0.3403, 0.0052, 2, 0.08, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L69_C4", "label": "get_ret_vals", "type": "function", "loc": [69, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "vector": [2, 1, 0.3691, 0.0209, 1, 0.05, 1.0, 144, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_ret_vals", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ret_vals(self):\n if self.is_running:\n return None\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L70_C8", "label": "if", "type": "if", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L69_C4", "vector": [4, 2, 0.3691, 0.0105, 2, 0.4, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L71_C12", "label": "return", "type": "return", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L70_C8", "vector": [13, 3, 0.3717, 0.0052, 3, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L69_C4", "vector": [13, 2, 0.377, 0.0052, 2, 0.4, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "label": "PeriodicMonitor", "type": "class", "loc": [78, 191], "level": 0, "parent": null, "vector": [3, 0, 0.7042, 0.5969, 0, 0.66, 1.0, 589, 0, 7, 0, 0, 0, 0, 22], "semantic": {"name": "PeriodicMonitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PeriodicMonitor():\n ##\n # initializes the monitor but doesn't start it\n #\n # @param callback the function to be called each time\n # @param rate the rate in seconds at which to call the callback\n # @param args the function arguments to pass into the callback\n def __init__(self, callback, rate=0.01, args=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "label": "__init__", "type": "function", "loc": [85, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.4764, 0.0681, 1, 0.94, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "callback", "rate", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, callback, rate=0.01, args=None):\n self.ret = []\n self.cb = callback\n self.rate = rate\n self.args = args\n self.is_running = False\n self.num_calls = 0\n self.beg_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L86_C8", "label": "self.ret =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4503, 0.0052, 2, 0.28, 0.0, 172, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ret = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L87_C8", "label": "self.cb =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4555, 0.0052, 2, 0.28, 0.0909, 336, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cb", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cb = callback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L88_C8", "label": "self.rate =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4607, 0.0052, 2, 0.28, 0.1818, 6, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rate = rate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L89_C8", "label": "self.args =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.466, 0.0052, 2, 0.28, 0.2727, 640, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L90_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4712, 0.0052, 2, 0.28, 0.3636, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L91_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4764, 0.0052, 2, 0.28, 0.4545, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L92_C8", "label": "self.beg_time =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4817, 0.0052, 2, 0.28, 0.5455, 907, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.beg_time = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L93_C8", "label": "self.thread =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4869, 0.0052, 2, 0.28, 0.6364, 2, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.thread = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L94_C8", "label": "self.mean_model =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4921, 0.0052, 2, 0.28, 0.7273, 151, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.mean_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mean_model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L95_C8", "label": "self.variance_model =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.4974, 0.0052, 2, 0.28, 0.8182, 265, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.variance_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.variance_model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L96_C8", "label": "self.std_devs =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.5026, 0.0052, 2, 0.28, 0.9091, 192, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "self.std_devs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.std_devs = 0."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L97_C8", "label": "self.failure =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "vector": [14, 2, 0.5079, 0.0052, 2, 0.28, 1.0, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "label": "start", "type": "function", "loc": [103, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.5916, 0.1099, 1, 0.94, 0.1667, 511, 0, 7, 0, 0, 0, 0, 7], "semantic": {"name": "start", "arg_names": ["self", "mean_model", "variance_model", "std_devs", "max_calls", "contingency", "contingency_args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, mean_model, variance_model, std_devs=2.5, max_calls=None, \n contingency=None, contingency_args=None):\n if len(mean_model) != len(variance_model):\n log(\"Models must be of same length\")\n return\n if self.is_running:\n return\n self.is_running = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L105_C8", "label": "if", "type": "if", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [4, 2, 0.555, 0.0157, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(mean_model) != len(variance_model):\n log(\"Models must be of same length\")\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L106_C12", "label": "log()", "type": "expression", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L105_C8", "vector": [8, 3, 0.555, 0.0052, 3, 0.7, 0.0, 432, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "log", "annotation": ""}, "snippet": " log(\"Models must be of same length\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L107_C12", "label": "return", "type": "return", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L105_C8", "vector": [13, 3, 0.5602, 0.0052, 3, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L108_C8", "label": "if", "type": "if", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [4, 2, 0.5681, 0.0105, 2, 0.97, 0.0714, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L109_C12", "label": "return", "type": "return", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L108_C8", "vector": [13, 3, 0.5707, 0.0052, 3, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L110_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.5759, 0.0052, 2, 0.97, 0.1429, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L111_C8", "label": "self.mean_model =", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.5812, 0.0052, 2, 0.97, 0.2143, 151, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mean_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mean_model = mean_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L112_C8", "label": "self.variance_model =", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.5864, 0.0052, 2, 0.97, 0.2857, 265, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.variance_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.variance_model = variance_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L113_C8", "label": "self.std_devs =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.5916, 0.0052, 2, 0.97, 0.3571, 192, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.std_devs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.std_devs = std_devs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L114_C8", "label": "self.max_calls =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.5969, 0.0052, 2, 0.97, 0.4286, 548, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.max_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.max_calls = max_calls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L115_C8", "label": "self.contingency =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6021, 0.0052, 2, 0.97, 0.5, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.contingency", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contingency = contingency"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L116_C8", "label": "self.contincency_args =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6073, 0.0052, 2, 0.97, 0.5714, 257, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.contincency_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contincency_args = contingency_args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L117_C8", "label": "self.model_index =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6126, 0.0052, 2, 0.97, 0.6429, 186, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.model_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model_index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L118_C8", "label": "self.failure =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6178, 0.0052, 2, 0.97, 0.7143, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L120_C8", "label": "self.num_calls =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6283, 0.0052, 2, 0.97, 0.7857, 964, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.num_calls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.num_calls = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L121_C8", "label": "self.beg_time = to_sec()", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6335, 0.0052, 2, 0.97, 0.8571, 907, 3, 0, 0, 0, 750, 10, 2], "semantic": {"name": "self.beg_time", "arg_names": [], "import_names": [], "rhs_call_name": "to_sec", "annotation": ""}, "snippet": " self.beg_time = rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L122_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [14, 2, 0.6387, 0.0052, 2, 0.97, 0.9286, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(self.rate, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L123_C8", "label": "start()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "vector": [8, 2, 0.644, 0.0052, 2, 0.97, 1.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "label": "_run", "type": "function", "loc": [125, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.7565, 0.2094, 1, 0.94, 0.3333, 736, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "_run", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run(self):\n if not self.is_running:\n return\n\n act_time = self.beg_time + self.rate * (self.num_calls + 2)\n interval = act_time - rospy.Time.now().to_sec()\n self.thread = threading.Timer(interval, self._run)\n self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L126_C8", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [4, 2, 0.6623, 0.0105, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L127_C12", "label": "return", "type": "return", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L126_C8", "vector": [13, 3, 0.6649, 0.0052, 3, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L129_C8", "label": "act_time =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [14, 2, 0.6754, 0.0052, 2, 0.57, 0.125, 352, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "act_time", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " act_time = self.beg_time + self.rate * (self.num_calls + 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L130_C8", "label": "interval =", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [14, 2, 0.6806, 0.0052, 2, 0.57, 0.25, 628, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "interval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " interval = act_time - rospy.Time.now().to_sec()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L131_C8", "label": "self.thread = Timer()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [14, 2, 0.6859, 0.0052, 2, 0.57, 0.375, 2, 3, 2, 0, 0, 771, 10, 1], "semantic": {"name": "self.thread", "arg_names": [], "import_names": [], "rhs_call_name": "Timer", "annotation": ""}, "snippet": " self.thread = threading.Timer(interval, self._run)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L132_C8", "label": "start()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [8, 2, 0.6911, 0.0052, 2, 0.57, 0.5, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self.thread.start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L134_C8", "label": "if", "type": "if", "loc": [134, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [4, 2, 0.7094, 0.0209, 2, 0.57, 0.625, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.args is None:\n retval = self.cb()\n else:\n retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L135_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L134_C8", "vector": [14, 3, 0.7068, 0.0052, 3, 0.61, 0.0, 991, 3, 0, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L137_C12", "label": "retval = cb()", "type": "assigned_variable", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L134_C8", "vector": [14, 3, 0.7173, 0.0052, 3, 0.61, 1.0, 991, 3, 1, 0, 0, 540, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "cb", "annotation": ""}, "snippet": " retval = self.cb(*self.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "label": "for coord_i", "type": "for", "loc": [140, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [6, 2, 0.7644, 0.0681, 2, 0.57, 0.75, 534, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "coord_i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for coord_i in len(retval[1]):\n diff = abs(retval[1][coord_i] - self.mean_model[self.model_index][coord_i])\n deviation = np.sqrt(self.variance_model[self.model_index][coord_i])\n if diff > self.std_devs * deviation:\n # signal is outside allowable range\n self.failure = True\n self.is_running = False\n # call contingency function"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L141_C12", "label": "diff = abs()", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "vector": [14, 3, 0.7382, 0.0052, 3, 0.83, 0.0, 833, 3, 1, 0, 0, 799, 10, 1], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "abs", "annotation": ""}, "snippet": " diff = abs(retval[1][coord_i] - self.mean_model[self.model_index][coord_i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L142_C12", "label": "deviation = sqrt()", "type": "assigned_variable", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "vector": [14, 3, 0.7435, 0.0052, 3, 0.83, 0.5, 872, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "deviation", "arg_names": [], "import_names": [], "rhs_call_name": "sqrt", "annotation": ""}, "snippet": " deviation = np.sqrt(self.variance_model[self.model_index][coord_i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "label": "if", "type": "if", "loc": [143, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "vector": [4, 3, 0.7723, 0.0524, 3, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if diff > self.std_devs * deviation:\n # signal is outside allowable range\n self.failure = True\n self.is_running = False\n # call contingency function\n if contingency_args is None:\n self.contingency()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L145_C16", "label": "self.failure =", "type": "assigned_variable", "loc": [145, 145], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "vector": [14, 4, 0.7592, 0.0052, 4, 0.32, 0.0, 81, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failure = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L146_C16", "label": "self.is_running =", "type": "assigned_variable", "loc": [146, 146], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "vector": [14, 4, 0.7644, 0.0052, 4, 0.32, 0.3333, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L148_C16", "label": "if", "type": "if", "loc": [148, 151], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "vector": [4, 4, 0.7827, 0.0209, 4, 0.32, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if contingency_args is None:\n self.contingency()\n else:\n self.contingency(*contingency_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L149_C20", "label": "contingency()", "type": "expression", "loc": [149, 149], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L148_C16", "vector": [8, 5, 0.7801, 0.0052, 5, 0.16, 0.0, 16, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "contingency", "arg_names": [], "import_names": [], "rhs_call_name": "contingency", "annotation": ""}, "snippet": " self.contingency()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L151_C20", "label": "contingency()", "type": "expression", "loc": [151, 151], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L148_C16", "vector": [8, 5, 0.7906, 0.0052, 5, 0.16, 1.0, 16, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "contingency", "arg_names": [], "import_names": [], "rhs_call_name": "contingency", "annotation": ""}, "snippet": " self.contingency(*contingency_args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L152_C16", "label": "return", "type": "return", "loc": [152, 152], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "vector": [13, 4, 0.7958, 0.0052, 4, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L155_C8", "label": "if", "type": "if", "loc": [155, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [4, 2, 0.8168, 0.0157, 2, 0.57, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.model_index == len(self.mean_model):\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L156_C12", "label": "self.is_running =", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L155_C8", "vector": [14, 3, 0.8168, 0.0052, 3, 0.41, 0.0, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L157_C12", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L155_C8", "vector": [13, 3, 0.822, 0.0052, 3, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L160_C8", "label": "if", "type": "if", "loc": [160, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "vector": [4, 2, 0.8482, 0.0262, 2, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.max_calls is None:\n self.max_calls -= 1\n if self.max_calls == 0:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L162_C12", "label": "if", "type": "if", "loc": [162, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L160_C8", "vector": [4, 3, 0.8534, 0.0157, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.max_calls == 0:\n self.is_running = False\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L163_C16", "label": "self.is_running =", "type": "assigned_variable", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L162_C12", "vector": [14, 4, 0.8534, 0.0052, 4, 0.49, 0.0, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L164_C16", "label": "return", "type": "return", "loc": [164, 164], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L162_C12", "vector": [13, 4, 0.8586, 0.0052, 4, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "label": "stop", "type": "function", "loc": [169, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.8979, 0.0314, 1, 0.94, 0.5, 343, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "stop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop(self):\n self.thread.cancel()\n if not self.is_running:\n return None\n self.is_running = False\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L170_C8", "label": "cancel()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "vector": [8, 2, 0.8901, 0.0052, 2, 0.19, 0.0, 732, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cancel", "arg_names": [], "import_names": [], "rhs_call_name": "cancel", "annotation": ""}, "snippet": " self.thread.cancel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L171_C8", "label": "if", "type": "if", "loc": [171, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "vector": [4, 2, 0.8979, 0.0105, 2, 0.19, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L172_C12", "label": "return", "type": "return", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L171_C8", "vector": [13, 3, 0.9005, 0.0052, 3, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L173_C8", "label": "self.is_running =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "vector": [14, 2, 0.9058, 0.0052, 2, 0.19, 0.6667, 983, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.is_running", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_running = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "vector": [13, 2, 0.911, 0.0052, 2, 0.19, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L178_C4", "label": "get_ret_vals", "type": "function", "loc": [178, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.9398, 0.0209, 1, 0.94, 0.6667, 144, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_ret_vals", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ret_vals(self):\n if self.is_running:\n return None\n return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L179_C8", "label": "if", "type": "if", "loc": [179, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L178_C4", "vector": [4, 2, 0.9398, 0.0105, 2, 0.93, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_running:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L180_C12", "label": "return", "type": "return", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L179_C8", "vector": [13, 3, 0.9424, 0.0052, 3, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L181_C8", "label": "return", "type": "return", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L178_C4", "vector": [13, 2, 0.9476, 0.0052, 2, 0.93, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L184_C4", "label": "has_failed", "type": "function", "loc": [184, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.966, 0.0105, 1, 0.94, 0.8333, 302, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "has_failed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_failed():\n return self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L185_C8", "label": "return", "type": "return", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L184_C4", "vector": [13, 2, 0.9686, 0.0052, 2, 0.67, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L188_C4", "label": "wait_for_completion", "type": "function", "loc": [188, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "vector": [2, 1, 0.9921, 0.0209, 1, 0.94, 1.0, 608, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "wait_for_completion", "arg_names": ["rate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_for_completion(rate=0.01):\n while self.is_running and not rospy.is_shutdown():\n rospy.sleep(rate)\n return not self.failure"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:While_L189_C8", "label": "while", "type": "while", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L188_C4", "vector": [5, 2, 0.9921, 0.0105, 2, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.is_running and not rospy.is_shutdown():\n rospy.sleep(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L190_C12", "label": "sleep()", "type": "expression", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:While_L189_C8", "vector": [8, 3, 0.9948, 0.0052, 3, 0.74, 0.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(rate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L191_C8", "label": "return", "type": "return", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L188_C4", "vector": [13, 2, 1.0, 0.0052, 2, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not self.failure"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L54_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L53_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L148_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L148_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L149_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L148_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L151_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L143_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L152_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L164_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:While_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:While_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Expr_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99281:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99281:Return_L191_C8"}] |
#! /usr/bin/python
import sys
from PyQt4 import QtCore, QtGui, uic
import roslib
roslib.load_manifest("rospy")
import rospy
from controller_gui import Ui_Frame as QTControllerGUIFrame
from subprocess import Popen
class ControllerGUIFrame(QtGui.QFrame):
def __init__(self):
super(ControllerGUIFrame, self).__init__()
self.init_ui()
def init_ui(self):
self.ui = QTControllerGUIFrame()
self.ui.setupUi(self)
self.ui.start_button.clicked.connect(self.start_button_clk)
self.ui.kill_button.clicked.connect(self.kill_button_clk)
self.ui.restart_button.clicked.connect(self.restart_button_clk)
self.ui.controller_combo.addItem("%s_arm_controller")
self.ui.controller_combo.addItem("%s_cart")
self.ui.controller_combo.addItem("%s_joint_controller_low")
def start_button_clk(self):
controller = str(self.ui.controller_combo.currentText())
arm = str(self.ui.arm_combo.currentText())
ctrl_filled = controller % arm[0]
Popen("rosrun pr2_controller_manager pr2_controller_manager spawn %s" % ctrl_filled,
shell=True)
def kill_button_clk(self):
controller = str(self.ui.controller_combo.currentText())
arm = str(self.ui.arm_combo.currentText())
ctrl_filled = controller % arm[0]
Popen("rosrun pr2_controller_manager pr2_controller_manager kill %s" % ctrl_filled,
shell=True)
def restart_button_clk(self):
controller = str(self.ui.controller_combo.currentText())
arm = str(self.ui.arm_combo.currentText())
ctrl_filled = controller % arm[0]
Popen("rosrun pr2_controller_manager pr2_controller_manager kill %s" % ctrl_filled,
shell=True)
rospy.sleep(0.1)
Popen("rosrun pr2_controller_manager pr2_controller_manager spawn %s" % ctrl_filled,
shell=True)
def main():
rospy.init_node("controller_gui")
app = QtGui.QApplication(sys.argv)
frame = ControllerGUIFrame()
frame.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99282 | 45 | 61 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0164, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:ImportFrom_L4_C0", "label": "from PyQt4 import QtCore, QtGui, uic", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0164, 0, 0.66, 0.1111, 154, 0, 3, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui", "uic"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui, uic"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Import_L5_C0", "label": "roslib import roslib", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0164, 0, 0.66, 0.2222, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0984, 0.0164, 0, 0.66, 0.3333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"rospy\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Import_L7_C0", "label": "rospy import rospy", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1148, 0.0164, 0, 0.66, 0.4444, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:ImportFrom_L9_C0", "label": "from controller_gui import QTControllerGUIFrame", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1475, 0.0164, 0, 0.66, 0.5556, 898, 0, 1, 0, 0, 898, 0, 0], "semantic": {"name": "controller_gui", "arg_names": [], "import_names": ["QTControllerGUIFrame"], "rhs_call_name": "", "annotation": ""}, "snippet": "from controller_gui import Ui_Frame as QTControllerGUIFrame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:ImportFrom_L11_C0", "label": "from subprocess import Popen", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1803, 0.0164, 0, 0.66, 0.6667, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["Popen"], "rhs_call_name": "", "annotation": ""}, "snippet": "from subprocess import Popen"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "label": "ControllerGUIFrame", "type": "class", "loc": [13, 51], "level": 0, "parent": null, "vector": [3, 0, 0.5246, 0.6393, 0, 0.66, 0.7778, 383, 0, 5, 0, 0, 574, 0, 28], "semantic": {"name": "ControllerGUIFrame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ControllerGUIFrame(QtGui.QFrame):\n def __init__(self):\n super(ControllerGUIFrame, self).__init__()\n self.init_ui()\n\n def init_ui(self):\n self.ui = QTControllerGUIFrame()\n self.ui.setupUi(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L14_C4", "label": "__init__", "type": "function", "loc": [14, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "vector": [2, 1, 0.2459, 0.0492, 1, 0.81, 0.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n super(ControllerGUIFrame, self).__init__()\n self.init_ui()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L15_C8", "label": "__init__()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L14_C4", "vector": [8, 2, 0.2459, 0.0164, 2, 0.71, 0.0, 555, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(ControllerGUIFrame, self).__init__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L16_C8", "label": "init_ui()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L14_C4", "vector": [8, 2, 0.2623, 0.0164, 2, 0.71, 1.0, 643, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "init_ui", "arg_names": [], "import_names": [], "rhs_call_name": "init_ui", "annotation": ""}, "snippet": " self.init_ui()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "label": "init_ui", "type": "function", "loc": [18, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "vector": [2, 1, 0.3689, 0.1639, 1, 0.81, 0.25, 643, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "init_ui", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_ui(self):\n self.ui = QTControllerGUIFrame()\n self.ui.setupUi(self)\n\n self.ui.start_button.clicked.connect(self.start_button_clk)\n self.ui.kill_button.clicked.connect(self.kill_button_clk)\n self.ui.restart_button.clicked.connect(self.restart_button_clk)\n self.ui.controller_combo.addItem(\"%s_arm_controller\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L19_C8", "label": "self.ui = QTControllerGUIFrame()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [14, 2, 0.3115, 0.0164, 2, 0.19, 0.0, 413, 3, 0, 0, 0, 722, 10, 1], "semantic": {"name": "self.ui", "arg_names": [], "import_names": [], "rhs_call_name": "QTControllerGUIFrame", "annotation": ""}, "snippet": " self.ui = QTControllerGUIFrame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L20_C8", "label": "setupUi()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.3279, 0.0164, 2, 0.19, 0.1429, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setupUi", "arg_names": [], "import_names": [], "rhs_call_name": "setupUi", "annotation": ""}, "snippet": " self.ui.setupUi(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L22_C8", "label": "connect()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.3607, 0.0164, 2, 0.19, 0.2857, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.start_button.clicked.connect(self.start_button_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L23_C8", "label": "connect()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.377, 0.0164, 2, 0.19, 0.4286, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.kill_button.clicked.connect(self.kill_button_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L24_C8", "label": "connect()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.3934, 0.0164, 2, 0.19, 0.5714, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.ui.restart_button.clicked.connect(self.restart_button_clk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L25_C8", "label": "addItem()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.4098, 0.0164, 2, 0.19, 0.7143, 670, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " self.ui.controller_combo.addItem(\"%s_arm_controller\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L26_C8", "label": "addItem()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.4262, 0.0164, 2, 0.19, 0.8571, 670, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " self.ui.controller_combo.addItem(\"%s_cart\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L27_C8", "label": "addItem()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "vector": [8, 2, 0.4426, 0.0164, 2, 0.19, 1.0, 670, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addItem", "arg_names": [], "import_names": [], "rhs_call_name": "addItem", "annotation": ""}, "snippet": " self.ui.controller_combo.addItem(\"%s_joint_controller_low\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "label": "start_button_clk", "type": "function", "loc": [29, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "vector": [2, 1, 0.5164, 0.0984, 1, 0.81, 0.5, 418, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "start_button_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_button_clk(self):\n controller = str(self.ui.controller_combo.currentText())\n arm = str(self.ui.arm_combo.currentText())\n ctrl_filled = controller % arm[0]\n Popen(\"rosrun pr2_controller_manager pr2_controller_manager spawn %s\" % ctrl_filled, \n shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L30_C8", "label": "controller = str()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "vector": [14, 2, 0.4918, 0.0164, 2, 0.07, 0.0, 360, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "controller", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " controller = str(self.ui.controller_combo.currentText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L31_C8", "label": "arm = str()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "vector": [14, 2, 0.5082, 0.0164, 2, 0.07, 0.3333, 413, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " arm = str(self.ui.arm_combo.currentText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L32_C8", "label": "ctrl_filled =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "vector": [14, 2, 0.5246, 0.0164, 2, 0.07, 0.6667, 337, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ctrl_filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ctrl_filled = controller % arm[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L33_C8", "label": "Popen()", "type": "expression", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "vector": [8, 2, 0.5492, 0.0328, 2, 0.07, 1.0, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Popen", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " Popen(\"rosrun pr2_controller_manager pr2_controller_manager spawn %s\" % ctrl_filled, \n shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "label": "kill_button_clk", "type": "function", "loc": [36, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "vector": [2, 1, 0.6311, 0.0984, 1, 0.81, 0.75, 652, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "kill_button_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kill_button_clk(self):\n controller = str(self.ui.controller_combo.currentText())\n arm = str(self.ui.arm_combo.currentText())\n ctrl_filled = controller % arm[0]\n Popen(\"rosrun pr2_controller_manager pr2_controller_manager kill %s\" % ctrl_filled, \n shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L37_C8", "label": "controller = str()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "vector": [14, 2, 0.6066, 0.0164, 2, 0.2, 0.0, 360, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "controller", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " controller = str(self.ui.controller_combo.currentText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L38_C8", "label": "arm = str()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "vector": [14, 2, 0.623, 0.0164, 2, 0.2, 0.3333, 413, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " arm = str(self.ui.arm_combo.currentText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L39_C8", "label": "ctrl_filled =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "vector": [14, 2, 0.6393, 0.0164, 2, 0.2, 0.6667, 337, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ctrl_filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ctrl_filled = controller % arm[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L40_C8", "label": "Popen()", "type": "expression", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "vector": [8, 2, 0.6639, 0.0328, 2, 0.2, 1.0, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Popen", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " Popen(\"rosrun pr2_controller_manager pr2_controller_manager kill %s\" % ctrl_filled, \n shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "label": "restart_button_clk", "type": "function", "loc": [43, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "vector": [2, 1, 0.7705, 0.1475, 1, 0.81, 1.0, 54, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "restart_button_clk", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def restart_button_clk(self):\n controller = str(self.ui.controller_combo.currentText())\n arm = str(self.ui.arm_combo.currentText())\n ctrl_filled = controller % arm[0]\n Popen(\"rosrun pr2_controller_manager pr2_controller_manager kill %s\" % ctrl_filled, \n shell=True)\n rospy.sleep(0.1)\n Popen(\"rosrun pr2_controller_manager pr2_controller_manager spawn %s\" % ctrl_filled, "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L44_C8", "label": "controller = str()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "vector": [14, 2, 0.7213, 0.0164, 2, 0.94, 0.0, 360, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "controller", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " controller = str(self.ui.controller_combo.currentText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L45_C8", "label": "arm = str()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "vector": [14, 2, 0.7377, 0.0164, 2, 0.94, 0.2, 413, 3, 1, 0, 0, 52, 10, 2], "semantic": {"name": "arm", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " arm = str(self.ui.arm_combo.currentText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L46_C8", "label": "ctrl_filled =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "vector": [14, 2, 0.7541, 0.0164, 2, 0.94, 0.4, 337, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ctrl_filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ctrl_filled = controller % arm[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L47_C8", "label": "Popen()", "type": "expression", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "vector": [8, 2, 0.7787, 0.0328, 2, 0.94, 0.6, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Popen", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " Popen(\"rosrun pr2_controller_manager pr2_controller_manager kill %s\" % ctrl_filled, \n shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L49_C8", "label": "sleep()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "vector": [8, 2, 0.8033, 0.0164, 2, 0.94, 0.8, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L50_C8", "label": "Popen()", "type": "expression", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "vector": [8, 2, 0.8279, 0.0328, 2, 0.94, 1.0, 568, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "Popen", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " Popen(\"rosrun pr2_controller_manager pr2_controller_manager spawn %s\" % ctrl_filled, \n shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "label": "main", "type": "function", "loc": [53, 58], "level": 0, "parent": null, "vector": [2, 0, 0.9098, 0.0984, 0, 0.66, 0.8889, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"controller_gui\")\n app = QtGui.QApplication(sys.argv)\n frame = ControllerGUIFrame()\n frame.show()\n sys.exit(app.exec_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L54_C4", "label": "init_node()", "type": "expression", "loc": [54, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "vector": [8, 1, 0.8852, 0.0164, 1, 0.02, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(\"controller_gui\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L55_C4", "label": "app = QApplication()", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "vector": [14, 1, 0.9016, 0.0164, 1, 0.02, 0.25, 494, 3, 1, 0, 0, 447, 10, 1], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "QApplication", "annotation": ""}, "snippet": " app = QtGui.QApplication(sys.argv)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L56_C4", "label": "frame = ControllerGUIFrame()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "vector": [14, 1, 0.918, 0.0164, 1, 0.02, 0.5, 313, 3, 0, 0, 0, 383, 10, 1], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "ControllerGUIFrame", "annotation": ""}, "snippet": " frame = ControllerGUIFrame()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L57_C4", "label": "show()", "type": "expression", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "vector": [8, 1, 0.9344, 0.0164, 1, 0.02, 0.75, 497, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": [], "import_names": [], "rhs_call_name": "show", "annotation": ""}, "snippet": " frame.show()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L58_C4", "label": "exit()", "type": "expression", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "vector": [8, 1, 0.9508, 0.0164, 1, 0.02, 1.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(app.exec_())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:If_L60_C0", "label": "if", "type": "if", "loc": [60, 61], "level": 0, "parent": null, "vector": [4, 0, 0.9918, 0.0328, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L61_C4", "label": "main()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99282:If_L60_C0", "vector": [8, 1, 1.0, 0.0164, 1, 0.28, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99282:If_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99282:Expr_L61_C4"}] |
#! /usr/bin/python
import roslib
roslib.load_manifest('tf')
roslib.load_manifest('rosparam')
roslib.load_manifest('sensor_msgs')
import rospy
import rosparam
import rosbag
from sensor_msgs.msg import PointCloud2
from hrl_generic_arms.pose_converter import PoseConverter
from kelsey_sandbox.msg import PHRIPointCloudCapture
class PCSaver:
def __init__(self, pc_topic, base_frame, frames, filename):
self.base_frame = base_frame
self.frames = frames
self.seq = 0
self.bag = rosbag.Bag(filename, 'w')
rospy.Subscriber(pc_topic, PointCloud2, self.store_pc)
def store_pc(self, msg):
pcc = PHRIPointCloudCapture()
pcc.pc_capture = msg
pcc.saved_frames.header.seq = self.seq
pcc.saved_frames.header.frame_id = self.base_frame
pcc.saved_frames.header.stamp = rospy.Time.now()
for frame in self.frames:
try:
pos, quat = self.tf_list.lookupTransform(self.base_frame,
frame, rospy.Time(0))
pcc.saved_frames.poses.append(PoseConverter.to_pose_msg(pos, quat))
except:
print "FAILED TO CAPTURE POINTCLOUD, MISSING FRAME: %s" % frame
return
self.pcc = pcc
def save_pc(self):
self.bag.write("/point_cloud_captures", self.pcc)
self.seq += 1
def main():
rospy.init_node('phri_setup_capture')
from optparse import OptionParser
p = OptionParser()
p.add_option('-l', '--load_file', dest="load_file", default="",
help="YAML file to load parameters from.")
p.add_option('-b', '--bagfile', dest="bagname", default="phri_output.bag",
help="Bag file to save to.")
opts, args = p.parse_args()
assert opts.load_file != ""
params = rosparam.load_file(opts.load_file, "phri_setup_capture")[0][0]
base_frame = params['base_frame']
frames = params['frames_to_save']
pc_topic = params['pc_topic']
pcs = PCSaver(pc_topic, base_frame, frames, opts.bagname)
while not rospy.is_shutdown():
raw_input("Type 'd' when done: ")
pcs.save_pc()
pcs.bag.close()
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99283 | 50 | 69 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0145, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L4_C0", "label": "load_manifest()", "type": "expression", "loc": [4, 4], "level": 0, "parent": null, "vector": [8, 0, 0.058, 0.0145, 0, 0.66, 0.0833, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('tf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L5_C0", "label": "load_manifest()", "type": "expression", "loc": [5, 5], "level": 0, "parent": null, "vector": [8, 0, 0.0725, 0.0145, 0, 0.66, 0.1667, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('rosparam')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L6_C0", "label": "load_manifest()", "type": "expression", "loc": [6, 6], "level": 0, "parent": null, "vector": [8, 0, 0.087, 0.0145, 0, 0.66, 0.25, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest('sensor_msgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Import_L8_C0", "label": "rospy import rospy", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1159, 0.0145, 0, 0.66, 0.3333, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Import_L9_C0", "label": "rosparam import rosparam", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1304, 0.0145, 0, 0.66, 0.4167, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "rosparam", "arg_names": [], "import_names": ["rosparam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosparam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Import_L10_C0", "label": "rosbag import rosbag", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1449, 0.0145, 0, 0.66, 0.5, 243, 0, 1, 0, 0, 243, 0, 0], "semantic": {"name": "rosbag", "arg_names": [], "import_names": ["rosbag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosbag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:ImportFrom_L11_C0", "label": "from sensor_msgs.msg import PointCloud2", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1594, 0.0145, 0, 0.66, 0.5833, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["PointCloud2"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import PointCloud2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:ImportFrom_L12_C0", "label": "from hrl_generic_arms.pose_converter import PoseConverter", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1739, 0.0145, 0, 0.66, 0.6667, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "hrl_generic_arms.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:ImportFrom_L14_C0", "label": "from kelsey_sandbox.msg import PHRIPointCloudCapture", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.2029, 0.0145, 0, 0.66, 0.75, 978, 0, 1, 0, 0, 978, 0, 0], "semantic": {"name": "kelsey_sandbox.msg", "arg_names": [], "import_names": ["PHRIPointCloudCapture"], "rhs_call_name": "", "annotation": ""}, "snippet": "from kelsey_sandbox.msg import PHRIPointCloudCapture"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "label": "PCSaver", "type": "class", "loc": [16, 42], "level": 0, "parent": null, "vector": [3, 0, 0.4203, 0.3913, 0, 0.66, 0.8333, 984, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "PCSaver", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PCSaver:\n def __init__(self, pc_topic, base_frame, frames, filename):\n self.base_frame = base_frame\n self.frames = frames\n self.seq = 0\n self.bag = rosbag.Bag(filename, 'w')\n rospy.Subscriber(pc_topic, PointCloud2, self.store_pc)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "label": "__init__", "type": "function", "loc": [17, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "vector": [2, 1, 0.2826, 0.087, 1, 0.8, 0.0, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "pc_topic", "base_frame", "frames", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pc_topic, base_frame, frames, filename):\n self.base_frame = base_frame\n self.frames = frames\n self.seq = 0\n self.bag = rosbag.Bag(filename, 'w')\n rospy.Subscriber(pc_topic, PointCloud2, self.store_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L18_C8", "label": "self.base_frame =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "vector": [14, 2, 0.2609, 0.0145, 2, 0.5, 0.0, 200, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.base_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.base_frame = base_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L19_C8", "label": "self.frames =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "vector": [14, 2, 0.2754, 0.0145, 2, 0.5, 0.25, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.frames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.frames = frames"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L20_C8", "label": "self.seq =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "vector": [14, 2, 0.2899, 0.0145, 2, 0.5, 0.5, 635, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.seq = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L21_C8", "label": "self.bag = Bag()", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "vector": [14, 2, 0.3043, 0.0145, 2, 0.5, 0.75, 532, 3, 2, 0, 0, 568, 10, 1], "semantic": {"name": "self.bag", "arg_names": [], "import_names": [], "rhs_call_name": "Bag", "annotation": ""}, "snippet": " self.bag = rosbag.Bag(filename, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L22_C8", "label": "Subscriber()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "vector": [8, 2, 0.3188, 0.0145, 2, 0.5, 1.0, 455, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "Subscriber", "arg_names": [], "import_names": [], "rhs_call_name": "Subscriber", "annotation": ""}, "snippet": " rospy.Subscriber(pc_topic, PointCloud2, self.store_pc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "label": "store_pc", "type": "function", "loc": [24, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "vector": [2, 1, 0.4493, 0.2174, 1, 0.8, 0.5, 180, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "store_pc", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def store_pc(self, msg):\n pcc = PHRIPointCloudCapture()\n pcc.pc_capture = msg\n pcc.saved_frames.header.seq = self.seq\n pcc.saved_frames.header.frame_id = self.base_frame\n pcc.saved_frames.header.stamp = rospy.Time.now()\n for frame in self.frames:\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L25_C8", "label": "pcc = PHRIPointCloudCapture()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [14, 2, 0.3623, 0.0145, 2, 0.55, 0.0, 914, 3, 0, 0, 0, 631, 10, 1], "semantic": {"name": "pcc", "arg_names": [], "import_names": [], "rhs_call_name": "PHRIPointCloudCapture", "annotation": ""}, "snippet": " pcc = PHRIPointCloudCapture()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L26_C8", "label": "pcc.pc_capture =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [14, 2, 0.3768, 0.0145, 2, 0.55, 0.1667, 424, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pcc.pc_capture", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pcc.pc_capture = msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L27_C8", "label": "pcc.saved_frames.header.seq =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [14, 2, 0.3913, 0.0145, 2, 0.55, 0.3333, 594, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pcc.saved_frames.header.seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pcc.saved_frames.header.seq = self.seq"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L28_C8", "label": "pcc.saved_frames.header.frame_id =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [14, 2, 0.4058, 0.0145, 2, 0.55, 0.5, 604, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pcc.saved_frames.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pcc.saved_frames.header.frame_id = self.base_frame"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L29_C8", "label": "pcc.saved_frames.header.stamp = now()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [14, 2, 0.4203, 0.0145, 2, 0.55, 0.6667, 577, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "pcc.saved_frames.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "now", "annotation": ""}, "snippet": " pcc.saved_frames.header.stamp = rospy.Time.now()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:For_L30_C8", "label": "for frame", "type": "for", "loc": [30, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [6, 2, 0.4855, 0.1159, 2, 0.55, 0.8333, 313, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for frame in self.frames:\n try:\n pos, quat = self.tf_list.lookupTransform(self.base_frame, \n frame, rospy.Time(0))\n pcc.saved_frames.poses.append(PoseConverter.to_pose_msg(pos, quat))\n except:\n print(\"FAILED TO CAPTURE POINTCLOUD, MISSING FRAME: %s\" % frame)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "label": "try", "type": "try", "loc": [31, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:For_L30_C8", "vector": [7, 3, 0.4928, 0.1014, 3, 0.03, 0.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n pos, quat = self.tf_list.lookupTransform(self.base_frame, \n frame, rospy.Time(0))\n pcc.saved_frames.poses.append(PoseConverter.to_pose_msg(pos, quat))\n except:\n print(\"FAILED TO CAPTURE POINTCLOUD, MISSING FRAME: %s\" % frame)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L32_C16", "label": "pos, quat = lookupTransform()", "type": "assigned_variable", "loc": [32, 33], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "vector": [14, 4, 0.471, 0.029, 4, 0.49, 0.0, 375, 3, 3, 0, 0, 926, 10, 2], "semantic": {"name": "pos, quat", "arg_names": [], "import_names": [], "rhs_call_name": "lookupTransform", "annotation": ""}, "snippet": " pos, quat = self.tf_list.lookupTransform(self.base_frame, \n frame, rospy.Time(0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L34_C16", "label": "append()", "type": "expression", "loc": [34, 34], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "vector": [8, 4, 0.4928, 0.0145, 4, 0.49, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pcc.saved_frames.poses.append(PoseConverter.to_pose_msg(pos, quat))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L36_C16", "label": "print()", "type": "expression", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "vector": [8, 4, 0.5217, 0.0145, 4, 0.49, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"FAILED TO CAPTURE POINTCLOUD, MISSING FRAME: %s\" % frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Return_L37_C16", "label": "return", "type": "return", "loc": [37, 37], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "vector": [13, 4, 0.5362, 0.0145, 4, 0.49, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L38_C8", "label": "self.pcc =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "vector": [14, 2, 0.5507, 0.0145, 2, 0.55, 1.0, 666, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pcc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pcc = pcc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L40_C4", "label": "save_pc", "type": "function", "loc": [40, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "vector": [2, 1, 0.5942, 0.0435, 1, 0.8, 1.0, 975, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "save_pc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_pc(self):\n self.bag.write(\"/point_cloud_captures\", self.pcc)\n self.seq += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L41_C8", "label": "write()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L40_C4", "vector": [8, 2, 0.5942, 0.0145, 2, 0.29, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.bag.write(\"/point_cloud_captures\", self.pcc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "label": "main", "type": "function", "loc": [44, 65], "level": 0, "parent": null, "vector": [2, 0, 0.7899, 0.3188, 0, 0.66, 0.9167, 624, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node('phri_setup_capture')\n\n from optparse import OptionParser\n p = OptionParser()\n p.add_option('-l', '--load_file', dest=\"load_file\", default=\"\",\n help=\"YAML file to load parameters from.\")\n p.add_option('-b', '--bagfile', dest=\"bagname\", default=\"phri_output.bag\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L45_C4", "label": "init_node()", "type": "expression", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [8, 1, 0.6522, 0.0145, 1, 0.34, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node('phri_setup_capture')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:ImportFrom_L47_C4", "label": "from optparse import OptionParser", "type": "import", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [1, 1, 0.6812, 0.0145, 1, 0.34, 0.0833, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["OptionParser"], "rhs_call_name": "", "annotation": ""}, "snippet": " from optparse import OptionParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L48_C4", "label": "p = OptionParser()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.6957, 0.0145, 1, 0.34, 0.1667, 491, 3, 0, 0, 0, 894, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " p = OptionParser()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L49_C4", "label": "add_option()", "type": "expression", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [8, 1, 0.7174, 0.029, 1, 0.34, 0.25, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-l', '--load_file', dest=\"load_file\", default=\"\",\n help=\"YAML file to load parameters from.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L51_C4", "label": "add_option()", "type": "expression", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [8, 1, 0.7464, 0.029, 1, 0.34, 0.3333, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " p.add_option('-b', '--bagfile', dest=\"bagname\", default=\"phri_output.bag\",\n help=\"Bag file to save to.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L53_C4", "label": "opts, args = parse_args()", "type": "assigned_variable", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.7681, 0.0145, 1, 0.34, 0.4167, 616, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "opts, args", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " opts, args = p.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L56_C4", "label": "params =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.8116, 0.0145, 1, 0.34, 0.5, 206, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = rosparam.load_file(opts.load_file, \"phri_setup_capture\")[0][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L57_C4", "label": "base_frame =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.8261, 0.0145, 1, 0.34, 0.5833, 660, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "base_frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base_frame = params['base_frame']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L58_C4", "label": "frames =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.8406, 0.0145, 1, 0.34, 0.6667, 26, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "frames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " frames = params['frames_to_save']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L59_C4", "label": "pc_topic =", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.8551, 0.0145, 1, 0.34, 0.75, 633, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pc_topic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pc_topic = params['pc_topic']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L61_C4", "label": "pcs = PCSaver()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [14, 1, 0.8841, 0.0145, 1, 0.34, 0.8333, 230, 3, 4, 0, 0, 984, 10, 1], "semantic": {"name": "pcs", "arg_names": [], "import_names": [], "rhs_call_name": "PCSaver", "annotation": ""}, "snippet": " pcs = PCSaver(pc_topic, base_frame, frames, opts.bagname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:While_L62_C4", "label": "while", "type": "while", "loc": [62, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [5, 1, 0.913, 0.0435, 1, 0.34, 0.9167, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n raw_input(\"Type 'd' when done: \")\n pcs.save_pc()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L63_C8", "label": "raw_input()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:While_L62_C4", "vector": [8, 2, 0.913, 0.0145, 2, 0.56, 0.0, 821, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "raw_input", "arg_names": [], "import_names": [], "rhs_call_name": "raw_input", "annotation": ""}, "snippet": " raw_input(\"Type 'd' when done: \")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L64_C8", "label": "save_pc()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:While_L62_C4", "vector": [8, 2, 0.9275, 0.0145, 2, 0.56, 1.0, 975, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save_pc", "arg_names": [], "import_names": [], "rhs_call_name": "save_pc", "annotation": ""}, "snippet": " pcs.save_pc()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L65_C4", "label": "close()", "type": "expression", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "vector": [8, 1, 0.942, 0.0145, 1, 0.34, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " pcs.bag.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:If_L68_C0", "label": "if", "type": "if", "loc": [68, 69], "level": 0, "parent": null, "vector": [4, 0, 0.9928, 0.029, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L69_C4", "label": "main()", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99283:If_L68_C0", "vector": [8, 1, 1.0, 0.0145, 1, 0.89, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:For_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:For_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L32_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L34_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L36_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:Try_L31_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Return_L37_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:ImportFrom_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:While_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:While_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:While_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99283:If_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99283:Expr_L69_C4"}] |
#! /usr/bin/python
import sys
import numpy as np
import copy
import roslib
roslib.load_manifest("hrl_pr2_arms")
roslib.load_manifest("kelsey_sandbox")
import rospy
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import Point, Quaternion, Vector3, PoseStamped
from std_msgs.msg import ColorRGBA
from sensor_msgs.msg import JointState
import tf.transformations as tf_trans
from equilibrium_point_control.pose_converter import PoseConverter
import urdf_interface as urdf
import kdl_parser as kdlp
from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics
from equilibrium_point_control.pose_converter import PoseConverter
from hrl_pr2_arms.pr2_arm_kinematics import PR2ArmKinematics
from hrl_pr2_arms.pr2_arm import PR2ArmJointTrajectory, PR2ArmJTranspose
from spheroid_space import SpheroidSpace
JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22]
JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34]
class SpheroidViz:
def __init__(self):
rot = np.mat([[1, 0, 0], [0, 1./np.sqrt(2), -1./np.sqrt(2)], [0, 1./np.sqrt(2), 1./np.sqrt(2)]])
self.sspace = SpheroidSpace(0.2)#, np.mat([1.0, 0.5, 0.5]).T, rot)
self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]
self.vis_pub = rospy.Publisher("force_torque_markers_array", MarkerArray)
self.pose_pub = rospy.Publisher("spheroid_poses", PoseStamped)
m = Marker()
m.header.frame_id = "torso_lift_link"
m.header.stamp = rospy.Time()
m.ns = "force_torque"
m.id = 0
m.type = Marker.ARROW
m.action = Marker.ADD
#m.points.append(Point(0, 0, 0))
m.scale = Vector3(0.01, 0.01, 0.01)
m.color = self.colors[0]
#self.vis_pub.publish(m)
self.m = m
self.ma = MarkerArray()
def publish_vector(self, m_id):
new_m = copy.deepcopy(self.m)
new_m.id = m_id
u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)
pos = self.sspace.spheroidal_to_cart((u, v, p))
new_m.points.append(Point(*pos))
df_du = self.sspace.partial_u((u, v, p))
df_du *= 0.1 / np.linalg.norm(df_du)
new_m.points.append(Point(*(pos+df_du)))
self.ma.markers.append(new_m)
self.vis_pub.publish(self.ma)
rot_gripper = np.pi/4.
nx, ny, nz = df_du.T.A[0] / np.linalg.norm(df_du)
j = np.sqrt(1./(1.+ny*ny/(nz*nz)))
k = -ny*j/nz
norm_rot = np.mat([[-nx, ny*k - nz*j, 0],
[-ny, -nx*k, j],
[-nz, nx*j, k]])
_, norm_quat = PoseConverter.to_pos_quat(np.mat([0, 0, 0]).T, norm_rot)
rot_angle = np.arctan(-norm_rot[2,1] / norm_rot[2,2])
quat_ortho_rot = tf_trans.quaternion_from_euler(rot_angle + np.pi + rot_gripper, 0.0, 0.0)
norm_quat_ortho = tf_trans.quaternion_multiply(norm_quat, quat_ortho_rot)
ps_msg = PoseConverter.to_pose_stamped_msg("torso_lift_link", pos, norm_quat_ortho)
self.pose_pub.publish(ps_msg)
def fix_pr2_angs(q, min_lims, max_lims):
q_mod = np.mod(q, 2 * np.pi)
in_lims_a = np.clip(q_mod, min_lims, max_lims) == q_mod
in_lims_b = np.clip(q_mod - 2 * np.pi, min_lims, max_lims) == q_mod
if np.all(np.any([in_lims_a, in_lims_b])):
return np.where(in_lims_a, q_mod, q_mod - 2 * np.pi)
return None
def main():
rospy.init_node("ellipsoidal_ik")
sspace = SpheroidSpace(0.2, np.mat([0.78, -0.28, 0.3]).T)
kin = PR2ArmKinematics('r')
jarm = PR2ArmJointTrajectory('r', kin)
while not rospy.is_shutdown():
u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)
pos, rot = sspace.spheroidal_to_pose((u, v, p))
q = kin.IK(pos, rot)
if not q is None:
print q
#print np.mod(q, 2 * np.pi)
rospy.sleep(0.1)
#jarm.set_ep([0.1]*7, 15)
return
jfv = SpheroidViz()
i = 0
while not rospy.is_shutdown():
jfv.publish_vector(i)
i += 1
rospy.sleep(0.5)
return
if __name__ == "__main__":
main()
| ajibawa-2023/Python-Code-Large/train/row_99284 | 89 | 118 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0254, 0.0085, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L4_C0", "label": "numpy import np", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0339, 0.0085, 0, 0.66, 0.04, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L5_C0", "label": "copy import copy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 0.0085, 0, 0.66, 0.08, 739, 0, 1, 0, 0, 739, 0, 0], "semantic": {"name": "copy", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L7_C0", "label": "roslib import roslib", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0593, 0.0085, 0, 0.66, 0.12, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.0678, 0.0085, 0, 0.66, 0.16, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"hrl_pr2_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.0763, 0.0085, 0, 0.66, 0.2, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"kelsey_sandbox\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L10_C0", "label": "rospy import rospy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0085, 0, 0.66, 0.24, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L11_C0", "label": "from visualization_msgs.msg import Marker, MarkerArray", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0932, 0.0085, 0, 0.66, 0.28, 124, 0, 2, 0, 0, 124, 0, 0], "semantic": {"name": "visualization_msgs.msg", "arg_names": [], "import_names": ["Marker", "MarkerArray"], "rhs_call_name": "", "annotation": ""}, "snippet": "from visualization_msgs.msg import Marker, MarkerArray"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L12_C0", "label": "from geometry_msgs.msg import Point, Quaternion, Vector3\u2026", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0085, 0, 0.66, 0.32, 951, 0, 4, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["Point", "Quaternion", "Vector3", "PoseStamped"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import Point, Quaternion, Vector3, PoseStamped"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L13_C0", "label": "from std_msgs.msg import ColorRGBA", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1102, 0.0085, 0, 0.66, 0.36, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["ColorRGBA"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import ColorRGBA"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L14_C0", "label": "from sensor_msgs.msg import JointState", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1186, 0.0085, 0, 0.66, 0.4, 531, 0, 1, 0, 0, 531, 0, 0], "semantic": {"name": "sensor_msgs.msg", "arg_names": [], "import_names": ["JointState"], "rhs_call_name": "", "annotation": ""}, "snippet": "from sensor_msgs.msg import JointState"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L15_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1271, 0.0085, 0, 0.66, 0.44, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tf_trans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L16_C0", "label": "from equilibrium_point_control.pose_converter import PoseConverter", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1356, 0.0085, 0, 0.66, 0.48, 503, 0, 1, 0, 0, 503, 0, 0], "semantic": {"name": "equilibrium_point_control.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L18_C0", "label": "urdf_interface import urdf", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1525, 0.0085, 0, 0.66, 0.52, 414, 0, 1, 0, 0, 414, 0, 0], "semantic": {"name": "urdf_interface", "arg_names": [], "import_names": ["urdf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urdf_interface as urdf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Import_L19_C0", "label": "kdl_parser import kdlp", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.161, 0.0085, 0, 0.66, 0.56, 470, 0, 1, 0, 0, 470, 0, 0], "semantic": {"name": "kdl_parser", "arg_names": [], "import_names": ["kdlp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import kdl_parser as kdlp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L20_C0", "label": "from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1695, 0.0085, 0, 0.66, 0.6, 277, 0, 1, 0, 0, 277, 0, 0], "semantic": {"name": "hrl_pr2_arms.kdl_arm_kinematics", "arg_names": [], "import_names": ["KDLArmKinematics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.kdl_arm_kinematics import KDLArmKinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L21_C0", "label": "from equilibrium_point_control.pose_converter import PoseConverter", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.178, 0.0085, 0, 0.66, 0.64, 503, 0, 1, 0, 0, 503, 0, 0], "semantic": {"name": "equilibrium_point_control.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from equilibrium_point_control.pose_converter import PoseConverter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L22_C0", "label": "from hrl_pr2_arms.pr2_arm_kinematics import PR2ArmKinematics", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1864, 0.0085, 0, 0.66, 0.68, 214, 0, 1, 0, 0, 214, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm_kinematics", "arg_names": [], "import_names": ["PR2ArmKinematics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm_kinematics import PR2ArmKinematics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L23_C0", "label": "from hrl_pr2_arms.pr2_arm import PR2ArmJointTrajectory, PR2ArmJTranspose", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.1949, 0.0085, 0, 0.66, 0.72, 253, 0, 2, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["PR2ArmJointTrajectory", "PR2ArmJTranspose"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import PR2ArmJointTrajectory, PR2ArmJTranspose"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ImportFrom_L25_C0", "label": "from spheroid_space import SpheroidSpace", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2119, 0.0085, 0, 0.66, 0.76, 746, 0, 1, 0, 0, 746, 0, 0], "semantic": {"name": "spheroid_space", "arg_names": [], "import_names": ["SpheroidSpace"], "rhs_call_name": "", "annotation": ""}, "snippet": "from spheroid_space import SpheroidSpace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L27_C0", "label": "JOINT_STATE_INDS_R =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.2288, 0.0085, 0, 0.66, 0.8, 720, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_R", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_R = [17, 18, 16, 20, 19, 21, 22]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L28_C0", "label": "JOINT_STATE_INDS_L =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2373, 0.0085, 0, 0.66, 0.84, 742, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "JOINT_STATE_INDS_L", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOINT_STATE_INDS_L = [29, 30, 28, 32, 31, 33, 34]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:ClassDef_L30_C0", "label": "SpheroidViz", "type": "class", "loc": [30, 80], "level": 0, "parent": null, "vector": [3, 0, 0.4661, 0.4322, 0, 0.66, 0.88, 119, 0, 2, 0, 0, 0, 0, 36], "semantic": {"name": "SpheroidViz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SpheroidViz:\n def __init__(self):\n rot = np.mat([[1, 0, 0], [0, 1./np.sqrt(2), -1./np.sqrt(2)], [0, 1./np.sqrt(2), 1./np.sqrt(2)]])\n self.sspace = SpheroidSpace(0.2)#, np.mat([1.0, 0.5, 0.5]).T, rot)\n self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]\n self.vis_pub = rospy.Publisher(\"force_torque_markers_array\", MarkerArray)\n self.pose_pub = rospy.Publisher(\"spheroid_poses\", PoseStamped)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:ClassDef_L30_C0", "vector": [2, 1, 0.3475, 0.178, 1, 0.25, 0.0, 555, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n rot = np.mat([[1, 0, 0], [0, 1./np.sqrt(2), -1./np.sqrt(2)], [0, 1./np.sqrt(2), 1./np.sqrt(2)]])\n self.sspace = SpheroidSpace(0.2)#, np.mat([1.0, 0.5, 0.5]).T, rot)\n self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]\n self.vis_pub = rospy.Publisher(\"force_torque_markers_array\", MarkerArray)\n self.pose_pub = rospy.Publisher(\"spheroid_poses\", PoseStamped)\n\n m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L32_C8", "label": "rot = mat()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.2712, 0.0085, 2, 0.2, 0.0, 812, 3, 1, 0, 0, 882, 10, 5], "semantic": {"name": "rot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " rot = np.mat([[1, 0, 0], [0, 1./np.sqrt(2), -1./np.sqrt(2)], [0, 1./np.sqrt(2), 1./np.sqrt(2)]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L33_C8", "label": "self.sspace = SpheroidSpace()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.2797, 0.0085, 2, 0.2, 0.0667, 744, 3, 1, 0, 0, 883, 10, 1], "semantic": {"name": "self.sspace", "arg_names": [], "import_names": [], "rhs_call_name": "SpheroidSpace", "annotation": ""}, "snippet": " self.sspace = SpheroidSpace(0.2)#, np.mat([1.0, 0.5, 0.5]).T, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L34_C8", "label": "self.colors =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.2881, 0.0085, 2, 0.2, 0.1333, 375, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "self.colors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.colors = [ColorRGBA(1., 0., 0., 1.), ColorRGBA(0., 1., 0., 1.)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L35_C8", "label": "self.vis_pub = Publisher()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.2966, 0.0085, 2, 0.2, 0.2, 911, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.vis_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.vis_pub = rospy.Publisher(\"force_torque_markers_array\", MarkerArray)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L36_C8", "label": "self.pose_pub = Publisher()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3051, 0.0085, 2, 0.2, 0.2667, 26, 3, 2, 0, 0, 45, 10, 1], "semantic": {"name": "self.pose_pub", "arg_names": [], "import_names": [], "rhs_call_name": "Publisher", "annotation": ""}, "snippet": " self.pose_pub = rospy.Publisher(\"spheroid_poses\", PoseStamped)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L38_C8", "label": "m = Marker()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.322, 0.0085, 2, 0.2, 0.3333, 711, 3, 0, 0, 0, 923, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Marker", "annotation": ""}, "snippet": " m = Marker()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L39_C8", "label": "m.header.frame_id =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3305, 0.0085, 2, 0.2, 0.4, 636, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.header.frame_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.header.frame_id = \"torso_lift_link\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L40_C8", "label": "m.header.stamp = Time()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.339, 0.0085, 2, 0.2, 0.4667, 726, 3, 0, 0, 0, 451, 10, 1], "semantic": {"name": "m.header.stamp", "arg_names": [], "import_names": [], "rhs_call_name": "Time", "annotation": ""}, "snippet": " m.header.stamp = rospy.Time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L41_C8", "label": "m.ns =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3475, 0.0085, 2, 0.2, 0.5333, 889, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "m.ns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.ns = \"force_torque\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L42_C8", "label": "m.id =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3559, 0.0085, 2, 0.2, 0.6, 46, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L43_C8", "label": "m.type =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3644, 0.0085, 2, 0.2, 0.6667, 148, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.type = Marker.ARROW"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L44_C8", "label": "m.action =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3729, 0.0085, 2, 0.2, 0.7333, 654, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.action", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.action = Marker.ADD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L46_C8", "label": "m.scale = Vector3()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3898, 0.0085, 2, 0.2, 0.8, 508, 3, 3, 0, 0, 759, 10, 1], "semantic": {"name": "m.scale", "arg_names": [], "import_names": [], "rhs_call_name": "Vector3", "annotation": ""}, "snippet": " m.scale = Vector3(0.01, 0.01, 0.01)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L47_C8", "label": "m.color =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.3983, 0.0085, 2, 0.2, 0.8667, 882, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m.color", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m.color = self.colors[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L49_C8", "label": "self.m =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.4153, 0.0085, 2, 0.2, 0.9333, 561, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.m = m"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L51_C8", "label": "self.ma = MarkerArray()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "vector": [14, 2, 0.4322, 0.0085, 2, 0.2, 1.0, 291, 3, 0, 0, 0, 49, 10, 1], "semantic": {"name": "self.ma", "arg_names": [], "import_names": [], "rhs_call_name": "MarkerArray", "annotation": ""}, "snippet": " self.ma = MarkerArray()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "label": "publish_vector", "type": "function", "loc": [53, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:ClassDef_L30_C0", "vector": [2, 1, 0.5636, 0.2373, 1, 0.25, 1.0, 415, 0, 2, 0, 0, 0, 0, 22], "semantic": {"name": "publish_vector", "arg_names": ["self", "m_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def publish_vector(self, m_id):\n new_m = copy.deepcopy(self.m)\n new_m.id = m_id\n u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)\n pos = self.sspace.spheroidal_to_cart((u, v, p))\n new_m.points.append(Point(*pos))\n\n df_du = self.sspace.partial_u((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L54_C8", "label": "new_m = deepcopy()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.4576, 0.0085, 2, 0.35, 0.0, 428, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "new_m", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " new_m = copy.deepcopy(self.m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L55_C8", "label": "new_m.id =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.4661, 0.0085, 2, 0.35, 0.0526, 385, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_m.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_m.id = m_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L56_C8", "label": "u, v, p =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.4746, 0.0085, 2, 0.35, 0.1053, 60, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "u, v, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L57_C8", "label": "pos = spheroidal_to_cart()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.4831, 0.0085, 2, 0.35, 0.1579, 627, 3, 1, 0, 0, 654, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "spheroidal_to_cart", "annotation": ""}, "snippet": " pos = self.sspace.spheroidal_to_cart((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L58_C8", "label": "append()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [8, 2, 0.4915, 0.0085, 2, 0.35, 0.2105, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_m.points.append(Point(*pos))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L60_C8", "label": "df_du = partial_u()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.5085, 0.0085, 2, 0.35, 0.2632, 365, 3, 1, 0, 0, 662, 10, 1], "semantic": {"name": "df_du", "arg_names": [], "import_names": [], "rhs_call_name": "partial_u", "annotation": ""}, "snippet": " df_du = self.sspace.partial_u((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L62_C8", "label": "append()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [8, 2, 0.5254, 0.0085, 2, 0.35, 0.3158, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_m.points.append(Point(*(pos+df_du)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L64_C8", "label": "append()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [8, 2, 0.5424, 0.0085, 2, 0.35, 0.3684, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.ma.markers.append(new_m)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L65_C8", "label": "publish()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [8, 2, 0.5508, 0.0085, 2, 0.35, 0.4211, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.vis_pub.publish(self.ma)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L67_C8", "label": "rot_gripper =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.5678, 0.0085, 2, 0.35, 0.4737, 283, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rot_gripper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rot_gripper = np.pi/4."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L69_C8", "label": "nx, ny, nz =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.5847, 0.0085, 2, 0.35, 0.5263, 788, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "nx, ny, nz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " nx, ny, nz = df_du.T.A[0] / np.linalg.norm(df_du)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L70_C8", "label": "j = sqrt()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.5932, 0.0085, 2, 0.35, 0.5789, 100, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "sqrt", "annotation": ""}, "snippet": " j = np.sqrt(1./(1.+ny*ny/(nz*nz)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L71_C8", "label": "k =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.6017, 0.0085, 2, 0.35, 0.6316, 954, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " k = -ny*j/nz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L72_C8", "label": "norm_rot = mat()", "type": "assigned_variable", "loc": [72, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.6186, 0.0254, 2, 0.35, 0.6842, 745, 3, 1, 0, 0, 882, 10, 1], "semantic": {"name": "norm_rot", "arg_names": [], "import_names": [], "rhs_call_name": "mat", "annotation": ""}, "snippet": " norm_rot = np.mat([[-nx, ny*k - nz*j, 0], \n [-ny, -nx*k, j], \n [-nz, nx*j, k]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L75_C8", "label": "_, norm_quat = to_pos_quat()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.6356, 0.0085, 2, 0.35, 0.7368, 676, 3, 2, 0, 0, 926, 10, 2], "semantic": {"name": "_, norm_quat", "arg_names": [], "import_names": [], "rhs_call_name": "to_pos_quat", "annotation": ""}, "snippet": " _, norm_quat = PoseConverter.to_pos_quat(np.mat([0, 0, 0]).T, norm_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L76_C8", "label": "rot_angle = arctan()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.6441, 0.0085, 2, 0.35, 0.7895, 748, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "rot_angle", "arg_names": [], "import_names": [], "rhs_call_name": "arctan", "annotation": ""}, "snippet": " rot_angle = np.arctan(-norm_rot[2,1] / norm_rot[2,2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L77_C8", "label": "quat_ortho_rot = quaternion_from_euler()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.6525, 0.0085, 2, 0.35, 0.8421, 431, 3, 3, 0, 0, 561, 10, 1], "semantic": {"name": "quat_ortho_rot", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_from_euler", "annotation": ""}, "snippet": " quat_ortho_rot = tf_trans.quaternion_from_euler(rot_angle + np.pi + rot_gripper, 0.0, 0.0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L78_C8", "label": "norm_quat_ortho = quaternion_multiply()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.661, 0.0085, 2, 0.35, 0.8947, 439, 3, 2, 0, 0, 339, 10, 1], "semantic": {"name": "norm_quat_ortho", "arg_names": [], "import_names": [], "rhs_call_name": "quaternion_multiply", "annotation": ""}, "snippet": " norm_quat_ortho = tf_trans.quaternion_multiply(norm_quat, quat_ortho_rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L79_C8", "label": "ps_msg = to_pose_stamped_msg()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [14, 2, 0.6695, 0.0085, 2, 0.35, 0.9474, 682, 3, 3, 0, 0, 996, 10, 1], "semantic": {"name": "ps_msg", "arg_names": [], "import_names": [], "rhs_call_name": "to_pose_stamped_msg", "annotation": ""}, "snippet": " ps_msg = PoseConverter.to_pose_stamped_msg(\"torso_lift_link\", pos, norm_quat_ortho)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L80_C8", "label": "publish()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "vector": [8, 2, 0.678, 0.0085, 2, 0.35, 1.0, 102, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish", "arg_names": [], "import_names": [], "rhs_call_name": "publish", "annotation": ""}, "snippet": " self.pose_pub.publish(ps_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "label": "fix_pr2_angs", "type": "function", "loc": [82, 88], "level": 0, "parent": null, "vector": [2, 0, 0.7203, 0.0593, 0, 0.66, 0.92, 731, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "fix_pr2_angs", "arg_names": ["q", "min_lims", "max_lims"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def fix_pr2_angs(q, min_lims, max_lims):\n q_mod = np.mod(q, 2 * np.pi)\n in_lims_a = np.clip(q_mod, min_lims, max_lims) == q_mod\n in_lims_b = np.clip(q_mod - 2 * np.pi, min_lims, max_lims) == q_mod\n if np.all(np.any([in_lims_a, in_lims_b])):\n return np.where(in_lims_a, q_mod, q_mod - 2 * np.pi)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L83_C4", "label": "q_mod = mod()", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "vector": [14, 1, 0.7034, 0.0085, 1, 0.49, 0.0, 384, 3, 2, 0, 0, 25, 10, 1], "semantic": {"name": "q_mod", "arg_names": [], "import_names": [], "rhs_call_name": "mod", "annotation": ""}, "snippet": " q_mod = np.mod(q, 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L84_C4", "label": "in_lims_a =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "vector": [14, 1, 0.7119, 0.0085, 1, 0.49, 0.25, 58, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "in_lims_a", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " in_lims_a = np.clip(q_mod, min_lims, max_lims) == q_mod"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L85_C4", "label": "in_lims_b =", "type": "assigned_variable", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "vector": [14, 1, 0.7203, 0.0085, 1, 0.49, 0.5, 833, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "in_lims_b", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " in_lims_b = np.clip(q_mod - 2 * np.pi, min_lims, max_lims) == q_mod"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L86_C4", "label": "if", "type": "if", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "vector": [4, 1, 0.7331, 0.0169, 1, 0.49, 0.75, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if np.all(np.any([in_lims_a, in_lims_b])):\n return np.where(in_lims_a, q_mod, q_mod - 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L86_C4", "vector": [13, 2, 0.7373, 0.0085, 2, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return np.where(in_lims_a, q_mod, q_mod - 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "vector": [13, 1, 0.7458, 0.0085, 1, 0.49, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "label": "main", "type": "function", "loc": [91, 115], "level": 0, "parent": null, "vector": [2, 0, 0.8729, 0.2119, 0, 0.66, 0.96, 624, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n rospy.init_node(\"ellipsoidal_ik\")\n sspace = SpheroidSpace(0.2, np.mat([0.78, -0.28, 0.3]).T)\n kin = PR2ArmKinematics('r')\n jarm = PR2ArmJointTrajectory('r', kin)\n\n while not rospy.is_shutdown():\n u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L92_C4", "label": "init_node()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [8, 1, 0.7797, 0.0085, 1, 0.72, 0.0, 463, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "init_node", "arg_names": [], "import_names": [], "rhs_call_name": "init_node", "annotation": ""}, "snippet": " rospy.init_node(\"ellipsoidal_ik\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L93_C4", "label": "sspace = SpheroidSpace()", "type": "assigned_variable", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [14, 1, 0.7881, 0.0085, 1, 0.72, 0.1111, 794, 3, 2, 0, 0, 883, 10, 2], "semantic": {"name": "sspace", "arg_names": [], "import_names": [], "rhs_call_name": "SpheroidSpace", "annotation": ""}, "snippet": " sspace = SpheroidSpace(0.2, np.mat([0.78, -0.28, 0.3]).T)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L94_C4", "label": "kin = PR2ArmKinematics()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [14, 1, 0.7966, 0.0085, 1, 0.72, 0.2222, 464, 3, 1, 0, 0, 108, 10, 1], "semantic": {"name": "kin", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmKinematics", "annotation": ""}, "snippet": " kin = PR2ArmKinematics('r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L95_C4", "label": "jarm = PR2ArmJointTrajectory()", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [14, 1, 0.8051, 0.0085, 1, 0.72, 0.3333, 226, 3, 2, 0, 0, 556, 10, 1], "semantic": {"name": "jarm", "arg_names": [], "import_names": [], "rhs_call_name": "PR2ArmJointTrajectory", "annotation": ""}, "snippet": " jarm = PR2ArmJointTrajectory('r', kin)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "label": "while", "type": "while", "loc": [97, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [5, 1, 0.8517, 0.0678, 1, 0.72, 0.4444, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)\n pos, rot = sspace.spheroidal_to_pose((u, v, p))\n q = kin.IK(pos, rot)\n if not q is None:\n print(q)\n#print np.mod(q, 2 * np.pi)\n rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L98_C8", "label": "u, v, p =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "vector": [14, 2, 0.8305, 0.0085, 2, 0.44, 0.0, 60, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "u, v, p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " u, v, p = 1, np.random.uniform(0, np.pi), np.random.uniform(0, 2 * np.pi)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L99_C8", "label": "pos, rot = spheroidal_to_pose()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "vector": [14, 2, 0.839, 0.0085, 2, 0.44, 0.25, 298, 3, 1, 0, 0, 57, 10, 1], "semantic": {"name": "pos, rot", "arg_names": [], "import_names": [], "rhs_call_name": "spheroidal_to_pose", "annotation": ""}, "snippet": " pos, rot = sspace.spheroidal_to_pose((u, v, p))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L100_C8", "label": "q = IK()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "vector": [14, 2, 0.8475, 0.0085, 2, 0.44, 0.5, 516, 3, 2, 0, 0, 719, 10, 1], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "IK", "annotation": ""}, "snippet": " q = kin.IK(pos, rot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L101_C8", "label": "if", "type": "if", "loc": [101, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "vector": [4, 2, 0.8602, 0.0169, 2, 0.44, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not q is None:\n print(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L102_C12", "label": "print()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L101_C8", "vector": [8, 3, 0.8644, 0.0085, 3, 0.3, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(q)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L104_C8", "label": "sleep()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "vector": [8, 2, 0.8814, 0.0085, 2, 0.44, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L107_C4", "label": "return", "type": "return", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [13, 1, 0.9068, 0.0085, 1, 0.72, 0.5556, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L109_C4", "label": "jfv = SpheroidViz()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [14, 1, 0.9237, 0.0085, 1, 0.72, 0.6667, 177, 3, 0, 0, 0, 119, 10, 1], "semantic": {"name": "jfv", "arg_names": [], "import_names": [], "rhs_call_name": "SpheroidViz", "annotation": ""}, "snippet": " jfv = SpheroidViz()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L110_C4", "label": "i =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [14, 1, 0.9322, 0.0085, 1, 0.72, 0.7778, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L111_C4", "label": "while", "type": "while", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [5, 1, 0.9534, 0.0339, 1, 0.72, 0.8889, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not rospy.is_shutdown():\n jfv.publish_vector(i)\n i += 1\n rospy.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L112_C8", "label": "publish_vector()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L111_C4", "vector": [8, 2, 0.9492, 0.0085, 2, 0.14, 0.0, 415, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "publish_vector", "arg_names": [], "import_names": [], "rhs_call_name": "publish_vector", "annotation": ""}, "snippet": " jfv.publish_vector(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L114_C8", "label": "sleep()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L111_C4", "vector": [8, 2, 0.9661, 0.0085, 2, 0.14, 1.0, 476, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "sleep", "arg_names": [], "import_names": [], "rhs_call_name": "sleep", "annotation": ""}, "snippet": " rospy.sleep(0.5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L115_C4", "label": "return", "type": "return", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "vector": [13, 1, 0.9746, 0.0085, 1, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L117_C0", "label": "if", "type": "if", "loc": [117, 118], "level": 0, "parent": null, "vector": [4, 0, 0.9958, 0.0169, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L118_C4", "label": "main()", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L117_C0", "vector": [8, 1, 1.0, 0.0085, 1, 0.35, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99284:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:While_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:FunctionDef_L91_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Return_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99284:If_L117_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99284:Expr_L118_C4"}] |
import sys
import subprocess
import numpy as np
from collections import deque
import roslib
roslib.load_manifest("rospy")
roslib.load_manifest("tf")
roslib.load_manifest("hrl_pr2_arms")
roslib.load_manifest("smach_ros")
roslib.load_manifest("actionlib")
import tf
import tf.transformations as tf_trans
import rospy
from std_msgs.msg import *
from geometry_msgs.msg import *
import actionlib
import smach
import smach_ros
import rosparam
#from hrl_pr2_arms.pr2_arm import create_pr2_arm, PR2ArmJointTrajectory, PR2ArmJTranspose
from hrl_pr2_arms.pr2_arm import *
from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher
from hrl_generic_arms.pose_converter import PoseConverter
| ajibawa-2023/Python-Code-Large/train/row_99285 | 22 | 24 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0417, 0.0417, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L2_C0", "label": "subprocess import subprocess", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0417, 0, 0.66, 0.0476, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L3_C0", "label": "numpy import np", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.0417, 0, 0.66, 0.0952, 954, 0, 1, 0, 0, 954, 0, 0], "semantic": {"name": "numpy", "arg_names": [], "import_names": ["np"], "rhs_call_name": "", "annotation": ""}, "snippet": "import numpy as np"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:ImportFrom_L4_C0", "label": "from collections import deque", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1667, 0.0417, 0, 0.66, 0.1429, 193, 0, 1, 0, 0, 193, 0, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": ["deque"], "rhs_call_name": "", "annotation": ""}, "snippet": "from collections import deque"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L6_C0", "label": "roslib import roslib", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0417, 0, 0.66, 0.1905, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Expr_L7_C0", "label": "load_manifest()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.2917, 0.0417, 0, 0.66, 0.2381, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"rospy\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Expr_L8_C0", "label": "load_manifest()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 0.3333, 0.0417, 0, 0.66, 0.2857, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"tf\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Expr_L9_C0", "label": "load_manifest()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.375, 0.0417, 0, 0.66, 0.3333, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"hrl_pr2_arms\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Expr_L10_C0", "label": "load_manifest()", "type": "expression", "loc": [10, 10], "level": 0, "parent": null, "vector": [8, 0, 0.4167, 0.0417, 0, 0.66, 0.381, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"smach_ros\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Expr_L11_C0", "label": "load_manifest()", "type": "expression", "loc": [11, 11], "level": 0, "parent": null, "vector": [8, 0, 0.4583, 0.0417, 0, 0.66, 0.4286, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "roslib.load_manifest(\"actionlib\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L12_C0", "label": "tf import tf", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0417, 0, 0.66, 0.4762, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "tf", "arg_names": [], "import_names": ["tf"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L13_C0", "label": "tf.transformations import tf_trans", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.5417, 0.0417, 0, 0.66, 0.5238, 762, 0, 1, 0, 0, 762, 0, 0], "semantic": {"name": "tf.transformations", "arg_names": [], "import_names": ["tf_trans"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tf.transformations as tf_trans"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L14_C0", "label": "rospy import rospy", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.5833, 0.0417, 0, 0.66, 0.5714, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:ImportFrom_L15_C0", "label": "from std_msgs.msg import *", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.625, 0.0417, 0, 0.66, 0.619, 366, 0, 1, 0, 0, 366, 0, 0], "semantic": {"name": "std_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from std_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:ImportFrom_L16_C0", "label": "from geometry_msgs.msg import *", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.6667, 0.0417, 0, 0.66, 0.6667, 951, 0, 1, 0, 0, 951, 0, 0], "semantic": {"name": "geometry_msgs.msg", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from geometry_msgs.msg import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L17_C0", "label": "actionlib import actionlib", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.7083, 0.0417, 0, 0.66, 0.7143, 694, 0, 1, 0, 0, 694, 0, 0], "semantic": {"name": "actionlib", "arg_names": [], "import_names": ["actionlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import actionlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L18_C0", "label": "smach import smach", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.75, 0.0417, 0, 0.66, 0.7619, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "smach", "arg_names": [], "import_names": ["smach"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L19_C0", "label": "smach_ros import smach_ros", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.7917, 0.0417, 0, 0.66, 0.8095, 716, 0, 1, 0, 0, 716, 0, 0], "semantic": {"name": "smach_ros", "arg_names": [], "import_names": ["smach_ros"], "rhs_call_name": "", "annotation": ""}, "snippet": "import smach_ros"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:Import_L20_C0", "label": "rosparam import rosparam", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.8333, 0.0417, 0, 0.66, 0.8571, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "rosparam", "arg_names": [], "import_names": ["rosparam"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosparam"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:ImportFrom_L22_C0", "label": "from hrl_pr2_arms.pr2_arm import *", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.9167, 0.0417, 0, 0.66, 0.9048, 253, 0, 1, 0, 0, 253, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_arm", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_arm import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:ImportFrom_L23_C0", "label": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.9583, 0.0417, 0, 0.66, 0.9524, 395, 0, 1, 0, 0, 395, 0, 0], "semantic": {"name": "hrl_pr2_arms.pr2_controller_switcher", "arg_names": [], "import_names": ["ControllerSwitcher"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_pr2_arms.pr2_controller_switcher import ControllerSwitcher"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99285:ImportFrom_L24_C0", "label": "from hrl_generic_arms.pose_converter import PoseConverter", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.0417, 0, 0.66, 1.0, 752, 0, 1, 0, 0, 752, 0, 0], "semantic": {"name": "hrl_generic_arms.pose_converter", "arg_names": [], "import_names": ["PoseConverter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_generic_arms.pose_converter import PoseConverter"}] | [] |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'arm_cart_control_gui.ui'
#
# Created: Sat Feb 11 08:02:57 2012
# by: PyQt4 UI code generator 4.7.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Frame(object):
def setupUi(self, Frame):
Frame.setObjectName("Frame")
Frame.resize(702, 521)
Frame.setFrameShape(QtGui.QFrame.StyledPanel)
Frame.setFrameShadow(QtGui.QFrame.Raised)
self.frame = QtGui.QComboBox(Frame)
self.frame.setGeometry(QtCore.QRect(420, 430, 261, 31))
self.frame.setEditable(True)
self.frame.setObjectName("frame")
self.label_2 = QtGui.QLabel(Frame)
self.label_2.setGeometry(QtCore.QRect(330, 430, 71, 31))
self.label_2.setStyleSheet("font: 16pt;")
self.label_2.setObjectName("label_2")
self.layoutWidget = QtGui.QWidget(Frame)
self.layoutWidget.setGeometry(QtCore.QRect(360, 50, 321, 311))
self.layoutWidget.setObjectName("layoutWidget")
self.gridLayout = QtGui.QGridLayout(self.layoutWidget)
self.gridLayout.setObjectName("gridLayout")
self.rotate_x_pos = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotate_x_pos.sizePolicy().hasHeightForWidth())
self.rotate_x_pos.setSizePolicy(sizePolicy)
self.rotate_x_pos.setBaseSize(QtCore.QSize(80, 80))
self.rotate_x_pos.setStyleSheet("image: url(:/resources/roate_x_neg.png);\n"
"background-image: url(:/resources/empty.png);")
self.rotate_x_pos.setText("")
self.rotate_x_pos.setObjectName("rotate_x_pos")
self.gridLayout.addWidget(self.rotate_x_pos, 0, 0, 1, 1)
self.rotate_y_pos = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotate_y_pos.sizePolicy().hasHeightForWidth())
self.rotate_y_pos.setSizePolicy(sizePolicy)
self.rotate_y_pos.setBaseSize(QtCore.QSize(80, 80))
self.rotate_y_pos.setStyleSheet("image: url(:/resources/rotate_y_pos.png);\n"
"background-image: url(:/resources/empty.png);")
self.rotate_y_pos.setText("")
self.rotate_y_pos.setObjectName("rotate_y_pos")
self.gridLayout.addWidget(self.rotate_y_pos, 0, 1, 1, 1)
self.rotate_x_neg = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotate_x_neg.sizePolicy().hasHeightForWidth())
self.rotate_x_neg.setSizePolicy(sizePolicy)
self.rotate_x_neg.setBaseSize(QtCore.QSize(80, 80))
self.rotate_x_neg.setStyleSheet("image: url(:/resources/roate_x_pos.png);\n"
"background-image: url(:/resources/empty.png);")
self.rotate_x_neg.setText("")
self.rotate_x_neg.setObjectName("rotate_x_neg")
self.gridLayout.addWidget(self.rotate_x_neg, 0, 2, 1, 1)
self.rotate_z_neg = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotate_z_neg.sizePolicy().hasHeightForWidth())
self.rotate_z_neg.setSizePolicy(sizePolicy)
self.rotate_z_neg.setBaseSize(QtCore.QSize(80, 80))
self.rotate_z_neg.setStyleSheet("image: url(:/resources/rotate_z_neg.png);\n"
"background-image: url(:/resources/empty.png);")
self.rotate_z_neg.setText("")
self.rotate_z_neg.setObjectName("rotate_z_neg")
self.gridLayout.addWidget(self.rotate_z_neg, 1, 0, 1, 1)
self.rotate_z_pos = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotate_z_pos.sizePolicy().hasHeightForWidth())
self.rotate_z_pos.setSizePolicy(sizePolicy)
self.rotate_z_pos.setBaseSize(QtCore.QSize(80, 80))
self.rotate_z_pos.setStyleSheet("image: url(:/resources/rotate_z_pos.png);\n"
"background-image: url(:/resources/empty.png);")
self.rotate_z_pos.setText("")
self.rotate_z_pos.setObjectName("rotate_z_pos")
self.gridLayout.addWidget(self.rotate_z_pos, 1, 2, 1, 1)
self.rotate_y_neg = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotate_y_neg.sizePolicy().hasHeightForWidth())
self.rotate_y_neg.setSizePolicy(sizePolicy)
self.rotate_y_neg.setBaseSize(QtCore.QSize(80, 80))
self.rotate_y_neg.setStyleSheet("image: url(:/resources/rotate_y_neg.png);\n"
"background-image: url(:/resources/empty.png);")
self.rotate_y_neg.setText("")
self.rotate_y_neg.setObjectName("rotate_y_neg")
self.gridLayout.addWidget(self.rotate_y_neg, 2, 1, 1, 1)
self.label_3 = QtGui.QLabel(self.layoutWidget)
self.label_3.setStyleSheet("background-image: url(:/resources/empty.png);\n"
"image: url(:/resources/arm_gripper.png);")
self.label_3.setText("")
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 1, 1, 1, 1)
self.layoutWidget1 = QtGui.QWidget(Frame)
self.layoutWidget1.setGeometry(QtCore.QRect(20, 390, 271, 111))
self.layoutWidget1.setObjectName("layoutWidget1")
self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget1)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtGui.QLabel(self.layoutWidget1)
self.label.setStyleSheet("font: 20pt;")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.arm_left = QtGui.QPushButton(self.layoutWidget1)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.arm_left.sizePolicy().hasHeightForWidth())
self.arm_left.setSizePolicy(sizePolicy)
self.arm_left.setBaseSize(QtCore.QSize(80, 80))
self.arm_left.setStyleSheet("image: url(:/resources/arm_left_off.png);\n"
"background-image: url(:/resources/empty.png);")
self.arm_left.setObjectName("arm_left")
self.horizontalLayout.addWidget(self.arm_left)
self.arm_right = QtGui.QPushButton(self.layoutWidget1)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.arm_right.sizePolicy().hasHeightForWidth())
self.arm_right.setSizePolicy(sizePolicy)
self.arm_right.setBaseSize(QtCore.QSize(80, 80))
self.arm_right.setStyleSheet("image: url(:/resources/arm_right_off.png);\n"
"background-image: url(:/resources/empty.png);")
self.arm_right.setObjectName("arm_right")
self.horizontalLayout.addWidget(self.arm_right)
self.label_5 = QtGui.QLabel(Frame)
self.label_5.setGeometry(QtCore.QRect(470, 10, 151, 31))
self.label_5.setStyleSheet("font: 20pt;")
self.label_5.setObjectName("label_5")
self.label_4 = QtGui.QLabel(Frame)
self.label_4.setGeometry(QtCore.QRect(110, 10, 151, 31))
self.label_4.setStyleSheet("font: 20pt;")
self.label_4.setObjectName("label_4")
self.layoutWidget_2 = QtGui.QWidget(Frame)
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 50, 321, 311))
self.layoutWidget_2.setObjectName("layoutWidget_2")
self.gridLayout_2 = QtGui.QGridLayout(self.layoutWidget_2)
self.gridLayout_2.setObjectName("gridLayout_2")
self.translate_out = QtGui.QPushButton(self.layoutWidget_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.translate_out.sizePolicy().hasHeightForWidth())
self.translate_out.setSizePolicy(sizePolicy)
self.translate_out.setBaseSize(QtCore.QSize(80, 80))
self.translate_out.setStyleSheet("image: url(:/resources/translate_out.png);\n"
"background-image: url(:/resources/empty.png);")
self.translate_out.setText("")
self.translate_out.setObjectName("translate_out")
self.gridLayout_2.addWidget(self.translate_out, 0, 0, 1, 1)
self.translate_up = QtGui.QPushButton(self.layoutWidget_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.translate_up.sizePolicy().hasHeightForWidth())
self.translate_up.setSizePolicy(sizePolicy)
self.translate_up.setBaseSize(QtCore.QSize(80, 80))
self.translate_up.setStyleSheet("image: url(:/resources/translate_up.png);\n"
"background-image: url(:/resources/empty.png);")
self.translate_up.setText("")
self.translate_up.setObjectName("translate_up")
self.gridLayout_2.addWidget(self.translate_up, 0, 1, 1, 1)
self.translate_in = QtGui.QPushButton(self.layoutWidget_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.translate_in.sizePolicy().hasHeightForWidth())
self.translate_in.setSizePolicy(sizePolicy)
self.translate_in.setBaseSize(QtCore.QSize(80, 80))
self.translate_in.setStyleSheet("image: url(:/resources/translate_in.png);\n"
"background-image: url(:/resources/empty.png);")
self.translate_in.setText("")
self.translate_in.setObjectName("translate_in")
self.gridLayout_2.addWidget(self.translate_in, 0, 2, 1, 1)
self.translate_left = QtGui.QPushButton(self.layoutWidget_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.translate_left.sizePolicy().hasHeightForWidth())
self.translate_left.setSizePolicy(sizePolicy)
self.translate_left.setBaseSize(QtCore.QSize(80, 80))
self.translate_left.setStyleSheet("image: url(:/resources/translate_left.png);\n"
"background-image: url(:/resources/empty.png);")
self.translate_left.setText("")
self.translate_left.setObjectName("translate_left")
self.gridLayout_2.addWidget(self.translate_left, 1, 0, 1, 1)
self.translate_right = QtGui.QPushButton(self.layoutWidget_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.translate_right.sizePolicy().hasHeightForWidth())
self.translate_right.setSizePolicy(sizePolicy)
self.translate_right.setBaseSize(QtCore.QSize(80, 80))
self.translate_right.setStyleSheet("image: url(:/resources/translate_right.png);\n"
"background-image: url(:/resources/empty.png);")
self.translate_right.setText("")
self.translate_right.setObjectName("translate_right")
self.gridLayout_2.addWidget(self.translate_right, 1, 2, 1, 1)
self.translate_down = QtGui.QPushButton(self.layoutWidget_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.translate_down.sizePolicy().hasHeightForWidth())
self.translate_down.setSizePolicy(sizePolicy)
self.translate_down.setBaseSize(QtCore.QSize(80, 80))
self.translate_down.setStyleSheet("image: url(:/resources/translate_down.png);\n"
"background-image: url(:/resources/empty.png);")
self.translate_down.setText("")
self.translate_down.setObjectName("translate_down")
self.gridLayout_2.addWidget(self.translate_down, 2, 1, 1, 1)
self.retranslateUi(Frame)
QtCore.QMetaObject.connectSlotsByName(Frame)
def retranslateUi(self, Frame):
Frame.setWindowTitle(QtGui.QApplication.translate("Frame", "Frame", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("Frame", "Frame", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Frame", "Arm", None, QtGui.QApplication.UnicodeUTF8))
self.arm_left.setText(QtGui.QApplication.translate("Frame", "Left Arm", None, QtGui.QApplication.UnicodeUTF8))
self.arm_right.setText(QtGui.QApplication.translate("Frame", "Right Arm", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("Frame", "Rotation", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("Frame", "Translation", None, QtGui.QApplication.UnicodeUTF8))
import icons_rc
| ajibawa-2023/Python-Code-Large/train/row_99286 | 210 | 238 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99286:ImportFrom_L10_C0", "label": "from PyQt4 import QtCore, QtGui", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.042, 0.0042, 0, 0.66, 0.0, 154, 0, 2, 0, 0, 154, 0, 0], "semantic": {"name": "PyQt4", "arg_names": [], "import_names": ["QtCore", "QtGui"], "rhs_call_name": "", "annotation": ""}, "snippet": "from PyQt4 import QtCore, QtGui"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:ClassDef_L12_C0", "label": "Ui_Frame", "type": "class", "loc": [12, 236], "level": 0, "parent": null, "vector": [3, 0, 0.521, 0.9454, 0, 0.66, 0.5, 206, 0, 2, 0, 0, 186, 0, 99], "semantic": {"name": "Ui_Frame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Ui_Frame(object):\n def setupUi(self, Frame):\n Frame.setObjectName(\"Frame\")\n Frame.resize(702, 521)\n Frame.setFrameShape(QtGui.QFrame.StyledPanel)\n Frame.setFrameShadow(QtGui.QFrame.Raised)\n self.frame = QtGui.QComboBox(Frame)\n self.frame.setGeometry(QtCore.QRect(420, 430, 261, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "label": "setupUi", "type": "function", "loc": [13, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:ClassDef_L12_C0", "vector": [2, 1, 0.5042, 0.9034, 1, 0.34, 0.0, 419, 0, 2, 0, 0, 0, 0, 99], "semantic": {"name": "setupUi", "arg_names": ["self", "Frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setupUi(self, Frame):\n Frame.setObjectName(\"Frame\")\n Frame.resize(702, 521)\n Frame.setFrameShape(QtGui.QFrame.StyledPanel)\n Frame.setFrameShadow(QtGui.QFrame.Raised)\n self.frame = QtGui.QComboBox(Frame)\n self.frame.setGeometry(QtCore.QRect(420, 430, 261, 31))\n self.frame.setEditable(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L14_C8", "label": "setObjectName()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.0588, 0.0042, 2, 0.36, 0.0, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " Frame.setObjectName(\"Frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L15_C8", "label": "resize()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.063, 0.0042, 2, 0.36, 0.0051, 834, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "resize", "arg_names": [], "import_names": [], "rhs_call_name": "resize", "annotation": ""}, "snippet": " Frame.resize(702, 521)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L16_C8", "label": "setFrameShape()", "type": "expression", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.0672, 0.0042, 2, 0.36, 0.0102, 970, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFrameShape", "arg_names": [], "import_names": [], "rhs_call_name": "setFrameShape", "annotation": ""}, "snippet": " Frame.setFrameShape(QtGui.QFrame.StyledPanel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L17_C8", "label": "setFrameShadow()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.0714, 0.0042, 2, 0.36, 0.0152, 695, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setFrameShadow", "arg_names": [], "import_names": [], "rhs_call_name": "setFrameShadow", "annotation": ""}, "snippet": " Frame.setFrameShadow(QtGui.QFrame.Raised)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L18_C8", "label": "self.frame = QComboBox()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.0756, 0.0042, 2, 0.36, 0.0203, 409, 3, 1, 0, 0, 556, 10, 1], "semantic": {"name": "self.frame", "arg_names": [], "import_names": [], "rhs_call_name": "QComboBox", "annotation": ""}, "snippet": " self.frame = QtGui.QComboBox(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L19_C8", "label": "setGeometry()", "type": "expression", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.0798, 0.0042, 2, 0.36, 0.0254, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.frame.setGeometry(QtCore.QRect(420, 430, 261, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L20_C8", "label": "setEditable()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.084, 0.0042, 2, 0.36, 0.0305, 440, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEditable", "arg_names": [], "import_names": [], "rhs_call_name": "setEditable", "annotation": ""}, "snippet": " self.frame.setEditable(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L21_C8", "label": "setObjectName()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.0882, 0.0042, 2, 0.36, 0.0355, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.frame.setObjectName(\"frame\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L22_C8", "label": "self.label_2 = QLabel()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.0924, 0.0042, 2, 0.36, 0.0406, 286, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.label_2", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.label_2 = QtGui.QLabel(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L23_C8", "label": "setGeometry()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.0966, 0.0042, 2, 0.36, 0.0457, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.label_2.setGeometry(QtCore.QRect(330, 430, 71, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L24_C8", "label": "setStyleSheet()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1008, 0.0042, 2, 0.36, 0.0508, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.label_2.setStyleSheet(\"font: 16pt;\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L25_C8", "label": "setObjectName()", "type": "expression", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.105, 0.0042, 2, 0.36, 0.0558, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.label_2.setObjectName(\"label_2\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L26_C8", "label": "self.layoutWidget = QWidget()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.1092, 0.0042, 2, 0.36, 0.0609, 142, 3, 1, 0, 0, 317, 10, 1], "semantic": {"name": "self.layoutWidget", "arg_names": [], "import_names": [], "rhs_call_name": "QWidget", "annotation": ""}, "snippet": " self.layoutWidget = QtGui.QWidget(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L27_C8", "label": "setGeometry()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1134, 0.0042, 2, 0.36, 0.066, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.layoutWidget.setGeometry(QtCore.QRect(360, 50, 321, 311))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L28_C8", "label": "setObjectName()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1176, 0.0042, 2, 0.36, 0.0711, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.layoutWidget.setObjectName(\"layoutWidget\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L29_C8", "label": "self.gridLayout = QGridLayout()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.1218, 0.0042, 2, 0.36, 0.0761, 317, 3, 1, 0, 0, 319, 10, 1], "semantic": {"name": "self.gridLayout", "arg_names": [], "import_names": [], "rhs_call_name": "QGridLayout", "annotation": ""}, "snippet": " self.gridLayout = QtGui.QGridLayout(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L30_C8", "label": "setObjectName()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1261, 0.0042, 2, 0.36, 0.0812, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.gridLayout.setObjectName(\"gridLayout\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L31_C8", "label": "self.rotate_x_pos = QPushButton()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.1303, 0.0042, 2, 0.36, 0.0863, 250, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.rotate_x_pos", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.rotate_x_pos = QtGui.QPushButton(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L32_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.1345, 0.0042, 2, 0.36, 0.0914, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L33_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1387, 0.0042, 2, 0.36, 0.0964, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L34_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1429, 0.0042, 2, 0.36, 0.1015, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L35_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1471, 0.0042, 2, 0.36, 0.1066, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.rotate_x_pos.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L36_C8", "label": "setSizePolicy()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1513, 0.0042, 2, 0.36, 0.1117, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.rotate_x_pos.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L37_C8", "label": "setBaseSize()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1555, 0.0042, 2, 0.36, 0.1168, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.rotate_x_pos.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L38_C8", "label": "setStyleSheet()", "type": "expression", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1618, 0.0084, 2, 0.36, 0.1218, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.rotate_x_pos.setStyleSheet(\"image: url(:/resources/roate_x_neg.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L40_C8", "label": "setText()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1681, 0.0042, 2, 0.36, 0.1269, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.rotate_x_pos.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L41_C8", "label": "setObjectName()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1723, 0.0042, 2, 0.36, 0.132, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.rotate_x_pos.setObjectName(\"rotate_x_pos\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L42_C8", "label": "addWidget()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1765, 0.0042, 2, 0.36, 0.1371, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.rotate_x_pos, 0, 0, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L43_C8", "label": "self.rotate_y_pos = QPushButton()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.1807, 0.0042, 2, 0.36, 0.1421, 776, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.rotate_y_pos", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.rotate_y_pos = QtGui.QPushButton(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L44_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.1849, 0.0042, 2, 0.36, 0.1472, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L45_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1891, 0.0042, 2, 0.36, 0.1523, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L46_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1933, 0.0042, 2, 0.36, 0.1574, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L47_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.1975, 0.0042, 2, 0.36, 0.1624, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.rotate_y_pos.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L48_C8", "label": "setSizePolicy()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2017, 0.0042, 2, 0.36, 0.1675, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.rotate_y_pos.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L49_C8", "label": "setBaseSize()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2059, 0.0042, 2, 0.36, 0.1726, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.rotate_y_pos.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L50_C8", "label": "setStyleSheet()", "type": "expression", "loc": [50, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2122, 0.0084, 2, 0.36, 0.1777, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.rotate_y_pos.setStyleSheet(\"image: url(:/resources/rotate_y_pos.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L52_C8", "label": "setText()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2185, 0.0042, 2, 0.36, 0.1827, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.rotate_y_pos.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L53_C8", "label": "setObjectName()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2227, 0.0042, 2, 0.36, 0.1878, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.rotate_y_pos.setObjectName(\"rotate_y_pos\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L54_C8", "label": "addWidget()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2269, 0.0042, 2, 0.36, 0.1929, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.rotate_y_pos, 0, 1, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L55_C8", "label": "self.rotate_x_neg = QPushButton()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.2311, 0.0042, 2, 0.36, 0.198, 658, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.rotate_x_neg", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.rotate_x_neg = QtGui.QPushButton(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L56_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.2353, 0.0042, 2, 0.36, 0.203, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L57_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2395, 0.0042, 2, 0.36, 0.2081, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L58_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2437, 0.0042, 2, 0.36, 0.2132, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L59_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2479, 0.0042, 2, 0.36, 0.2183, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.rotate_x_neg.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L60_C8", "label": "setSizePolicy()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2521, 0.0042, 2, 0.36, 0.2234, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.rotate_x_neg.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L61_C8", "label": "setBaseSize()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2563, 0.0042, 2, 0.36, 0.2284, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.rotate_x_neg.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L62_C8", "label": "setStyleSheet()", "type": "expression", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2626, 0.0084, 2, 0.36, 0.2335, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.rotate_x_neg.setStyleSheet(\"image: url(:/resources/roate_x_pos.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L64_C8", "label": "setText()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2689, 0.0042, 2, 0.36, 0.2386, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.rotate_x_neg.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L65_C8", "label": "setObjectName()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2731, 0.0042, 2, 0.36, 0.2437, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.rotate_x_neg.setObjectName(\"rotate_x_neg\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L66_C8", "label": "addWidget()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2773, 0.0042, 2, 0.36, 0.2487, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.rotate_x_neg, 0, 2, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L67_C8", "label": "self.rotate_z_neg = QPushButton()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.2815, 0.0042, 2, 0.36, 0.2538, 952, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.rotate_z_neg", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.rotate_z_neg = QtGui.QPushButton(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L68_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.2857, 0.0042, 2, 0.36, 0.2589, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L69_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2899, 0.0042, 2, 0.36, 0.264, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L70_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2941, 0.0042, 2, 0.36, 0.269, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L71_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.2983, 0.0042, 2, 0.36, 0.2741, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.rotate_z_neg.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L72_C8", "label": "setSizePolicy()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3025, 0.0042, 2, 0.36, 0.2792, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.rotate_z_neg.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L73_C8", "label": "setBaseSize()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3067, 0.0042, 2, 0.36, 0.2843, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.rotate_z_neg.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L74_C8", "label": "setStyleSheet()", "type": "expression", "loc": [74, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.313, 0.0084, 2, 0.36, 0.2893, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.rotate_z_neg.setStyleSheet(\"image: url(:/resources/rotate_z_neg.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L76_C8", "label": "setText()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3193, 0.0042, 2, 0.36, 0.2944, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.rotate_z_neg.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L77_C8", "label": "setObjectName()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3235, 0.0042, 2, 0.36, 0.2995, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.rotate_z_neg.setObjectName(\"rotate_z_neg\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L78_C8", "label": "addWidget()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3277, 0.0042, 2, 0.36, 0.3046, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.rotate_z_neg, 1, 0, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L79_C8", "label": "self.rotate_z_pos = QPushButton()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.3319, 0.0042, 2, 0.36, 0.3096, 148, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.rotate_z_pos", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.rotate_z_pos = QtGui.QPushButton(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L80_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.3361, 0.0042, 2, 0.36, 0.3147, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L81_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3403, 0.0042, 2, 0.36, 0.3198, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L82_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3445, 0.0042, 2, 0.36, 0.3249, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L83_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3487, 0.0042, 2, 0.36, 0.3299, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.rotate_z_pos.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L84_C8", "label": "setSizePolicy()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3529, 0.0042, 2, 0.36, 0.335, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.rotate_z_pos.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L85_C8", "label": "setBaseSize()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3571, 0.0042, 2, 0.36, 0.3401, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.rotate_z_pos.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L86_C8", "label": "setStyleSheet()", "type": "expression", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3634, 0.0084, 2, 0.36, 0.3452, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.rotate_z_pos.setStyleSheet(\"image: url(:/resources/rotate_z_pos.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L88_C8", "label": "setText()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3697, 0.0042, 2, 0.36, 0.3503, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.rotate_z_pos.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L89_C8", "label": "setObjectName()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3739, 0.0042, 2, 0.36, 0.3553, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.rotate_z_pos.setObjectName(\"rotate_z_pos\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L90_C8", "label": "addWidget()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3782, 0.0042, 2, 0.36, 0.3604, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.rotate_z_pos, 1, 2, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L91_C8", "label": "self.rotate_y_neg = QPushButton()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.3824, 0.0042, 2, 0.36, 0.3655, 453, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.rotate_y_neg", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.rotate_y_neg = QtGui.QPushButton(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L92_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.3866, 0.0042, 2, 0.36, 0.3706, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L93_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3908, 0.0042, 2, 0.36, 0.3756, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L94_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.395, 0.0042, 2, 0.36, 0.3807, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L95_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.3992, 0.0042, 2, 0.36, 0.3858, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.rotate_y_neg.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L96_C8", "label": "setSizePolicy()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4034, 0.0042, 2, 0.36, 0.3909, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.rotate_y_neg.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L97_C8", "label": "setBaseSize()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4076, 0.0042, 2, 0.36, 0.3959, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.rotate_y_neg.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L98_C8", "label": "setStyleSheet()", "type": "expression", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4139, 0.0084, 2, 0.36, 0.401, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.rotate_y_neg.setStyleSheet(\"image: url(:/resources/rotate_y_neg.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L100_C8", "label": "setText()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4202, 0.0042, 2, 0.36, 0.4061, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.rotate_y_neg.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L101_C8", "label": "setObjectName()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4244, 0.0042, 2, 0.36, 0.4112, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.rotate_y_neg.setObjectName(\"rotate_y_neg\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L102_C8", "label": "addWidget()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4286, 0.0042, 2, 0.36, 0.4162, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.rotate_y_neg, 2, 1, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L103_C8", "label": "self.label_3 = QLabel()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.4328, 0.0042, 2, 0.36, 0.4213, 304, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.label_3", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.label_3 = QtGui.QLabel(self.layoutWidget)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L104_C8", "label": "setStyleSheet()", "type": "expression", "loc": [104, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4391, 0.0084, 2, 0.36, 0.4264, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.label_3.setStyleSheet(\"background-image: url(:/resources/empty.png);\\n\"\n\"image: url(:/resources/arm_gripper.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L106_C8", "label": "setText()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4454, 0.0042, 2, 0.36, 0.4315, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.label_3.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L107_C8", "label": "setObjectName()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4496, 0.0042, 2, 0.36, 0.4365, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.label_3.setObjectName(\"label_3\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L108_C8", "label": "addWidget()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4538, 0.0042, 2, 0.36, 0.4416, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout.addWidget(self.label_3, 1, 1, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L109_C8", "label": "self.layoutWidget1 = QWidget()", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.458, 0.0042, 2, 0.36, 0.4467, 429, 3, 1, 0, 0, 317, 10, 1], "semantic": {"name": "self.layoutWidget1", "arg_names": [], "import_names": [], "rhs_call_name": "QWidget", "annotation": ""}, "snippet": " self.layoutWidget1 = QtGui.QWidget(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L110_C8", "label": "setGeometry()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4622, 0.0042, 2, 0.36, 0.4518, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.layoutWidget1.setGeometry(QtCore.QRect(20, 390, 271, 111))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L111_C8", "label": "setObjectName()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4664, 0.0042, 2, 0.36, 0.4569, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.layoutWidget1.setObjectName(\"layoutWidget1\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L112_C8", "label": "self.horizontalLayout = QHBoxLayout()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.4706, 0.0042, 2, 0.36, 0.4619, 138, 3, 1, 0, 0, 792, 10, 1], "semantic": {"name": "self.horizontalLayout", "arg_names": [], "import_names": [], "rhs_call_name": "QHBoxLayout", "annotation": ""}, "snippet": " self.horizontalLayout = QtGui.QHBoxLayout(self.layoutWidget1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L113_C8", "label": "setObjectName()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4748, 0.0042, 2, 0.36, 0.467, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.horizontalLayout.setObjectName(\"horizontalLayout\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L114_C8", "label": "self.label = QLabel()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.479, 0.0042, 2, 0.36, 0.4721, 51, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.label", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.label = QtGui.QLabel(self.layoutWidget1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L115_C8", "label": "setStyleSheet()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4832, 0.0042, 2, 0.36, 0.4772, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.label.setStyleSheet(\"font: 20pt;\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L116_C8", "label": "setObjectName()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4874, 0.0042, 2, 0.36, 0.4822, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.label.setObjectName(\"label\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L117_C8", "label": "addWidget()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.4916, 0.0042, 2, 0.36, 0.4873, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.horizontalLayout.addWidget(self.label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L118_C8", "label": "self.arm_left = QPushButton()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.4958, 0.0042, 2, 0.36, 0.4924, 668, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.arm_left", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.arm_left = QtGui.QPushButton(self.layoutWidget1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L119_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.5, 0.0042, 2, 0.36, 0.4975, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L120_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5042, 0.0042, 2, 0.36, 0.5025, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L121_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5084, 0.0042, 2, 0.36, 0.5076, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L122_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5126, 0.0042, 2, 0.36, 0.5127, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.arm_left.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L123_C8", "label": "setSizePolicy()", "type": "expression", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5168, 0.0042, 2, 0.36, 0.5178, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.arm_left.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L124_C8", "label": "setBaseSize()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.521, 0.0042, 2, 0.36, 0.5228, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.arm_left.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L125_C8", "label": "setStyleSheet()", "type": "expression", "loc": [125, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5273, 0.0084, 2, 0.36, 0.5279, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.arm_left.setStyleSheet(\"image: url(:/resources/arm_left_off.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L127_C8", "label": "setObjectName()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5336, 0.0042, 2, 0.36, 0.533, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.arm_left.setObjectName(\"arm_left\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L128_C8", "label": "addWidget()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5378, 0.0042, 2, 0.36, 0.5381, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.horizontalLayout.addWidget(self.arm_left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L129_C8", "label": "self.arm_right = QPushButton()", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.542, 0.0042, 2, 0.36, 0.5431, 451, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.arm_right", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.arm_right = QtGui.QPushButton(self.layoutWidget1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L130_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.5462, 0.0042, 2, 0.36, 0.5482, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L131_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5504, 0.0042, 2, 0.36, 0.5533, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L132_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5546, 0.0042, 2, 0.36, 0.5584, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L133_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5588, 0.0042, 2, 0.36, 0.5635, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.arm_right.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L134_C8", "label": "setSizePolicy()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.563, 0.0042, 2, 0.36, 0.5685, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.arm_right.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L135_C8", "label": "setBaseSize()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5672, 0.0042, 2, 0.36, 0.5736, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.arm_right.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L136_C8", "label": "setStyleSheet()", "type": "expression", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5735, 0.0084, 2, 0.36, 0.5787, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.arm_right.setStyleSheet(\"image: url(:/resources/arm_right_off.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L138_C8", "label": "setObjectName()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5798, 0.0042, 2, 0.36, 0.5838, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.arm_right.setObjectName(\"arm_right\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L139_C8", "label": "addWidget()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.584, 0.0042, 2, 0.36, 0.5888, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.horizontalLayout.addWidget(self.arm_right)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L140_C8", "label": "self.label_5 = QLabel()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.5882, 0.0042, 2, 0.36, 0.5939, 161, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.label_5", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.label_5 = QtGui.QLabel(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L141_C8", "label": "setGeometry()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5924, 0.0042, 2, 0.36, 0.599, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.label_5.setGeometry(QtCore.QRect(470, 10, 151, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L142_C8", "label": "setStyleSheet()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.5966, 0.0042, 2, 0.36, 0.6041, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.label_5.setStyleSheet(\"font: 20pt;\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L143_C8", "label": "setObjectName()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6008, 0.0042, 2, 0.36, 0.6091, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.label_5.setObjectName(\"label_5\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L144_C8", "label": "self.label_4 = QLabel()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.605, 0.0042, 2, 0.36, 0.6142, 794, 3, 1, 0, 0, 495, 10, 1], "semantic": {"name": "self.label_4", "arg_names": [], "import_names": [], "rhs_call_name": "QLabel", "annotation": ""}, "snippet": " self.label_4 = QtGui.QLabel(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L145_C8", "label": "setGeometry()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6092, 0.0042, 2, 0.36, 0.6193, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.label_4.setGeometry(QtCore.QRect(110, 10, 151, 31))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L146_C8", "label": "setStyleSheet()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6134, 0.0042, 2, 0.36, 0.6244, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.label_4.setStyleSheet(\"font: 20pt;\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L147_C8", "label": "setObjectName()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6176, 0.0042, 2, 0.36, 0.6294, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.label_4.setObjectName(\"label_4\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L148_C8", "label": "self.layoutWidget_2 = QWidget()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.6218, 0.0042, 2, 0.36, 0.6345, 339, 3, 1, 0, 0, 317, 10, 1], "semantic": {"name": "self.layoutWidget_2", "arg_names": [], "import_names": [], "rhs_call_name": "QWidget", "annotation": ""}, "snippet": " self.layoutWidget_2 = QtGui.QWidget(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L149_C8", "label": "setGeometry()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6261, 0.0042, 2, 0.36, 0.6396, 648, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setGeometry", "arg_names": [], "import_names": [], "rhs_call_name": "setGeometry", "annotation": ""}, "snippet": " self.layoutWidget_2.setGeometry(QtCore.QRect(20, 50, 321, 311))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L150_C8", "label": "setObjectName()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6303, 0.0042, 2, 0.36, 0.6447, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.layoutWidget_2.setObjectName(\"layoutWidget_2\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L151_C8", "label": "self.gridLayout_2 = QGridLayout()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.6345, 0.0042, 2, 0.36, 0.6497, 239, 3, 1, 0, 0, 319, 10, 1], "semantic": {"name": "self.gridLayout_2", "arg_names": [], "import_names": [], "rhs_call_name": "QGridLayout", "annotation": ""}, "snippet": " self.gridLayout_2 = QtGui.QGridLayout(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L152_C8", "label": "setObjectName()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6387, 0.0042, 2, 0.36, 0.6548, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.gridLayout_2.setObjectName(\"gridLayout_2\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L153_C8", "label": "self.translate_out = QPushButton()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.6429, 0.0042, 2, 0.36, 0.6599, 254, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.translate_out", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.translate_out = QtGui.QPushButton(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L154_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.6471, 0.0042, 2, 0.36, 0.665, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L155_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6513, 0.0042, 2, 0.36, 0.6701, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L156_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6555, 0.0042, 2, 0.36, 0.6751, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L157_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6597, 0.0042, 2, 0.36, 0.6802, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.translate_out.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L158_C8", "label": "setSizePolicy()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6639, 0.0042, 2, 0.36, 0.6853, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.translate_out.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L159_C8", "label": "setBaseSize()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6681, 0.0042, 2, 0.36, 0.6904, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.translate_out.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L160_C8", "label": "setStyleSheet()", "type": "expression", "loc": [160, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6744, 0.0084, 2, 0.36, 0.6954, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.translate_out.setStyleSheet(\"image: url(:/resources/translate_out.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L162_C8", "label": "setText()", "type": "expression", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6807, 0.0042, 2, 0.36, 0.7005, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.translate_out.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L163_C8", "label": "setObjectName()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6849, 0.0042, 2, 0.36, 0.7056, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.translate_out.setObjectName(\"translate_out\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L164_C8", "label": "addWidget()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.6891, 0.0042, 2, 0.36, 0.7107, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout_2.addWidget(self.translate_out, 0, 0, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L165_C8", "label": "self.translate_up = QPushButton()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.6933, 0.0042, 2, 0.36, 0.7157, 663, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.translate_up", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.translate_up = QtGui.QPushButton(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L166_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.6975, 0.0042, 2, 0.36, 0.7208, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L167_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7017, 0.0042, 2, 0.36, 0.7259, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L168_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7059, 0.0042, 2, 0.36, 0.731, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L169_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7101, 0.0042, 2, 0.36, 0.736, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.translate_up.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L170_C8", "label": "setSizePolicy()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7143, 0.0042, 2, 0.36, 0.7411, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.translate_up.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L171_C8", "label": "setBaseSize()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7185, 0.0042, 2, 0.36, 0.7462, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.translate_up.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L172_C8", "label": "setStyleSheet()", "type": "expression", "loc": [172, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7248, 0.0084, 2, 0.36, 0.7513, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.translate_up.setStyleSheet(\"image: url(:/resources/translate_up.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L174_C8", "label": "setText()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7311, 0.0042, 2, 0.36, 0.7563, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.translate_up.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L175_C8", "label": "setObjectName()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7353, 0.0042, 2, 0.36, 0.7614, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.translate_up.setObjectName(\"translate_up\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L176_C8", "label": "addWidget()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7395, 0.0042, 2, 0.36, 0.7665, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout_2.addWidget(self.translate_up, 0, 1, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L177_C8", "label": "self.translate_in = QPushButton()", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.7437, 0.0042, 2, 0.36, 0.7716, 858, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.translate_in", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.translate_in = QtGui.QPushButton(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L178_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.7479, 0.0042, 2, 0.36, 0.7766, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L179_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7521, 0.0042, 2, 0.36, 0.7817, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L180_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7563, 0.0042, 2, 0.36, 0.7868, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L181_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7605, 0.0042, 2, 0.36, 0.7919, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.translate_in.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L182_C8", "label": "setSizePolicy()", "type": "expression", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7647, 0.0042, 2, 0.36, 0.797, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.translate_in.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L183_C8", "label": "setBaseSize()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7689, 0.0042, 2, 0.36, 0.802, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.translate_in.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L184_C8", "label": "setStyleSheet()", "type": "expression", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7752, 0.0084, 2, 0.36, 0.8071, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.translate_in.setStyleSheet(\"image: url(:/resources/translate_in.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L186_C8", "label": "setText()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7815, 0.0042, 2, 0.36, 0.8122, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.translate_in.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L187_C8", "label": "setObjectName()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7857, 0.0042, 2, 0.36, 0.8173, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.translate_in.setObjectName(\"translate_in\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L188_C8", "label": "addWidget()", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.7899, 0.0042, 2, 0.36, 0.8223, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout_2.addWidget(self.translate_in, 0, 2, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L189_C8", "label": "self.translate_left = QPushButton()", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.7941, 0.0042, 2, 0.36, 0.8274, 594, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.translate_left", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.translate_left = QtGui.QPushButton(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L190_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.7983, 0.0042, 2, 0.36, 0.8325, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L191_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8025, 0.0042, 2, 0.36, 0.8376, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L192_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8067, 0.0042, 2, 0.36, 0.8426, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L193_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8109, 0.0042, 2, 0.36, 0.8477, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.translate_left.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L194_C8", "label": "setSizePolicy()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8151, 0.0042, 2, 0.36, 0.8528, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.translate_left.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L195_C8", "label": "setBaseSize()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8193, 0.0042, 2, 0.36, 0.8579, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.translate_left.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L196_C8", "label": "setStyleSheet()", "type": "expression", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8256, 0.0084, 2, 0.36, 0.8629, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.translate_left.setStyleSheet(\"image: url(:/resources/translate_left.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L198_C8", "label": "setText()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8319, 0.0042, 2, 0.36, 0.868, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.translate_left.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L199_C8", "label": "setObjectName()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8361, 0.0042, 2, 0.36, 0.8731, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.translate_left.setObjectName(\"translate_left\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L200_C8", "label": "addWidget()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8403, 0.0042, 2, 0.36, 0.8782, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout_2.addWidget(self.translate_left, 1, 0, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L201_C8", "label": "self.translate_right = QPushButton()", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.8445, 0.0042, 2, 0.36, 0.8832, 569, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.translate_right", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.translate_right = QtGui.QPushButton(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L202_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.8487, 0.0042, 2, 0.36, 0.8883, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L203_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8529, 0.0042, 2, 0.36, 0.8934, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L204_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8571, 0.0042, 2, 0.36, 0.8985, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L205_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8613, 0.0042, 2, 0.36, 0.9036, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.translate_right.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L206_C8", "label": "setSizePolicy()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8655, 0.0042, 2, 0.36, 0.9086, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.translate_right.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L207_C8", "label": "setBaseSize()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8697, 0.0042, 2, 0.36, 0.9137, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.translate_right.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L208_C8", "label": "setStyleSheet()", "type": "expression", "loc": [208, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8761, 0.0084, 2, 0.36, 0.9188, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.translate_right.setStyleSheet(\"image: url(:/resources/translate_right.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L210_C8", "label": "setText()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8824, 0.0042, 2, 0.36, 0.9239, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.translate_right.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L211_C8", "label": "setObjectName()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8866, 0.0042, 2, 0.36, 0.9289, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.translate_right.setObjectName(\"translate_right\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L212_C8", "label": "addWidget()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.8908, 0.0042, 2, 0.36, 0.934, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout_2.addWidget(self.translate_right, 1, 2, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L213_C8", "label": "self.translate_down = QPushButton()", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.895, 0.0042, 2, 0.36, 0.9391, 203, 3, 1, 0, 0, 545, 10, 1], "semantic": {"name": "self.translate_down", "arg_names": [], "import_names": [], "rhs_call_name": "QPushButton", "annotation": ""}, "snippet": " self.translate_down = QtGui.QPushButton(self.layoutWidget_2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L214_C8", "label": "sizePolicy = QSizePolicy()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [14, 2, 0.8992, 0.0042, 2, 0.36, 0.9442, 422, 3, 2, 0, 0, 702, 10, 1], "semantic": {"name": "sizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "QSizePolicy", "annotation": ""}, "snippet": " sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L215_C8", "label": "setHorizontalStretch()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9034, 0.0042, 2, 0.36, 0.9492, 802, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setHorizontalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setHorizontalStretch", "annotation": ""}, "snippet": " sizePolicy.setHorizontalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L216_C8", "label": "setVerticalStretch()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9076, 0.0042, 2, 0.36, 0.9543, 297, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVerticalStretch", "arg_names": [], "import_names": [], "rhs_call_name": "setVerticalStretch", "annotation": ""}, "snippet": " sizePolicy.setVerticalStretch(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L217_C8", "label": "setHeightForWidth()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9118, 0.0042, 2, 0.36, 0.9594, 847, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "setHeightForWidth", "arg_names": [], "import_names": [], "rhs_call_name": "setHeightForWidth", "annotation": ""}, "snippet": " sizePolicy.setHeightForWidth(self.translate_down.sizePolicy().hasHeightForWidth())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L218_C8", "label": "setSizePolicy()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.916, 0.0042, 2, 0.36, 0.9645, 289, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setSizePolicy", "arg_names": [], "import_names": [], "rhs_call_name": "setSizePolicy", "annotation": ""}, "snippet": " self.translate_down.setSizePolicy(sizePolicy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L219_C8", "label": "setBaseSize()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9202, 0.0042, 2, 0.36, 0.9695, 235, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setBaseSize", "arg_names": [], "import_names": [], "rhs_call_name": "setBaseSize", "annotation": ""}, "snippet": " self.translate_down.setBaseSize(QtCore.QSize(80, 80))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L220_C8", "label": "setStyleSheet()", "type": "expression", "loc": [220, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9265, 0.0084, 2, 0.36, 0.9746, 914, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setStyleSheet", "arg_names": [], "import_names": [], "rhs_call_name": "setStyleSheet", "annotation": ""}, "snippet": " self.translate_down.setStyleSheet(\"image: url(:/resources/translate_down.png);\\n\"\n\"background-image: url(:/resources/empty.png);\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L222_C8", "label": "setText()", "type": "expression", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9328, 0.0042, 2, 0.36, 0.9797, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.translate_down.setText(\"\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L223_C8", "label": "setObjectName()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.937, 0.0042, 2, 0.36, 0.9848, 470, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setObjectName", "arg_names": [], "import_names": [], "rhs_call_name": "setObjectName", "annotation": ""}, "snippet": " self.translate_down.setObjectName(\"translate_down\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L224_C8", "label": "addWidget()", "type": "expression", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9412, 0.0042, 2, 0.36, 0.9898, 653, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "addWidget", "arg_names": [], "import_names": [], "rhs_call_name": "addWidget", "annotation": ""}, "snippet": " self.gridLayout_2.addWidget(self.translate_down, 2, 1, 1, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L226_C8", "label": "retranslateUi()", "type": "expression", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9496, 0.0042, 2, 0.36, 0.9949, 520, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "retranslateUi", "arg_names": [], "import_names": [], "rhs_call_name": "retranslateUi", "annotation": ""}, "snippet": " self.retranslateUi(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L227_C8", "label": "connectSlotsByName()", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "vector": [8, 2, 0.9538, 0.0042, 2, 0.36, 1.0, 419, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connectSlotsByName", "arg_names": [], "import_names": [], "rhs_call_name": "connectSlotsByName", "annotation": ""}, "snippet": " QtCore.QMetaObject.connectSlotsByName(Frame)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "label": "retranslateUi", "type": "function", "loc": [229, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:ClassDef_L12_C0", "vector": [2, 1, 0.9769, 0.0336, 1, 0.34, 1.0, 520, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "retranslateUi", "arg_names": ["self", "Frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def retranslateUi(self, Frame):\n Frame.setWindowTitle(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))\n self.label_2.setText(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))\n self.label.setText(QtGui.QApplication.translate(\"Frame\", \"Arm\", None, QtGui.QApplication.UnicodeUTF8))\n self.arm_left.setText(QtGui.QApplication.translate(\"Frame\", \"Left Arm\", None, QtGui.QApplication.UnicodeUTF8))\n self.arm_right.setText(QtGui.QApplication.translate(\"Frame\", \"Right Arm\", None, QtGui.QApplication.UnicodeUTF8))\n self.label_5.setText(QtGui.QApplication.translate(\"Frame\", \"Rotation\", None, QtGui.QApplication.UnicodeUTF8))\n self.label_4.setText(QtGui.QApplication.translate(\"Frame\", \"Translation\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L230_C8", "label": "setWindowTitle()", "type": "expression", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.9664, 0.0042, 2, 0.19, 0.0, 38, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setWindowTitle", "arg_names": [], "import_names": [], "rhs_call_name": "setWindowTitle", "annotation": ""}, "snippet": " Frame.setWindowTitle(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L231_C8", "label": "setText()", "type": "expression", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.9706, 0.0042, 2, 0.19, 0.1667, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.label_2.setText(QtGui.QApplication.translate(\"Frame\", \"Frame\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L232_C8", "label": "setText()", "type": "expression", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.9748, 0.0042, 2, 0.19, 0.3333, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.label.setText(QtGui.QApplication.translate(\"Frame\", \"Arm\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L233_C8", "label": "setText()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.979, 0.0042, 2, 0.19, 0.5, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.arm_left.setText(QtGui.QApplication.translate(\"Frame\", \"Left Arm\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L234_C8", "label": "setText()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.9832, 0.0042, 2, 0.19, 0.6667, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.arm_right.setText(QtGui.QApplication.translate(\"Frame\", \"Right Arm\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L235_C8", "label": "setText()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.9874, 0.0042, 2, 0.19, 0.8333, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.label_5.setText(QtGui.QApplication.translate(\"Frame\", \"Rotation\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L236_C8", "label": "setText()", "type": "expression", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "vector": [8, 2, 0.9916, 0.0042, 2, 0.19, 1.0, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self.label_4.setText(QtGui.QApplication.translate(\"Frame\", \"Translation\", None, QtGui.QApplication.UnicodeUTF8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99286:Import_L238_C0", "label": "icons_rc import icons_rc", "type": "import", "loc": [238, 238], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.0042, 0, 0.66, 1.0, 959, 0, 1, 0, 0, 959, 0, 0], "semantic": {"name": "icons_rc", "arg_names": [], "import_names": ["icons_rc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import icons_rc"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99286:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99286:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99286:Expr_L236_C8"}] |
#! /usr/bin/python
import roslib; roslib.load_manifest('kelsey_sandbox')
import rospy
import roslib.message
import rosbag
import sys
import rosservice
from datetime import datetime
from hrl_lib.util import save_pickle
import yaml
#from hrl_lib import *
#from tabletop_object_detector.srv import TabletopDetection
if __name__ == "__main__":
service_args = []
for arg in sys.argv[2:]:
if arg == '':
arg = "''"
service_args.append(yaml.load(arg))
req, resp = rosservice.call_service(sys.argv[1], service_args)
a = datetime.now().isoformat('-')
name = '-'.join(a.split(':')).split('.')[0]
save_pickle(resp, sys.argv[1].split('/')[-1] + name + ".pickle")
| ajibawa-2023/Python-Code-Large/train/row_99287 | 20 | 26 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L3_C0", "label": "roslib import roslib", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1154, 0.0385, 0, 0.66, 0.0, 796, 0, 1, 0, 0, 796, 0, 0], "semantic": {"name": "roslib", "arg_names": [], "import_names": ["roslib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('kelsey_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Expr_L3_C15", "label": "load_manifest()", "type": "expression", "loc": [3, 3], "level": 0, "parent": null, "vector": [8, 0, 0.1154, 0.0385, 0, 0.66, 0.1, 630, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "load_manifest", "annotation": ""}, "snippet": "import roslib; roslib.load_manifest('kelsey_sandbox')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L4_C0", "label": "rospy import rospy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1538, 0.0385, 0, 0.66, 0.2, 164, 0, 1, 0, 0, 164, 0, 0], "semantic": {"name": "rospy", "arg_names": [], "import_names": ["rospy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rospy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L5_C0", "label": "roslib.message import roslib.message", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1923, 0.0385, 0, 0.66, 0.3, 98, 0, 1, 0, 0, 98, 0, 0], "semantic": {"name": "roslib.message", "arg_names": [], "import_names": ["roslib.message"], "rhs_call_name": "", "annotation": ""}, "snippet": "import roslib.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L6_C0", "label": "rosbag import rosbag", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0385, 0, 0.66, 0.4, 243, 0, 1, 0, 0, 243, 0, 0], "semantic": {"name": "rosbag", "arg_names": [], "import_names": ["rosbag"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosbag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L7_C0", "label": "sys import sys", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2692, 0.0385, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L8_C0", "label": "rosservice import rosservice", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.3077, 0.0385, 0, 0.66, 0.6, 924, 0, 1, 0, 0, 924, 0, 0], "semantic": {"name": "rosservice", "arg_names": [], "import_names": ["rosservice"], "rhs_call_name": "", "annotation": ""}, "snippet": "import rosservice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:ImportFrom_L9_C0", "label": "from datetime import datetime", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.3462, 0.0385, 0, 0.66, 0.7, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "from datetime import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:ImportFrom_L10_C0", "label": "from hrl_lib.util import save_pickle", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.3846, 0.0385, 0, 0.66, 0.8, 775, 0, 1, 0, 0, 775, 0, 0], "semantic": {"name": "hrl_lib.util", "arg_names": [], "import_names": ["save_pickle"], "rhs_call_name": "", "annotation": ""}, "snippet": "from hrl_lib.util import save_pickle"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Import_L11_C0", "label": "yaml import yaml", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.4231, 0.0385, 0, 0.66, 0.9, 960, 0, 1, 0, 0, 960, 0, 0], "semantic": {"name": "yaml", "arg_names": [], "import_names": ["yaml"], "rhs_call_name": "", "annotation": ""}, "snippet": "import yaml"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "label": "if", "type": "if", "loc": [16, 25], "level": 0, "parent": null, "vector": [4, 0, 0.7885, 0.3846, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n service_args = []\n for arg in sys.argv[2:]:\n if arg == '':\n arg = \"''\"\n service_args.append(yaml.load(arg))\n req, resp = rosservice.call_service(sys.argv[1], service_args) \n a = datetime.now().isoformat('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L17_C4", "label": "service_args =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "vector": [14, 1, 0.6538, 0.0385, 1, 0.65, 0.0, 96, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "service_args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " service_args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:For_L18_C4", "label": "for arg", "type": "for", "loc": [18, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "vector": [6, 1, 0.75, 0.1538, 1, 0.65, 0.2, 447, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in sys.argv[2:]:\n if arg == '':\n arg = \"''\"\n service_args.append(yaml.load(arg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L19_C8", "label": "if", "type": "if", "loc": [19, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:For_L18_C4", "vector": [4, 2, 0.75, 0.0769, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arg == '':\n arg = \"''\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L20_C12", "label": "arg =", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L19_C8", "vector": [14, 3, 0.7692, 0.0385, 3, 0.75, 0.0, 447, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arg = \"''\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Expr_L21_C8", "label": "append()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:For_L18_C4", "vector": [8, 2, 0.8077, 0.0385, 2, 0.02, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " service_args.append(yaml.load(arg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L22_C4", "label": "req, resp = call_service()", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "vector": [14, 1, 0.8462, 0.0385, 1, 0.65, 0.4, 176, 3, 2, 0, 0, 932, 10, 1], "semantic": {"name": "req, resp", "arg_names": [], "import_names": [], "rhs_call_name": "call_service", "annotation": ""}, "snippet": " req, resp = rosservice.call_service(sys.argv[1], service_args) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L23_C4", "label": "a = isoformat()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "vector": [14, 1, 0.8846, 0.0385, 1, 0.65, 0.6, 475, 3, 1, 0, 0, 24, 10, 2], "semantic": {"name": "a", "arg_names": [], "import_names": [], "rhs_call_name": "isoformat", "annotation": ""}, "snippet": " a = datetime.now().isoformat('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L24_C4", "label": "name =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "vector": [14, 1, 0.9231, 0.0385, 1, 0.65, 0.8, 57, 6, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = '-'.join(a.split(':')).split('.')[0] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99287:Expr_L25_C4", "label": "save_pickle()", "type": "expression", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "vector": [8, 1, 0.9615, 0.0385, 1, 0.65, 1.0, 390, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "save_pickle", "arg_names": [], "import_names": [], "rhs_call_name": "save_pickle", "annotation": ""}, "snippet": " save_pickle(resp, sys.argv[1].split('/')[-1] + name + \".pickle\")"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:For_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:For_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:For_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99287:If_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99287:Expr_L25_C4"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.